feat: support muti-theme#19
Conversation
…settings repositories
There was a problem hiding this comment.
Pull request overview
This PR adds a user-configurable theming system (System/Light/Dark + optional pure-black dark mode) and wires it into settings persistence and the app’s top-level Compose theme, while updating parts of the UI to rely on MaterialTheme colors.
Changes:
- Add theme preferences (
ThemeMode, pure-black toggle) toSettingsRepositoryand persist them in DataStore (non-web) andlocalStorage(wasm). - Introduce
MarkDayTheme+ new light/dark/pure-black color palettes. - Update Settings UI to allow selecting theme mode and pure-black option; adjust some screens to use theme-based colors.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| composeApp/src/wasmJsMain/kotlin/io/github/smiling_pixel/preference/SettingsRepository.wasmJs.kt | Persists theme preferences in localStorage and exposes them as flows. |
| composeApp/src/nonWebMain/kotlin/io/github/smiling_pixel/preference/DataStoreSettingsRepository.kt | Adds theme preference keys and flows backed by DataStore. |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/theme/ThemeMode.kt | Introduces ThemeMode enum (System/Light/Dark). |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/theme/Theme.kt | Adds MarkDayTheme that selects light/dark/pure-black color schemes. |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/theme/Color.kt | Defines the new palette constants for light/dark/pure-black. |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/screens/SettingsScreen.kt | Adds Appearance section UI for theme mode and pure-black toggle. |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/screens/MomentsScreen.kt | Removes hardcoded Color import (toward theme usage). |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/screens/EntryDetailsScreen.kt | Replaces hardcoded grays with MaterialTheme.colorScheme values. |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/preference/SettingsRepository.kt | Extends settings API with theme/pure-black flows + setters. |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/App.kt | Applies MarkDayTheme based on persisted theme settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.foundation.verticalScroll | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.material3.HorizontalDivider |
There was a problem hiding this comment.
HorizontalDivider is imported but not used in this file, which will generate an unused-import warning (and may fail builds if warnings are treated as errors). Please remove the unused import.
| import androidx.compose.material3.HorizontalDivider |
…ettingsRepository Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces a comprehensive theming system for the application, including support for user-selectable theme modes (System, Light, Dark), a "Pure Black" mode for OLED screens, and a new color palette for both light and dark themes. The settings screen is enhanced to allow users to choose their preferred appearance. Additionally, the UI is updated to consistently use theme-based colors, improving visual coherence and dark mode support.