-
Notifications
You must be signed in to change notification settings - Fork 4
[TAS-4569] ✨ Support color mode #635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive color mode (light/dark/system) support to the 3ook.com application. The implementation includes user preference storage, UI components for switching modes, and extensive styling updates across pages and components to support dark mode.
Changes:
- Added color mode type definitions and user settings integration for persisting user preferences
- Enabled Nuxt UI color mode with light as default, and created a composable to sync color mode with user settings
- Updated CSS with dark mode variants, replacing hardcoded colors with semantic color classes (text-highlighted, text-muted, text-dimmed, bg-accented)
- Added ColorModeSwitcher component and integrated it into the account settings page
- Applied dark mode styling across all major pages (store, reader, checkout, account, about) and components
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/types/user-settings.d.ts | Added ColorMode type and colorMode field to user settings |
| nuxt.config.ts | Enabled Nuxt UI color mode with custom storage key and light default |
| composables/use-color-mode-sync.ts | New composable to synchronize color mode between Nuxt and user settings |
| components/ColorModeSwitcher.vue | New component for selecting color mode (light/dark/system) |
| assets/css/main.css | Added dark mode CSS variables and moved highlighted text color into mode-specific rules |
| app.config.ts | Updated UI component theme with dark mode ring colors |
| pages/store/index.vue | Updated tag button hover states with dark mode variants |
| pages/store/claim.vue | Replaced gray-600 with semantic text-muted class |
| pages/store/[nftClassId]/index.vue | Updated text colors and backgrounds to support dark mode throughout product page |
| pages/reader/epub.vue | Added dark mode support to epub reader with background and text color changes, updated UI controls |
| pages/plus/success.vue | Replaced hardcoded green and gray colors with semantic theme colors |
| pages/list.vue | Updated heading color to use theme-cyan |
| pages/checkout.vue | Replaced hardcoded colors with semantic classes throughout checkout flow |
| pages/account/index.vue | Added ColorModeSwitcher to account settings |
| pages/about.vue | Updated text colors to use semantic text-muted class |
| components/* | Updated various components with dark mode support using semantic color classes |
| i18n/locales/*.json | Added translations for color mode labels and reordered some keys |
244887e to
07df180
Compare
07df180 to
9756fcb
Compare
9756fcb to
97a3557
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 32 out of 33 changed files in this pull request and generated 4 comments.
97a3557 to
b8e59ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 33 out of 34 changed files in this pull request and generated 5 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 33 out of 34 changed files in this pull request and generated 4 comments.
b8e59ab to
6541ce6
Compare
8b1b0a9 to
a11d502
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 36 out of 37 changed files in this pull request and generated 3 comments.
| if (settingsEntry.value?.data) { | ||
| (settingsEntry.value.data as Record<string, unknown>)[key] = value | ||
| } |
Copilot
AI
Feb 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The immediate update of settingsEntry.value.data in queueUpdate creates a potential race condition. If the API call fails, the local state will be out of sync with the server. Consider whether this optimistic update is necessary, or if a rollback mechanism should be added to revert the change on API failure.
a11d502 to
83d7788
Compare
83d7788 to
731b79a
Compare
| definePageMeta({ layout: false }) | ||
| definePageMeta({ | ||
| layout: false, | ||
| colorMode: 'light', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why force light mode here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont want to waste time on tuning the about page for dark mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 39 out of 40 changed files in this pull request and generated 4 comments.
| @@ -0,0 +1,64 @@ | |||
| export function useColorModeSync() { | |||
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ColorMode type is used but not imported. This file needs to import ColorMode from the shared types to avoid TypeScript errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto imported
| import type { UserSettingKey } from '~/shared/types/user-settings' | ||
|
|
||
| const ALLOWED_KEYS = ['locale', 'currency'] as const satisfies readonly UserSettingKey[] | ||
| const ALLOWED_KEYS = ['locale', 'currency', 'colorMode'] as const satisfies readonly UserSettingKey[] |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UserSettingKey is used on line 1 and 15 but is not imported. This will cause a TypeScript error. Add the import statement at the top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto imported
| const selectedColorMode = computed(() => preference.value) | ||
|
|
||
| function handleColorModeChange(value: string) { | ||
| preference.value = value as ColorMode |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ColorMode type is used on line 34 but is not imported. This will cause a TypeScript error. Add the import for ColorMode from shared types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto imported
No description provided.