Skip to content

GUI: searchable navigation panel, token-based dark and light themes, tabs built on first open - #502

Merged
JE-Chen merged 4 commits into
mainfrom
feat/gui-modernization
Oct 8, 2026
Merged

JE-Chen merged 4 commits into
mainfrom
feat/gui-modernization

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

The first two tasks of plan F (docs/superpowers/plans/2026-10-02-f-gui.md): the window gets a navigation panel with search, its own dark and light themes, and tabs that are built when they are first opened.

  • Navigation panel (gui/navigation.py). Every registered tab is listed on the left under its category, open or not. The search box filters by title, key or category; Return opens the first match. Ctrl+K focuses the search, Ctrl+B hides or shows the panel. Until now 45 of the 48 tabs were only reachable through View → Tabs → category.
  • Themes from tokens (gui/theme.py). ThemeTokens holds the colours, radius, spacing and font family; DARK and LIGHT are two values of it; the style sheet and a matching palette are generated from them. View → Theme switches. main_window.py no longer imports qt_material.
  • Tabs built on first open (gui/tab_registry.py). 48 TabSpec rows; TabEntry.widget calls its factory on first access. The workspace builds 8 widgets at start instead of 48. show_tab / hide_tab / list_registered_tabs keep their signatures; activate_tab(key) and current_tab_key() are new.
  • The window shrinks to 640×420; the Script Builder's minimum width used to hold it at 1064 px.

Behaviour changes

  • A tab that was never opened does not exist yet. An embedder that relied on every tab being constructed with AutoControlGUIWidget has to open the tab first (show_tab(key) or reading entry.widget). AutoControlGUIWidget itself is unchanged for PyBreeze: same class, same tabs, same registry API.
  • "Auto" text size is 10 / 11 / 13 pt by screen height (was 12 / 14 / 16), the default window is 1280×800, and the font is the platform's UI font instead of Lato.
  • The [gui] extra still lists qt-material; removing it is in Progress.md.

Measured

Windows 11, Python 3.14, offscreen, AutoControlGUIWidget() from a cold interpreter, four runs each:

before after
widgets built at start 48 8
je_auto_control modules imported 892 844
time to a built workspace 2.90–3.08 s 2.63–2.74 s

Most of what is left is the facade import and the Remote Desktop and Script Builder tabs, which open by default.

Tests

  • New: test_gui_lazy_registry.py (50) and test_gui_workspace_navigation.py (17), the Qt parts in child processes.
  • test_qt_material_guard.py is removed with the import it guarded, and the three importorskip("qt_material") lines with it, so test_r3_gui_main_window.py, the tabs-menu leak test and the window-listener test run in CI for the first time.
  • Local: full headless suite 10893 passed, 46 skipped; ruff, bandit, radon cc -nc clean; typing_contract_verify.py with mypy==2.3.0 reports 0 failing modules on all three targets.
  • Both themes and the 640×420 window were rendered and looked at (Windows platform plugin, WA_DontShowOnScreen).

Not in this PR

Listed in Progress.md › 跨平台與 GUI 全面改版: page content is squeezed rather than scrolled in a narrow window; theme and panel state are not remembered between runs; tab close buttons are Fusion's; Remote Desktop and Script Builder are still built at start; F3 (workers, cancel, close) and F4 (benchmarks, parity) have not started.

…t themes, and tabs built on first open

Forty-five of the 48 tabs could only be reached through View > Tabs > category,
the window built every one of them before showing three, and its look was a
third-party sheet that could not be adjusted. The panel lists every feature
and searches it (Ctrl+K), the theme comes from one set of tokens, and a tab's
module is imported when the tab is opened.

The qt_material guard test goes with the import it guarded, so the main-window
tests it kept skipped in CI now run there.
@codacy-production

codacy-production Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 149 complexity · 0 duplication

Metric Results
Complexity 149
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@JE-Chen
JE-Chen merged commit b5ec049 into main Oct 8, 2026
40 checks passed
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