Skip to content

Conversation

@JumpLink
Copy link
Owner

@JumpLink JumpLink commented Sep 11, 2025

This PR introduces a themeable appearance for the Learn-Platform across the GNOME app, while keeping shared logic clean in the monorepo. The goal is to make the UI more playful and customizable without sacrificing maintainability.

image image image image image image
  • Updated documentation and internal developer guides to reflect latest Adwaita styling, Blueprint usage, and documentation standards.
  • Implemented a GNOME-specific theme service with persistent settings and CSS variable overrides for primary and accent colors.
  • Added reusable UI widgets for selecting theme mode, primary color, and accent color.
  • Applied styling hooks and class updates so the UI reacts dynamically to theme changes.
  • Introduced GtkSourceView style schemes (light/dark) and custom highlight behavior.
  • Standardized service file naming across packages and updated imports accordingly.
  • Strengthened TypeScript strictness and consistency.

Why

  • Enable users to personalize the Learn-Platform (more playful look and feel).
  • Establish a consistent and maintainable theming architecture for future features.
  • Improve accessibility and UX through clear state-driven styles and class hooks.

Key Changes

  • Theme architecture

    • GNOME-specific ThemeService with:
      • System/light/dark scheme control via Adw.StyleManager
      • Primary and accent color overrides via CSS variables
      • Persistent preferences via Gio.Settings with new keys for color scheme, primary family, and accent family
      • Event-driven updates through ThemeEventMap
    • Registered widgets as “themed” to receive automatic mode and accent updates
  • UI widgets and styling

    • Added ThemeModeSelector, PrimaryColorSelector, AccentColorSelector
    • New styles for selectors and SourceView (source-view.css)
    • Imported utils.css, variables.css, and per-widget CSS in main.css and views/index.css
    • Menu entry for “Appearance” in main window and redesigned preferences page
    • Added compact selectors and improved margins, sizes, and OSD style for clarity
  • GtkSourceView schemes

    • Added learn6502-style.xml (light) and learn6502-style-dark.xml (dark)
    • Registered custom scheme search paths and prefer custom schemes with current-line highlight
  • Settings and resources

    • Updated eu.jumplink.Learn6502.gschema.xml with color scheme, primary color, accent color
    • Added new resources to gresource for style schemes
    • Updated settings.ts to use new Gio.Settings({ schema_id, path })
  • Code quality and consistency

    • Renamed service files to dot-style: file.service.ts, theme.service.ts, notification.service.ts (and across common-ui)
    • Updated index exports/imports to reflect renames
    • Strengthened TS config (strict, noImplicitAny, etc.)
    • 6502 core: moved addressing mode/length constants into constants and imported in assembler.ts, added small safety/typing fixes
  • Translations

    • Added strings for accent and primary color families
    • Updated DE/FR/ES/IA locales including “Blue”, “Confirm”, “Dark style”, “Follow system style”
  • Docs and guidance

    • Updated Adwaita styling links to latest documentation
    • Condensed Blueprint templates guide focusing on core patterns
    • Added comprehensive documentation creation expert guide

Developer Notes

  • Platform boundaries respected: GNOME-specific theming lives in app-gnome, shared types/events live in common-ui, core emulator logic in 6502.
  • No behavior change for app-web or app-android in this PR; can adopt the same theming concepts later.
  • Removed legacy theme-selector widget and old CSS includes in favor of the new architecture.

How to Use

  • Open Preferences → Appearance
    • Choose Scheme: Follow System, Light, or Dark
    • Select a Primary color family
    • Select an Accent color family
  • UI updates immediately; preferences persist across sessions.

- Add strict TypeScript configuration with noImplicitAny and strictNullChecks
- Extract ADDRESSING_MODES and INSTRUCTION_LENGTH constants to separate file
- Fix simulator type issues and improve key access patterns
- Update assembler to use extracted constants
- Update GSettings schema to use integer-based color-scheme instead of string theme
- Remove CSS provider initialization from application startup
- Update theme service initialization in application
- Update common theme service interface
- Rename application.css to main.css for consistency
- Rename service files to use kebab-case: file.service.ts, notification.service.ts, theme.service.ts
- Create new main.window.css with view-specific styles
- Update theme selector widget with improved styling
- Update main window layout and Blueprint templates
- Update service index to use new file names
- Change notifyListeners() to notifyThemeChanged() for consistent naming
- Update theme change notification handling in system appearance mode
- Add new theme-event-map.ts for theme-related event types
- Update types index to export new theme event map
- Remove deprecated theme-change-listener.ts type definition
- Update Adwaita styling guide with latest CSS variables and style classes
- Add links to new Adwaita documentation sections (Breakpoints, StyleManager)
- Enhance Blueprint templates guide with improved structure and examples
- Add accessibility and best practices sections to Blueprint guide
- Add consistent newlines at end of all translation JSON files
- Ensure uniform formatting across de.json, en.default.json, es.json, fr.json, ia.json
- Minor formatting improvements for better consistency
- Remove old application.css (renamed to main.css)
- Remove old service files (renamed with kebab-case)
- Remove deprecated theme-change-listener.ts type definition
- All files have been properly renamed/moved in previous commits
- Deleted Android-specific FileService, NotificationService, and ThemeService implementations.
- Removed common UI services including ButtonStateService, DebuggerStateService, GameConsoleInputService, GameConsoleStateService, LearnStateService, and NotificationService.
- These files were removed as part of a reorganization effort to streamline the codebase and eliminate unused services.
- Updated the stop method to check if executeId is defined before calling clearInterval.
- Made similar changes in the program completion logic to prevent potential errors when executeId is undefined.
…ies section

- Moved primary technologies to a dedicated section for clarity.
- Updated technologies list to include TypeScript, GJS, GTK 4, and links to Adwaita styling and Blueprint templates.
- Improved overall structure for better readability and accessibility.
- Introduced two new style scheme files: learn6502-style.xml and learn6502-style-dark.xml for light and dark themes respectively.
- Updated resource registration to include the new style schemes.
- Enhanced CSS for source view to utilize the new styles.
- Refactored theme service to manage primary CSS providers more efficiently.
- Removed the ThemeSelector from the popover menu and integrated it into the preferences dialog for a more cohesive user experience.
- Updated the preferences dialog to include a dedicated section for theme selection, allowing users to choose the app theme and primary color.
- Cleaned up CSS and TypeScript files related to theme management, ensuring better organization and maintainability.
- Updated translation files to reflect changes in UI text and structure.
- Added a new primary color preference to the GSettings schema, allowing users to select from predefined color options or no override.
- Updated the ThemeService to handle primary color settings, including loading and saving preferences.
- Refactored the ThemeSelector to reflect changes in primary color state and synchronize with the theme service.
- Introduced a new TypeScript type for primary color keys to improve type safety and maintainability.
- Added APPLICATION_ID constant to constants.ts for better clarity.
- Introduced new variables.css file to manage primary color theming based on light and dark modes.
- Refactored theme.service.ts to utilize APPLICATION_ID instead of SCHEMA_ID for GSettings.
- Removed outdated main.window.css and updated theme-selector.blp to improve layout and alignment of theme options.
- Enhanced theme-selector.css to streamline swatch styles and improve visual consistency.
- Replaced the ThemeSelector with ThemeModeSelector and PrimaryColorSelector in the preferences dialog for improved user experience.
- Updated CSS imports to reflect new widget names and added styles for the new selectors.
- Created new TypeScript and Blueprint files for the ThemeModeSelector and PrimaryColorSelector, enabling users to choose between light/dark modes and primary color options.
- Updated translation files to align with the new UI text and structure.
…dernize CSS

- Introduced a new option for using a custom primary color in the preferences dialog.
- Refactored the PrimaryColorSelector to manage the enabled state and ensure at least one color is selected when enabled.
- Updated CSS styles for the preferences dialog and primary color selector to enhance visual consistency.
- Removed outdated translation entries and added new translations for the custom primary color option across multiple languages.
…rate into PreferencesDialog

- Introduced a new option for users to select a custom accent color in the preferences dialog.
- Added AccentColorSelector widget to manage accent color choices and synchronize with theme settings.
- Updated ThemeService to handle accent color changes and persist user preferences.
- Enhanced CSS styles for the preferences dialog and accent color selector for improved visual consistency.
- Updated translation files to include new accent color options across multiple languages.
…tyling

- Enhanced variables.css to include new text color variables and adjusted color mixing for dark mode.
- Refactored ThemeService to streamline theme loading and management, replacing deprecated methods with updated ones.
- Updated preferences dialog and associated CSS to use a unified custom color group for primary and accent color settings.
- Improved overall CSS structure for better visual consistency across the application.
…or styling

- Introduced a new CSS variable for view foreground color, linking it to the window foreground color for consistency.
- Updated accent color styles to apply the custom accent color to links, enhancing visual coherence across the application.
- Changed light and dark swatch variables in theme-mode-selector.css for improved color consistency.
- Adjusted margins and dimensions of gamepad buttons in gamepad.blp to enhance layout and usability.
- Replaced multiple widget CSS imports with a single index.css import for better organization.
- Created index.css to aggregate widget styles, improving maintainability.
- Updated the CssName for RunMenuButton to follow a consistent naming convention.
@JumpLink JumpLink changed the title Gnome/Common: Theme Switcher with Light/Dark/Auto and user-selectable Color Schemes Make Learn-Platform Themeable: Accent/Primary Colors, Dark/Light Modes, and SourceView Schemes Sep 16, 2025
- Removed the buttonWindowMenu and associated menu items from main.window.blp and main.window.ts for cleaner code.
- Renamed RunMenuButton to menuButton for consistency in main.window.blp.
- Updated run-menu-button.blp to include essential menu items directly, enhancing usability and organization.
@JumpLink JumpLink changed the title Make Learn-Platform Themeable: Accent/Primary Colors, Dark/Light Modes, and SourceView Schemes GNOME: Themeable: Accent/Primary Colors, Dark/Light Modes, and SourceView Schemes Sep 17, 2025
- Deleted "Menu" and "Run menu" entries from German, English, and various other language translation files to clean up unused translations.
- Updated related translation files to ensure consistency across languages.
@JumpLink JumpLink merged commit 668890e into main Sep 17, 2025
@JumpLink JumpLink deleted the feat/colorful branch September 17, 2025 08:41
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