Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces comprehensive dark mode support to the Lantern app through a systematic refactoring of the color system and theming infrastructure. The changes enable users to choose between light, dark, and system-driven appearance modes.
Changes:
- Refactored color constants to use
constdeclarations and added semantic color tokens mapping to light/dark variants - Implemented full light and dark
ThemeDataconfigurations with proper Material 3ColorSchemeintegration - Updated all button components (Primary, Secondary, TextButton) to dynamically adapt colors based on theme brightness
- Added new Appearance settings screen with localized strings and UI for theme selection
Reviewed changes
Copilot reviewed 102 out of 107 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/core/common/app_colors.dart | Refactored all color getters to const fields, added gray850 for dark mode surfaces |
| lib/core/common/app_semantic_colors.dart | New file implementing BuildContext extension for semantic color tokens with light/dark variants |
| lib/core/common/app_theme.dart | Comprehensive light and dark theme definitions with proper ColorScheme mapping |
| lib/core/common/app_buttons.dart | Updated button styles to use theme-aware colors and semantic tokens |
| lib/core/common/app_asset.dart | Added useThemeColor flag to opt-out decorative images from theme recoloring |
| lib/core/models/entity/app_setting_entity.dart | Added themeMode field to persist user preference |
| lib/features/setting/appearance.dart | New appearance settings screen with system/light/dark options |
| lib/features/home/provider/app_setting_notifier.dart | Added setThemeMode method and toolbar brightness management for desktop |
| lib/lantern_app.dart | Integrated theme mode resolution into app widget |
| Multiple feature files | Replaced hardcoded AppColors references with semantic color extensions |
Comments suppressed due to low confidence (3)
lib/core/widgets/search_bar.dart:83
- The
Theme(data: ThemeData(), ...)wrapper at line 60 creates an empty ThemeData that discards the app's configured theme. This could cause issues in dark mode where the TextField would use default Material theme colors instead of the app's semantic colors. Consider removing this wrapper or inheriting from the parent theme usingTheme.of(context).copyWith(...).
lib/features/vpn/server_selection.dart:163 - Missing space after comma in the color parameter. Should be:
AppImage(path: AppImagePaths.blot, color: context.statusWarningBgDot,)
lib/features/vpn/location_setting.dart:58 - Missing space after comma in the color parameter. Should be:
AppImage(path: AppImagePaths.blot, color: context.statusWarningBgDot,)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request introduces several improvements to the design system, focusing on better color theming, semantic color usage, and enhanced support for light/dark/system appearance modes. The changes include a refactor of the color constants, updates to button and image components for more robust theme handling, and new localization strings for appearance settings.
Design System and Theming Improvements:
AppColorsto useconstdeclarations, added missing color constants (such asgray850), and improved documentation for clarity and consistency.PrimaryButton,SecondaryButton, andAppTextButtoninapp_buttons.dart) to use semantic colors and dynamically adjust their colors based on the current theme (light or dark), including background, border, text, and overlay states. [1] [2] [3] [4]AppImageto support auseThemeColorflag, allowing assets to opt out of theme-based recoloring for decorative or multicolor images. [1] [2]Component and Localization Enhancements:
AppDialogto defer background color and shape to the globaldialogTheme(inapp_theme.dart), improving consistency across dialogs. [1] [2] [3] [4]Semantic Color Integration:
app_semantic_colors.dartinto relevant files and updated text button to use the semantictextLinkcolor from context, supporting future theme customization. [1] [2] [3]Button API Improvements:
SecondaryButtonto acceptuseThemeColorandiconColorparameters, providing more flexibility for icon rendering in different contexts. [1] [2] [3] [4]These changes collectively improve the app's support for theming, accessibility, and maintainability of the design system.