Skip to content

Add system-driven dark mode#36

Merged
dfalling merged 1 commit into
mainfrom
add-dark-mode
Jun 5, 2026
Merged

Add system-driven dark mode#36
dfalling merged 1 commit into
mainfrom
add-dark-mode

Conversation

@dfalling
Copy link
Copy Markdown
Owner

@dfalling dfalling commented Jun 5, 2026

Summary

  • Add a small theme layer in src/theme/: light/dark semantic color tokens (colors.ts) and a useTheme() hook over useColorScheme() (useTheme.ts). Appearance follows the system setting only — no in-app toggle.
  • Route every screen's colors through the theme via per-component makeStyles(theme) factories. Light mode keeps the original colors, so it's visually unchanged.
  • Map (the priority): MapScreen swaps the MapLibre style URL to OpenFreeMap's dark basemap (…/styles/dark) in dark mode, and recolors pins, the pin ring, and the recenter button for contrast against it.
  • App.tsx sets React Navigation's container theme (DarkTheme/DefaultTheme) so transition gaps don't flash white, and themes the splash/status bar.

Surfaces themed

MapScreen, SearchOverlay, ElementPreviewCard, ElementDetailScreen, ElementEditScreen, FilterChips, AccountMenu, Sheet, LoginScreen.

Verification

  • tsc --noEmit, biome check, and jest (5 tests) all pass.
  • Manually verified on an Android emulator in night mode: map, search overlay, preview card, detail, edit, and account sheet all render correctly in dark mode.

The app honored the OS color scheme only for the status bar; every surface
was hardcoded to a light palette, which looked broken under a dark system
theme. Introduce a small theme layer (light/dark semantic tokens + a
useTheme hook over useColorScheme) and route every screen's colors through
it, so appearance follows the system setting with no in-app toggle.

The map is the centerpiece: it now swaps the MapLibre style URL to
OpenFreeMap's dark basemap and recolors pins/controls for contrast against it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dfalling dfalling merged commit c828935 into main Jun 5, 2026
2 checks passed
@dfalling dfalling deleted the add-dark-mode branch June 5, 2026 20:42
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