Skip to content

Leave the active cell unshaded inside a selected range - #265

Merged
h-a-n-a-s-h-i merged 2 commits into
storytold:mainfrom
arcanii:active-cell-clear
Oct 11, 2026
Merged

h-a-n-a-s-h-i merged 2 commits into
storytold:mainfrom
arcanii:active-cell-clear

Conversation

@arcanii

@arcanii arcanii commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

What was wrong

Select a range and every cell in it is shaded, the active cell included, so you can't see where typing will go. paint_selection means to leave it clear ("Fill all areas except the active cell"), but the line that should do it paints a fully transparent rectangle (t.grid_bg.gamma_multiply(0.0)), which changes nothing. A translucent fill couldn't be cleared by painting over it anyway.

What changed

  • The fill goes around the active cell. Each area of the selection is shaded as up to four rectangles (above, below and beside the cell) that never overlap. grid::selection_fill returns them and paint_selection paints them.
  • A merged active cell is left clear as a whole. A lone active cell among several areas (Ctrl+click) isn't shaded, and neither is a single selected merged cell (it was shaded before).
  • The joins between the rectangles fall on the lines that continue the cell's edges and don't show: with gridlines off at 100 %, 115 % and 137 % zoom, at 1x and 1.5x scale, two renders that differ only in where the active cell is differ only in those two cells.
  • The second commit adds my own entry to contributors/people.toml.

Checks

Run locally on Windows with Rust 1.99: cargo xtask ci. fmt, clippy -D warnings, the tests (587), 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, so I expect it to pass in CI.

New tests: crates/ui-egui/tests/selection_fill.rs (one area, several areas, a merged active cell, a single cell) and two unit tests for the geometry in grid.rs, including hostile numbers. I also compared offscreen renders before and after.

#217 edits selection painting in grid.rs too, so whichever lands second may need a small rebase.

🤖 Generated with Claude Code

arcanii and others added 2 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>
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>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit a721b08 into storytold:main Oct 11, 2026
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 11, 2026
Glide the selection outline to a new selection; View ▸ Animations turns it off (includes #265)
@echelon

echelon commented Oct 11, 2026

Copy link
Copy Markdown
Member

Merged — thank you for the contribution! (It landed together with #266, which builds on it.)

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

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