Skip to content

Dark mode#8485

Open
jigar-f wants to merge 16 commits intomainfrom
jigar/dark-mode
Open

Dark mode#8485
jigar-f wants to merge 16 commits intomainfrom
jigar/dark-mode

Conversation

@jigar-f
Copy link
Contributor

@jigar-f jigar-f commented Feb 19, 2026

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:

  • Refactored all color definitions in AppColors to use const declarations, added missing color constants (such as gray850), and improved documentation for clarity and consistency.
  • Updated button components (PrimaryButton, SecondaryButton, and AppTextButton in app_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]
  • Modified AppImage to support a useThemeColor flag, allowing assets to opt out of theme-based recoloring for decorative or multicolor images. [1] [2]

Component and Localization Enhancements:

  • Updated AppDialog to defer background color and shape to the global dialogTheme (in app_theme.dart), improving consistency across dialogs. [1] [2] [3] [4]
  • Added new localization keys and strings for appearance settings: "Appearance", "Light", "Dark", and "System", enabling UI for theme selection.

Semantic Color Integration:

  • Integrated app_semantic_colors.dart into relevant files and updated text button to use the semantic textLink color from context, supporting future theme customization. [1] [2] [3]

Button API Improvements:

  • Enhanced SecondaryButton to accept useThemeColor and iconColor parameters, 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.

@jigar-f jigar-f self-assigned this Feb 19, 2026
@jigar-f jigar-f marked this pull request as ready for review February 19, 2026 16:45
@jigar-f jigar-f requested review from atavism and Copilot and removed request for Copilot February 20, 2026 05:44
Copy link
Contributor

Copilot AI left a 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 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 const declarations and added semantic color tokens mapping to light/dark variants
  • Implemented full light and dark ThemeData configurations with proper Material 3 ColorScheme integration
  • 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 using Theme.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments