Skip to content

Glide the selection outline to a new selection; View ▸ Animations turns it off - #266

Merged
h-a-n-a-s-h-i merged 4 commits into
storytold:mainfrom
arcanii:selection-glide
Oct 11, 2026
Merged

h-a-n-a-s-h-i merged 4 commits into
storytold:mainfrom
arcanii:selection-glide

Conversation

@arcanii

@arcanii arcanii commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Stacked on #265: the first two commits here are that pull request, and only the last commit is new. Please look at #265 first; I'll rebase this one once it lands.

What it does

Excel's cell cursor doesn't jump. Press an arrow key or click a cell and the border slides to the new place; extend the selection and it grows. GridCraft's outline jumped. Now it glides.

  • What glides: the outline of the selection's current area, with its fill and fill handle, whenever the selection changes (arrows, Enter, Tab, a click, a drag, Shift+arrows, the Name Box, any command). A new move takes over from wherever the outline is drawn, so a held arrow key reads as one continuous motion. A range grows or shrinks edge by edge.
  • What doesn't: the same cells moving on screen (scrolling, zoom, a resized column or window) keep their outline glued to them. Another sheet or workbook, an outline that wasn't drawn the frame before, and moves that start or end off screen appear in place. An arrow key held at the edge of the window scrolls the sheet under an outline that stays where it is.
  • Only painting waits. The selection itself, hit testing and the cell editor use the real cells at once.
  • Timing: 0.12 s, decelerating (ease-out cubic), the same at any frame rate. This is an estimate from using Excel, not a measurement.
  • Turning it off: View ▸ Animations, a checkbox under Display theme, since settings live in the View tab. view.animations {on?} and ui.set {animations?} do the same for agents. It is saved with the UI preferences and on by default. The label and its hint are in the five catalogs; the translations are mine and unreviewed.
  • Agents and screenshots: the outline stays on its cells from a ui.screenshot request until the picture is delivered, and whenever egui's animations are off, which the headless harness does. Scripted pictures and the offscreen snapshot never catch it in flight.
  • Marching ants: the dashes around a copied range now advance by the clock (the same pace as before at rest) instead of once per painted frame. A glide repaints every frame and made them lurch.

How

selection_glide.rs holds the motion: each edge's distance from its target, decaying to zero, so the outline is always the cells' rectangle plus what is left of the offset, in screen points. GridState::glide keeps it between frames; grid::show advances it once per frame and hands the rectangle to paint_selection.

Not in this pull request

  • Following the system's reduced-motion setting, which Excel does.
  • Measuring Excel's duration and curve and matching them.

Checks

Run locally on Windows with Rust 1.99: cargo xtask ci. fmt, clippy -D warnings, the tests (605), assets, layers and wasm pass. Its last step, parity, fails on my machine only because Git checks docs/parity-checklist.md out with CRLF line endings; the generated text is otherwise identical.

New tests: eleven unit tests for the motion in selection_glide.rs (frame-rate independence, retargeting, scrolling, off-screen moves, far edges, hostile numbers) and seven in crates/ui-egui/tests/selection_glide.rs that drive the real app headlessly (an arrow key glides the outline, the View checkbox turns it off and on, a screenshot holds it still, the command and the saved preference).

Looked at frame-by-frame offscreen renders (cell to cell, cell to range, across frozen panes), and at a desktop build with the glide slowed down.

Docs: docs/control-protocol.md and a row in docs/ui-parity.md.

🤖 Generated with Claude Code

arcanii and others added 3 commits October 11, 2026 16:15
The active cell of a selected range was shaded like the rest of the range:
the line meant to clear it painted a fully transparent rectangle, which
changes nothing. The fill now goes around the active cell (the whole merged
cell when it is one) in every area of the selection, so it is plain where
typing goes. A lone active cell among several areas isn't shaded at all,
and neither is a single selected merged cell.

The fill is translucent, so the cell can't be cleared by painting over it:
each area is shaded as up to four rectangles around it that never overlap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ns it off

Excel's cell cursor doesn't jump: press an arrow key or click a cell and the
border slides over; extend the selection and it grows. The outline of the
current area now does the same, in 0.12 s with a decelerating curve, from
wherever it is drawn (a held arrow key reads as one motion), with its fill
and fill handle. The timing is an estimate, not yet measured against Excel.

The same cells moving on screen (scrolling, zoom, a resized column), another
sheet or workbook, an outline that wasn't drawn the frame before, and moves
that start or end off screen don't glide. Only painting waits: the
selection, hit testing and the cell editor use the real cells at once.

View > Animations (under Display theme) turns it off; view.animations {on?}
and ui.set {animations?} do the same for agents. Saved with the UI
preferences, on by default; translated in the five catalogs.

Scripted pictures never catch an outline in flight: it stays on its cells
while a ui.screenshot is on its way and when egui's animations are off (the
headless harness, so the offscreen snapshot). The marching ants around a
copied range now advance by the clock instead of once per painted frame,
since a glide repaints every frame and made them lurch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
arcanii added a commit to arcanii/DevCraft that referenced this pull request Oct 11, 2026
…heck

ROADMAP-aniefork.md: both changes the fork carries were offered upstream on
2026-10-11 (storytold#265, the clear active cell; storytold#266, the
selection glide with View > Animations, stacked on storytold#265). The table and the
log say so, and what to delete once they merge and upstream is merged back.

Syncing with upstream gains the commands to look before merging (what is
new, whether the hook files changed, whether a merge would conflict). A
scheduled check is in the backlog: checking by hand for now.

No code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pect frozen panes (storytold#217) and right-to-left sheets (storytold#310); es/de/cs strings for Animations

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit e800368 into storytold:main Oct 11, 2026
@echelon

echelon commented Oct 11, 2026

Copy link
Copy Markdown
Member

Merged — thank you for the contribution! (I merged main into your branch: the gliding outline and its fill now respect the frozen-pane clipping from #217 and the right-to-left mirroring from #310, and I added Spanish/German/Czech strings for Animations.)

If you haven't already, come join us on the ArtCraft Discord: https://discord.gg/artcraft

h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 11, 2026
), frozen-pane clipping (#217), right-to-left mirroring and freeze handles (#310, #309); es/de/cs strings for headers and footers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
arcanii added a commit to arcanii/DevCraft that referenced this pull request Oct 12, 2026
Upstream is at 3926d21. Since the last merge it took in two of the
fork's changes and built two more itself, so the fork stops carrying
all four and uses upstream's:

- The clear active cell (storytold#265) and the selection glide with
  View > Animations (storytold#266) were merged upstream. The fork's copies go:
  aniefork/selection.rs, the view.animations command, the hooks in
  grid.rs, control.rs, lib.rs and ribbon.rs.
- Upstream built its own File page (storytold#331), with Save As, Print and
  Options pages, and closed ours (storytold#337) as a duplicate.
  aniefork/backstage.rs and its hooks go.
- Upstream's File page has an Options page, and file.options opens it.
  The fork's Options dialog and its file.options command are retired.
  Its two own settings (the user name, Show the Developer tab) are now
  drawn on upstream's page through one hook, with the commands
  app.userName and developer.tab.

The five conflicts were all at the fork's hooks. Upstream's version of
each file was taken and the hooks the fork still needs were put back;
ROADMAP-aniefork.md lists them. The fork now differs from upstream in
nine of upstream's files, by about fifty lines, and in none of grid.rs.

After the merge the fork's own tests pass, and fmt, clippy, assets,
layers, wasm, keytips and parity pass. Three tests fail that upstream's
main fails by itself, in files the fork doesn't touch: two CSV tests in
the engine and the French catalog check in the UI crate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants