Skip to content

feat(ui): implement adaptive system theme preferences with live AppKi…#4

Open
kerem0x wants to merge 1 commit into
Digital-Shane:mainfrom
kerem0x:feature/theme-toggle
Open

feat(ui): implement adaptive system theme preferences with live AppKi…#4
kerem0x wants to merge 1 commit into
Digital-Shane:mainfrom
kerem0x:feature/theme-toggle

Conversation

@kerem0x

@kerem0x kerem0x commented Jun 28, 2026

Copy link
Copy Markdown

Description

This pull request introduces comprehensive native theme configuration support (System Theme, Light, Dark) to OpenTamer. It transitions the utility's surface design from a hardcoded Aqua configuration to a fully dynamic, adaptive workspace interface that seamlessly handles dark environment canvases under professional macOS AppKit standards.

Additionally, this PR addresses micro-alignment styling imbalances inside process dashboard lists and introduces interactive theme hot-reloading.

Key Changes

🛠️ 1. Core Logic & Schema Layer (internal/core/, internal/config/)

  • Added Theme parameter to core.GlobalPreferences struct with defensive input string text validation.
  • Updated internal/config/config.go configuration loaders to automatically inject "system" defaults into clean application profiles.
  • Wrote automatic backward-compatible schema migration handlers inside LoadConfig() to backfill legacy configuration configurations safely without erasing user settings.
  • Added comprehensive lifecycle validation tests to config_test.go.

⚙️ 2. UI Coordination (internal/ui/)

  • Registered PreferenceTheme identifiers within the interface controller routing.
  • Updated setStringPreference map handlers to cleanly forward string changes to state engines.

🍏 3. Native macOS Presentation Bridge (internal/macos/)

  • Adaptive Render Blocks: Modified menu_bar_bridge.m to pull adaptive semantic assets (like [NSColor labelColor]) dynamically. Restructured custom canvas surfaces (OpenTamerPanelView, OpenTamerCPUGraphView) and action buttons to alter frame tones depending on the OS container state context.
  • CGO Linking Enhancements: Extended compiler LDFLAGS inside menu_bar_darwin.go to pull Apple's native QuartzCore library during assembly runs.
  • Safeguard Verification Tests: Updated menu_bar_preferences_test.go to cleanly add the "theme" element key safely inside the dashboard's alphabetized whitelist checks.

🎨 Visual Polish & UI/UX Optimizations

📐 Pixel-Perfect Vertical Centering

  • Adjusted textual row drawing bounding limits inside drawProcessAction from a +6 vertical offset down to +2, preventing text labels from crowding or clipping row lines.
  • Recalibrated row status indicator circles from +8 down to +6 vertical origin coordinates to ensure indicator symbols rest symmetrically.

⚡ Instant Live Hot-Reloading

  • Modified OpenTamerCommandShouldKeepMenuOpen bounds to drop selection tracking loops immediately when changing app themes.
  • This frees graphic animation update blocks and allows popover content elements to repaint themes immediately upon selection without requiring secondary panel interaction or window focus loss.

Status Checklist

  • Manual smoke testing performed across multiple screen loops.
  • All automated configurations and schema tests passing cleanly (go test ./...).
  • Code structured cleanly and formatted using standard Go ecosystem parameters.

Verification Steps

  1. Spin up the application manually using developer parameters: OPENTAMER_ALLOW_DIRECT_LAUNCH=1 ./opentamer
  2. Open the control panel, click into Preferences ➡️ General ➡️ Theme.
  3. Select Dark / Light / System Theme. Verify that rows format symmetrically, text blocks center, and layouts redraw design languages instantly.

…t hot-reloading

- Core/Config: Expanded 'core.GlobalPreferences' to support an explicit 'Theme' parameter string with fallbacks ('system', 'light', 'dark') and added a state normalizer helper.
- Configuration Management: Updated config store parsing, backwards-compatible migration schemas, and backfill routines. Implemented automated integration tests verifying profile default rules.
- UI Coordination: Registered theme tokens inside preference logic handlers to seamlessly translate string values.
- Native macOS Bridge: Updated Objective-C AppKit canvas surfaces, button cells, process items, and graph lines to listen to adaptive runtime look contexts dynamically. Linked the QuartzCore framework for building stability.
- UI Polish: Restructured drawing frames to guarantee pixel-perfect vertical centering for row typography (+2 origin offset) and status circles (+6 origin offset).
- UX Redesign: Tailored persistent menu boundaries to automatically dissolve dropdown items on theme swap selections, clearing AppKit animation drawing locks for instant live updates.
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