Skip to content

Artboards panel: clicking an artboard makes it the active one - #351

Merged
bflatastic merged 2 commits into
storytold:mainfrom
theironchef:fix/artboards-panel-activates
Oct 7, 2026
Merged

bflatastic merged 2 commits into
storytold:mainfrom
theironchef:fix/artboards-panel-activates

Conversation

@theironchef

Copy link
Copy Markdown
Contributor

Fixes #349.

Problem: the Artboards panel kept its own selection (pstate "ab-sel") that nothing outside the panel read. A click on a row highlighted it but didn't make that artboard active, so the status bar navigator, View › Fit Artboard in Window and Actual Size stayed on the previous artboard. The selection was also shared by every open document. In Illustrator, selecting an artboard's name in the panel makes it the active artboard (Select artboards).

Change (crates/ui-egui/src/panels/artboards.rs)

  • The panel's selection is now the document view's active artboard, View::artboard, which the navigator and the Fit/Actual Size commands already use.
    • A row click sets it (the view doesn't move), as do the options icon, Move Up/Down and New Artboard.
    • The highlighted row follows the navigator.
    • It's per document.
  • The panel menu's Duplicate and Delete Artboards act on that artboard.
  • The panel's private ab-sel state is gone.

Tests

  • New panels::artboards::tests::clicking_a_row_makes_its_artboard_active, with two artboards and headless frames with pointer events:
    • a click on "Artboard 2" makes the view's active artboard 1;
    • after the navigator's Previous, the panel's selection is 0 again.
  • With the click not setting the view's artboard, the test fails.
  • cargo test -p vectorcraft-ui-egui: 570 passed.
  • cargo clippy -p vectorcraft-ui-egui --all-targets -- -D warnings (Rust 1.99): clean.
  • cargo fmt --all -- --check: clean.
  • Checked by hand in a release build on Windows with real mouse and keyboard input, with two artboards:
    • clicking "Artboard 2" in the Artboards panel set the view's active artboard to 1, and the status bar navigator read 2;
    • Ctrl+0 then fitted Artboard 2 (centre 500, 375; before the change it fitted Artboard 1);
    • the navigator's Previous moved the panel's highlight back to Artboard 1.

Fixed build: after clicking Artboard 2 in the panel, Ctrl+0 fits Artboard 2 and the status bar navigator reads 2

I didn't run the full cargo xtask ci (wasm step) here. The Artboard tool still keeps its own active artboard: making it follow the panel would be a separate change.

🤖 Generated with Claude Code

theironchef and others added 2 commits October 8, 2026 03:22
…it active

The panel kept its own selection (a pstate nothing else read), so a
click only highlighted the row: the status bar navigator, Fit Artboard
in Window and Actual Size stayed on the previous artboard. The panel's
selection is now the view's active artboard (View::artboard): a click,
Move Up/Down and New Artboard set it, and the highlight follows the
navigator, per document, as in the reference app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rtboard tool (review of storytold#351)

As in Illustrator, double-clicking an artboard's number goes to it (fits it in the
window) and double-clicking the name renames it. A row's Options button chooses the
Artboard tool on that row's artboard, clicking a row moves the Artboard tool to it
while it is chosen, and an artboard clicked with the Artboard tool becomes the active
one the panel highlights. Note it in the ROADMAP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic force-pushed the fix/artboards-panel-activates branch from 16c035a to 3b2376a Compare October 7, 2026 20:52
@bflatastic
bflatastic merged commit 4a35e9c into storytold:main Oct 7, 2026
@bflatastic

Copy link
Copy Markdown
Member

Thanks @theironchef, merged! A row click now makes that artboard the active one for the navigator and the Fit/Actual Size commands. I rebased it on main and added one commit on top:

  • Double-clicking an artboard's number goes to it and fits it in the window, as in Illustrator; double-clicking the name still renames it.
  • The Options button selects the Artboard tool on that row's artboard. With the Artboard tool, a click in the panel or on the canvas moves the tool's artboard, and the panel, the navigator and the tool now share one active artboard.
  • A test and a ROADMAP line.

Live check: clicking Artboard 2 made it active with the view unchanged, double-clicking its number fitted it (navigator showed 2), and clicks with the tool on the canvas moved the panel's highlight.

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.

Bug: Clicking an artboard in the Artboards panel doesn't make it active (Fit Artboard in Window still fits the old one)

2 participants