Fix custom palette save mechanics and add direct background control#168
Draft
mapgie wants to merge 1 commit into
Draft
Fix custom palette save mechanics and add direct background control#168mapgie wants to merge 1 commit into
mapgie wants to merge 1 commit into
Conversation
Saving always created a duplicate profile (no update-in-place), the rename function existed but had no UI, deleting the active profile left a dangling active-profile pointer, and the swatch shown for an unpicked colour slot used different saturation/brightness than the theme builder actually applies. Backgrounds were derived from the primary hue with no way to change them directly. - With an active saved palette the save row now offers "Update" (overwrites in place) and "Save as new"; without one it stays a single "Save palette" action. - Each saved palette row gains a rename button wiring up the previously unused renameColorProfile. - Deleting the active palette clears the active pointer; the working colours stay applied since they live in DataStore. - New "Background (light)" and "Background (dark)" rows override the derived background via the existing colour picker dialog, with an Auto reset. Overrides are stored in preferences and in saved palettes (Room v21 -> v22 additive migration); text and neutral tokens re-derive from the picked background so they stay legible. - Unpicked colour slots now preview the builder's actual hue fallback (HSL 0.60/0.35) instead of an oversaturated HSV placeholder. 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
GoFlo's custom theme is the strongest of the four apps (exact picked colours, HSV square + hex picker, contrast-aware on-colours), so this PR only closes its remaining gaps: janky save mechanics and no direct background control.
Changes
Save mechanics (
SettingsScreen.kt,SettingsViewModel.kt)updateColorProfile) and Save as new; without one it stays a single "Save palette" action.renameColorProfileexisted in the ViewModel but nothing called it. Each saved palette row gains a rename button that opens a rename dialog.customActiveProfileIdinstead of leaving a dangling pointer. The working colours stay applied, since they live in DataStore rather than the deleted row.Direct background control (
Color.kt,Theme.kt,ReminderPreferences.kt,MainActivity.kt)ColorPickerDialog. Overrides are ARGB with 0 = Auto (the previous derive-from-primary-hue behaviour), plus an explicit Auto reset.buildCustomColorSchemegains abackgroundArgbparameter: the picked background is applied exactly, and the neutral tokens (onBackground/surface/surfaceVariant/outline/inverse) re-derive from it by relative luminance so text stays legible. When Auto, every token keeps its existing hue-derived value, so current users see no change.color_profilesv21 → v22, two additive columns with defaults; no destructive migration).Preview accuracy
Changelog fragment:
changelog/unreleased/custom-palette-mechanics.json(minor).a11y_check.pypasses (92 files, clean).Companion PRs: mapgie/Android-App-Template#24, mapgie/choreDash-Android#81 (both adopt GoFlo's picker model), GaMeD PR to follow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YEGQ585q9wtogd9G1v7Ef1
Generated by Claude Code