Skip to content

Conversation

@salmonumbrella
Copy link

Summary

This PR adds complete dark mode support to the Chatwoot mobile app with:

  • System theme detection: Automatically follows device dark/light mode setting
  • Manual theme switching: Users can choose Light, Dark, or System in Settings
  • Comprehensive coverage: 112 files updated with dark mode variants
  • Reactive StatusBar: Adapts to theme changes in real-time
  • No flash on startup: Uses useLayoutEffect for synchronous theme application

Changes

Core Infrastructure

  • New ThemeContext with reactive system theme detection via Appearance API
  • Redux integration for persisting user's theme preference
  • app.config.ts configured with userInterfaceStyle: 'automatic'

Component Coverage

Category Files
Auth screens 4
Chat & messages 35+
Conversations 15+
Inbox & Dashboard 10+
Settings 5+
Common components 20+
Navigation 5+

Dark Mode Pattern

// Backgrounds
bg-white  bg-white dark:bg-grayDark-50
bg-gray-100  bg-gray-100 dark:bg-grayDark-100

// Text
text-gray-950  text-gray-950 dark:text-grayDark-950

// StatusBar (reactive)
barStyle={isDark ? 'light-content' : 'dark-content'}

Screenshots

Screenshots pending - the implementation follows the existing Radix UI color system with grayDark-* variants.

Test Plan

  • Test theme switching in Settings (Light → Dark → System)
  • Test system theme change while app is running
  • Verify no white flash on app startup in dark mode
  • Test all screens in both light and dark modes
  • Verify StatusBar appearance across all screens
  • Test message bubbles (all types) in dark mode

Related

This PR builds upon and supersedes the work started in #983 by @dilutedev. Key improvements:

  • Fixed version/dependency regressions
  • Added comprehensive dark mode to all 112 component files (vs ~5 originally)
  • Fixed StatusBar reactivity across all screens
  • Fixed ThemeContext race condition

🤖 Generated with Claude Code

Add complete dark mode support to the Chatwoot mobile app with automatic
system theme detection and manual theme switching.

## Core Infrastructure
- Add ThemeContext with reactive system theme detection
- Use useLayoutEffect to prevent theme flash on app startup
- Integrate with Redux for theme preference persistence
- Configure app.config.ts with userInterfaceStyle: 'automatic'

## Component Coverage (112 files)
- All auth screens (Login, ConfigURL, ForgotPassword, MFA)
- Conversation and chat screens with message components
- All message types (text, audio, video, file, location, email)
- Inbox and Dashboard screens
- Settings and contact details
- Navigation tabs and bottom bar
- Sheet components, lists, and labels
- Macros, SLA indicators, and action panels

## Dark Mode Pattern
- bg-white → bg-white dark:bg-grayDark-50
- bg-gray-* → bg-gray-* dark:bg-grayDark-*
- text-gray-* → text-gray-* dark:text-grayDark-*
- Reactive StatusBar (light-content in dark, dark-content in light)
- Theme-aware Switch component colors

## Fixes from PR Review
- Restore version to 4.3.12
- Restore axios to ^1.12.0
- Restore security overrides in package.json
- Fix ThemeContext race condition with useState + useLayoutEffect

Based on initial work by @dilutedev in PR chatwoot#983

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant