feat(#30): replace category swatch grid with HSV color picker #35

Merged
admin merged 1 commits from feat/30-category-rgb-color-picker into main 2026-06-28 14:21:44 +00:00
Owner

Summary

  • Add com.github.skydoves:colorpicker-compose:1.2.0 (Apache-2.0, Compose-native HSV picker) to gradle/libs.versions.toml and app/build.gradle.kts.
  • Replace the hardcoded 8-swatch LazyVerticalGrid and the ColorSwatch private composable in CategoryScreen.kt with the library's HsvColorPicker, driven by a ColorPickerController. Initial color is seeded via the new initialColor parameter from initial?.color ?: Category.DEFAULT_COLOR_OTHER.
  • The dialog's color state is updated live via onColorChanged (gated by envelope.fromUser to ignore the initial seed). Category.color is unchanged — still Int (ARGB) — so the data layer is untouched.
  • Wrap the dialog text slot in verticalScroll(rememberScrollState()) and cap the picker at height(280.dp) so confirm/cancel stay reachable on small screens.

Test plan

  • ./gradlew :app:assembleDebug — build succeeds (warnings are pre-existing, unrelated to this change).
  • Open Categories → Add — confirm the dialog now shows an HSL wheel + sliders instead of the swatch grid; the name field is above the picker; the picker shows the default grey (DEFAULT_COLOR_OTHER) on first open.
  • Drag the wheel — confirm the color state updates in real time (visible on the picker itself).
  • Tap Confirm and reopen the dialog — confirm the picked color persisted.
  • Pick a color matching one of the hardcoded defaults (e.g. the food orange) — confirm it's allowed and persists.
  • Open a default category (e.g. "Uncategorized") — confirm its existing DEFAULT_COLOR_* is unaffected (the picker is only on the add/edit flow, never shown for defaults).
  • On a small-screen device or split-screen — confirm the picker caps at 280.dp and the dialog scrolls; confirm/cancel remain visible.

Closes #30

## Summary - Add `com.github.skydoves:colorpicker-compose:1.2.0` (Apache-2.0, Compose-native HSV picker) to `gradle/libs.versions.toml` and `app/build.gradle.kts`. - Replace the hardcoded 8-swatch `LazyVerticalGrid` and the `ColorSwatch` private composable in `CategoryScreen.kt` with the library's `HsvColorPicker`, driven by a `ColorPickerController`. Initial color is seeded via the new `initialColor` parameter from `initial?.color ?: Category.DEFAULT_COLOR_OTHER`. - The dialog's `color` state is updated live via `onColorChanged` (gated by `envelope.fromUser` to ignore the initial seed). `Category.color` is unchanged — still `Int` (ARGB) — so the data layer is untouched. - Wrap the dialog `text` slot in `verticalScroll(rememberScrollState())` and cap the picker at `height(280.dp)` so confirm/cancel stay reachable on small screens. ## Test plan - [x] `./gradlew :app:assembleDebug` — build succeeds (warnings are pre-existing, unrelated to this change). - [ ] Open Categories → Add — confirm the dialog now shows an HSL wheel + sliders instead of the swatch grid; the name field is above the picker; the picker shows the default grey (`DEFAULT_COLOR_OTHER`) on first open. - [ ] Drag the wheel — confirm the `color` state updates in real time (visible on the picker itself). - [ ] Tap Confirm and reopen the dialog — confirm the picked color persisted. - [ ] Pick a color matching one of the hardcoded defaults (e.g. the food orange) — confirm it's allowed and persists. - [ ] Open a default category (e.g. "Uncategorized") — confirm its existing `DEFAULT_COLOR_*` is unaffected (the picker is only on the add/edit flow, never shown for defaults). - [ ] On a small-screen device or split-screen — confirm the picker caps at 280.dp and the dialog scrolls; confirm/cancel remain visible. Closes #30
admin added 1 commit 2026-06-28 14:17:31 +00:00
admin merged commit 38baeef401 into main 2026-06-28 14:21:44 +00:00
admin deleted branch feat/30-category-rgb-color-picker 2026-06-28 15:01:27 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/ledgerr#35