Fix custom theme dark mode and rebuild the custom colour model#24
Draft
mapgie wants to merge 2 commits into
Draft
Fix custom theme dark mode and rebuild the custom colour model#24mapgie wants to merge 2 commits into
mapgie wants to merge 2 commits into
Conversation
The custom theme was permanently light: MyAppTheme called buildCustomColorScheme with a hardcoded isDark = false, and switching Light/Dark/Auto while Custom was active silently jumped to the Teal palette. The picker also only offered hue sliders with fixed saturation/lightness, previews used different S/L constants than the builder, and backgrounds were not user-controllable. - Custom themes now honour a Light/Dark/System mode of their own (customThemeMode preference); the mode row drives it while Custom is active instead of deselecting the custom theme. - Each colour role (primary/secondary/tertiary) opens a full colour picker dialog (HSV square, hue bar, hex entry) and the exact picked ARGB is applied verbatim; on-colours are chosen by relative luminance so text stays legible on any pick. Legacy hue values remain as fallbacks for existing installs. - Light and dark background colours can be set directly, with an Auto option deriving them from the primary colour as before. - Previews and saved-theme swatches resolve through the same helper the scheme builder uses, so what you pick is what you get. - Saved themes persist the exact colours and mode (Room v1 -> v2 migration, additive columns), restore them on load, and rows load on tap. - Refresh stale versioning docs (CLAUDE.md, CHANGELOG.md policy) to match the changelog-fragment flow enforced by CI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEGQ585q9wtogd9G1v7Ef1
CompactThemePicker's mode row uses Modifier.height(IntrinsicSize.Min); the layout.height import was dropped when the custom section was rewritten, failing compileDebugKotlin. Also drop the now-unused semantics contentDescription import. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEGQ585q9wtogd9G1v7Ef1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The template's custom theme had four compounding problems that made it a poor plug-and-play base for the other apps:
MyAppThemecalledbuildCustomColorScheme(..., isDark = false)unconditionally, so custom themes were permanently light; the builder's dark branch was dead code.Changes
Theme engine (
Color.kt,Theme.kt)customThemeModepreference (LIGHT/DARK/SYSTEM); the custom scheme is built for the right mode, and the status-bar icon logic now covers all system-following palettes and Custom.buildCustomColorSchemeaccepts exact ARGBs per role plus a per-mode background override. Picked colours are applied verbatim; on-colours are chosen by relative luminance so text stays legible on any pick; containers/neutrals derive from the resolved colours. Legacy hue values remain as fallbacks so existing installs and old saved profiles keep working.resolveCustomRoleColor()helper is shared by the builder, picker previews, and saved-theme swatches, so previews show exactly what the theme applies.Picker UI (
CompactThemePicker.kt, newColorPickerDialog.kt)Saved themes (
CustomColorTheme,AppDatabase,SavedThemesList.kt,SettingsViewModel.kt)modecolumn, previously always written"LIGHT"and never read, is now honoured.Docs
CLAUDE.mdand theCHANGELOG.mdpolicy header still described the old manual version-bump flow; both now match the changelog-fragment flow thatchangelog-check.ymlactually enforces.Changelog fragment:
changelog/unreleased/custom-theme-overhaul.json(minor).a11y_check.pypasses (27 files, clean).🤖 Generated with Claude Code
https://claude.ai/code/session_01YEGQ585q9wtogd9G1v7Ef1
Generated by Claude Code