Skip to content

Clickable empty state, canvas-tracked centring, foldable sidebar branding - #757

Merged
marcinz606 merged 1 commit into
marcinz606:mainfrom
linkmodo:feat/empty-state-and-panel-chrome
Aug 4, 2026
Merged

Clickable empty state, canvas-tracked centring, foldable sidebar branding#757
marcinz606 merged 1 commit into
marcinz606:mainfrom
linkmodo:feat/empty-state-and-panel-chrome

Conversation

@linkmodo

@linkmodo linkmodo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Three UI changes, two of them fixing real misbehaviour.

1. The empty-state prompt is now a button. "Load some scans to get started" opens a small menu with Add files… / Add folder…, so a first-run user can import without first finding the film-strip toolbar. FileBrowser._on_add_files/_on_add_folder become public prompt_add_files/prompt_add_folder; the overlay drives them through signals rather than reaching into the browser.

2. The empty state now tracks the canvas, not the window. This was a real bug: hiding a dock resizes the canvas without resizing the window, and the overlay's geometry was only re-applied from MainWindow.resizeEvent — so it kept its old size while the floating toolbar (which the canvas lays out itself) moved. Measured with both docks hidden:

before fix:  overlay 691x934  vs canvas 1484x934   → text centre 345 vs toolbar centre 741
after  fix:  overlay 1484x934 vs canvas 1484x934   → 741 vs 741

An event filter on the parent re-applies the canvas rect on every canvas resize. Verified aligned (±1px) across all four dock combinations.

3. The sidebar branding folds away. A chevron at the header's top-right collapses the logo + version, 70px → 15px, persisted as section_expanded_app_header using the same get_global_setting/expanded_changed pattern as the Analysis section, so it survives a restart.

An earlier revision of this PR also replaced the docked Session / Controls captions with a slim unnamed bar. That has been reverted at the author's request — the docks keep their native title bars, and pinnable_dock.py / test_dock_panels.py are untouched by this PR.

Test plan

  • New tests/test_empty_state_and_header.py (11 tests): the prompt is a button, the menu offers both import routes, the tour signal fires, the overlay follows and stays centred on its parent through resizes, the header collapses/expands and frees height, and SessionPanel persists and restores the header state across rebuilds.
  • All three changes sabotage-verified: reverting each one individually fails the tests that cover it.
  • Driven against a real MainWindow: 25/25 checks pass, including the dock-toggle alignment matrix above and confirmation that both docks keep their native captions.
  • Full suite: 3305 passed. The 4 failures (test_effective_input_icc, test_output_dir_subfolder_of_source, test_sidecar_path, test_watcher_skips_ir_sidecars) are pre-existing Windows path-separator issues, confirmed failing on a clean main.
  • make format / ruff check clean; docs/USER_GUIDE.md updated for the clickable prompt and the collapsible header.

Canvas empty state:
- "Load some scans to get started" is now a button; clicking it offers
  Add files / Add folder, so a first-run user can import without hunting
  for the film-strip toolbar. FileBrowser._on_add_files/_on_add_folder
  become public prompt_add_files/prompt_add_folder, driven through
  signals on the overlay.
- The overlay now tracks the canvas instead of the window. Hiding a dock
  resizes the canvas without resizing the window, so the overlay kept its
  old geometry and drifted off-centre while the floating toolbar (which
  the canvas lays out itself) moved with it — measured 691px wide against
  a 1484px canvas, leaving the text ~400px left of the toolbar. An event
  filter on the parent re-applies the canvas rect on every canvas resize.

Sidebar:
- The branding (logo + version) folds away behind a chevron, 70px -> 15px,
  persisted as section_expanded_app_header in the same way as the
  Analysis section.
@linkmodo linkmodo changed the title Clickable empty state, canvas-tracked centring, leaner panel chrome Clickable empty state, canvas-tracked centring, foldable sidebar branding Aug 4, 2026
@linkmodo
linkmodo force-pushed the feat/empty-state-and-panel-chrome branch from aa3dbe6 to d774b7e Compare August 4, 2026 17:09
@marcinz606
marcinz606 merged commit bd81b85 into marcinz606:main Aug 4, 2026
1 check 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.

2 participants