Repository navigation
refactor: replace AppComponents with AppColors for theming - #697
Merged
Merged
Conversation
haiphucnguyen
commented
Sep 5, 2026
Collaborator
- Introduce AppColors.kt providing a new color helper API
- Remove all AppComponents imports and replace color usage across the UI
- Update theme preferences to normalize locales when saving
- Replace colorScheme references with AppColors utilities in all UI files
- Update dropdown, cards, text fields, icons, and panels to use AppColors
- Update localization manager to normalize locale strings before storing
- Introduce AppColors.kt providing a new color helper API - Remove all AppComponents imports and replace color usage across the UI - Update theme preferences to normalize locales when saving - Replace colorScheme references with AppColors utilities in all UI files - Update dropdown, cards, text fields, icons, and panels to use AppColors - Update localization manager to normalize locale strings before storing BREAKING CHANGE: AppComponents is removed; all components must now import and use AppColors for theming.
There was a problem hiding this comment.
🟡 Changes recommended
The Whisper STT locale-to-language conversion can still produce invalid language codes (legacy underscore tags and locale-sensitive lowercasing), which can break transcription requests.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR centralizes theming color tokens into a new AppColors API and migrates UI call sites away from AppComponents color helpers, while also normalizing persisted locale tags to avoid script/variant-heavy BCP-47 forms (e.g. vi-Latn-VN).
Changes:
- Added
AppColors.ktas the single source of truth for UI color tokens (surfaces, borders, popups, icons, status tones, etc.). - Updated a large set of Compose UI components to use
AppColors(and related helpers) instead ofMaterialTheme.colorScheme/AppComponentscolor utilities. - Normalized locale tags when loading/saving preferences and when discovering available locales; updated OpenAI Whisper STT calls to pass a plain language code.
File summaries
| File | Description |
|---|---|
| shared/src/main/kotlin/io/askimo/core/i18n/LocalizationManager.kt | Normalizes discovered locales to language[-country] when building the available-locale map. |
| desktop/src/main/kotlin/io/askimo/desktop/user/WelcomeProfileDialog.kt | Switches outlined text field colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/user/UserProfileDialog.kt | Switches outlined text field colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/shell/TelemetryPanel.kt | Replaces colorScheme-derived card/text colors with AppColors tokens. |
| desktop/src/main/kotlin/io/askimo/desktop/shell/ProviderModelPanel.kt | Migrates list/search/icon/text field colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/shell/NavigationSidebar.kt | Migrates navigation item/icon colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/shell/FooterBar.kt | Migrates sidebar background and caption tint to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/shell/ComposeTopMenuBar.kt | Migrates sidebar surface/border/menu-item colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/WebSearchSettingsSection.kt | Migrates description/card container colors to AppColors/shared style tokens. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/VoiceSettingsSection.kt | Migrates description/cards/surfaces to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/SettingsView.kt | Migrates sidebar/header backgrounds and separators to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/SettingsConfigDialog.kt | Migrates text field colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/ProviderSelectionDialog.kt | Migrates card/text field colors and secondary content tint helpers to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/NetworkSettingsSection.kt | Migrates banner card colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/McpServerManagementSection.kt | Migrates banner card colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/GroupedModelList.kt | Migrates selected/unselected card colors to AppColors elevation tiers. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/AIProviderSettingsSection.kt | Migrates cards and text field colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/AdvancedSettingsSection.kt | Migrates settings cards and input colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/AboutSettingsSection.kt | Migrates about/settings cards to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/settings/AboutDialog.kt | Migrates about dialog cards to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/project/UrlInputDialog.kt | Migrates outlined text field colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/project/ProjectView.kt | Migrates banner/cards/dividers/progress tracks and icon tints to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/project/ProjectsView.kt | Migrates filters/cards/row hover/dividers and icon tint to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/project/NewProjectDialog.kt | Migrates text field colors and dividers to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/project/EditProjectDialog.kt | Migrates text field colors and dividers to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/project/AddReferenceMaterialDialog.kt | Migrates divider/border colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/plan/PlanEditorView.kt | Migrates placeholder/surface colors and input colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/Main.kt | Migrates small decorative indicator tint to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/chat/RagSourcesTree.kt | Migrates search/selection highlights and menu usage to AppColors + AppComponents.dropdownMenu. |
| desktop/src/main/kotlin/io/askimo/desktop/chat/ProjectSidePanel.kt | Migrates panel/rail/selection/empty-state colors to AppColors. |
| desktop/src/main/kotlin/io/askimo/desktop/chat/FileViewerPane.kt | Migrates viewer background and icon tint to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/voice/impl/OpenAiSpeechToTextService.kt | Updates Whisper transcription call to pass language code from locale. |
| desktop-shared/src/main/kotlin/io/askimo/ui/terminal/TerminalPanel.kt | Routes context menus through AppComponents.dropdownMenu. |
| desktop-shared/src/main/kotlin/io/askimo/ui/shell/StarPromptDialog.kt | Migrates hover/secondary text and menu colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/shell/NotificationComponents.kt | Migrates popup/card/badge/secondary/monospace detail colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/shell/NavigationSidebar.kt | Migrates sidebar surfaces, nav item colors, and dividers to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/shell/LogViewerDialog.kt | Migrates scrim to AppColors.scrimColor. |
| desktop-shared/src/main/kotlin/io/askimo/ui/shell/GlobalSearchDialog.kt | Migrates text fields, spinner track, empty-state icon, and card surfaces to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/shell/EventLogPanel.kt | Migrates resize handle and dock menu to AppColors + AppComponents.dropdownMenu. |
| desktop-shared/src/main/kotlin/io/askimo/ui/settings/ShortcutsSettingsSection.kt | Migrates cards/hover backgrounds/chips to AppColors elevation tiers. |
| desktop-shared/src/main/kotlin/io/askimo/ui/settings/AppearanceSettingsSection.kt | Migrates text fields/cards/tiles/scrims/dividers to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/settings/AgentsSettingsSection.kt | Migrates side panel surfaces, selection backgrounds, and input colors to AppColors; reuses inlineErrorMessage. |
| desktop-shared/src/main/kotlin/io/askimo/ui/session/SessionTooltip.kt | Migrates divider border color to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/session/SessionsView.kt | Migrates text fields/table surfaces/dividers and icon tints to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/session/SessionMemoryDialog.kt | Migrates placeholder/result cards to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/session/RenameSessionDialog.kt | Migrates outlined text field colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/session/NewDirectiveDialog.kt | Migrates outlined text field colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/session/ManageDirectivesDialog.kt | Migrates sidebar card container to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/session/ExportSessionDialog.kt | Migrates text field colors and border/selected content tints to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/session/EditDirectiveDialog.kt | Migrates outlined text field colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/plan/PlansGalleryView.kt | Migrates dividers/menu-item colors and icon tints to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/plan/PlanInputField.kt | Migrates hint/menu-item colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/plan/PlanHistorySidePanel.kt | Migrates panel/rail surfaces and icon/text tints to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/plan/PlanDetailView.kt | Migrates dividers/surfaces/secondary content tints and inputs to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/onboarding/OnboardingWizardDialog.kt | Migrates onboarding cards/placeholders/tiles/buttons to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/mcp/McpToolsDialog.kt | Migrates text field/colors/cards/dividers and parameter tint hierarchy to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/mcp/McpServerCatalogDialog.kt | Migrates search field colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/mcp/AddMcpInstanceDialog.kt | Migrates cards and outlined text field colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/discover/DiscoverView.kt | Migrates dividers/cards/hover backgrounds and icon tint to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/ui/MermaidChartRenderer.kt | Migrates scrim overlay colors to AppColors.scrimColor. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/ui/MarkdownText.kt | Migrates inline-code/math backgrounds, code-block colors, tables, and scrims to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/ui/CodeViewerBlock.kt | Migrates code block theme lookups and scrollbar colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/theme/ThemePreferences.kt | Normalizes locales on load/save and self-heals legacy persisted locale tags. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/theme/AppComponents.kt | Removes color-token responsibilities from AppComponents and switches internal defaults to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/theme/AppColors.kt | Adds new centralized color-token API for the app (surfaces, popups, icons, badges, status, etc.). |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/dialog/UpdateDialog.kt | Migrates update dialog banner/cards to AppColors tiers. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/components/TablePagination.kt | Uses shared disabled-content token for pagination icons. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/components/Icons.kt | Migrates warning/not-indexed icon tints to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/components/Buttons.kt | Migrates secondary/link button border/disabled content tints to AppColors/shared tokens. |
| desktop-shared/src/main/kotlin/io/askimo/ui/common/components/ActionInputField.kt | Migrates input colors and spinner track to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/chat/OutdatedMessageComponents.kt | Migrates outdated message surfaces/overlays/tints to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/chat/MessageComponents.kt | Migrates message list/bubbles/tool-call section colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/chat/ChatView.kt | Migrates sidebar card, banner cards, and scrim to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/chat/ChatInputField.kt | Migrates banners, resize UI, menus, chips, server badges, and attachments to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/bookmarks/BookmarksView.kt | Migrates empty state, group card, dividers, and hover affordances to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/agent/WorkspaceFilesPanel.kt | Migrates inputs/surfaces/selection and destructive tints to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/agent/AgentView.kt | Migrates scrim, header icon tint, sidebar surfaces, and dividers to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/agent/AgentRunArea.kt | Migrates surfaces/popups/inputs and readiness/status UI colors to AppColors. |
| desktop-shared/src/main/kotlin/io/askimo/ui/agent/AgentHistoryPanel.kt | Migrates row hover surfaces and destructive/empty-state tints to AppColors. |
Review details
- Files reviewed: 79/79 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| * (e.g. `"vi"`, `"en"`), not a full BCP-47 tag like `"vi-VN"`. Strip any region/script | ||
| * subtag from [AppConfig.currentLocale] before passing it along. | ||
| */ | ||
| private fun whisperLanguageCode(): String = (AppConfig.currentLocale ?: "en").substringBefore('-').lowercase().ifBlank { "en" } |
| * highlight are always clipped to rounded corners (prevents the rectangle-border bug). | ||
| * - Default: `surfaceVariant.copy(alpha = 0.5f)` + `outlineVariant.copy(alpha = 0.6f)` border. | ||
| * - Hover: `primaryContainer.copy(alpha = 0.25f)` + `primary.copy(alpha = 0.4f)` border. | ||
| * - Default: [AppColors.Elevation.RAISED] + `outlineVariant.copy(alpha = 0.6f)` border. |
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.