Skip to content

Grid: the selection outline stays visible when extended to the last row (#687) - #767

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
vangel76:fix/selection-border-687
Oct 13, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
vangel76:fix/selection-border-687

Conversation

@vangel76

Copy link
Copy Markdown
Contributor

Fixes #687

Root cause

The selection outline was a single rect_stroke of the whole current area. Extended to the last row the rectangle is ~20 million points tall; at that size f32 precision is about 2 points, and the tessellated left/right sides vanish while the fill (plain rectangles) still shows.

Changes

  • grid.rs: the outline is now four filled bands (outline_bands) cut to the pane's clip rect (plus a small margin), so no geometry is far from the viewport. Same width (2) and position as the old StrokeKind::Middle stroke on outline.expand(0.5). Non-finite rects draw nothing.
  • ROADMAP.md progress log row.

Tests

  • cargo test -p gridcraft-ui-egui --lib outline_band (2 tests: whole-column outline keeps left/right/top sides within the viewport; out-of-view and NaN rects draw nothing)
  • cargo clippy -p gridcraft-ui-egui --lib -- -D warnings, cargo fmt -p gridcraft-ui-egui

Not done / unverified

🤖 Generated with Claude Code

…ow (storytold#687)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 1e29e69 into storytold:main Oct 13, 2026
1 check passed
@echelon

echelon commented Oct 13, 2026

Copy link
Copy Markdown
Member

Merged — thank you @vangel76 for the contribution!

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

arcanii added a commit to arcanii/DevCraft that referenced this pull request Oct 13, 2026
…k's hooks, and the outline drawn with upstream's outline_bands

Upstream 84acf62, 407 commits since the merge before, and no release among
them (still 0.6.1): AutoComplete for cell values with its switch on the
Options page, a horizontal scrollbar in the sheet tab bar and an All Sheets
navigator, rows that grow to their tallest font, the recent list's
"modified" column (the fork's own storytold#463, now upstream's), a selection
outline that keeps its sides round a whole column, many fixes to XLSX and
XLS round trips, number formats, functions and PDF output, and Serbian as
an interface language.

Two conflicts, both settled as the fork's rule says: upstream's code, and
the hook put back.

- crates/ui-egui/src/lib.rs, UiState and its Default: upstream added
  `autocomplete` on the line the fork's field stood on. Upstream's first,
  the fork's `aniefork` after it.
- crates/ui-egui/src/grid.rs, paint_selection: upstream replaced its
  stroked rectangle with four filled sides cut to the screen
  (`outline_bands`, its storytold#767), where the fork's hook stands. The hook
  stays, and the fork's `selection::paint_outline` now draws its own ring
  with `outline_bands`: where the outline lies and how wide it is are
  still the fork's, and it has upstream's fix. Nothing else in the app
  calls that function, so without this the build fails on an unused one.

Every hook is in place after the merge, counted file by file before and
after. Outside the fork's own files the result differs from upstream by
the hooks alone: 72 lines added and 17 changed, in ten files.

Checked on the result: fmt, clippy, all 1867 tests of the workspace,
assets, layers, wasm, parity and keytips. The keytips step failed in the
gate's own run on line endings only (the merge checked the generated
table out with CRLF and the check compares bytes); regenerated, it is
upstream's file to the byte, and the step passes.

ROADMAP-aniefork.md has the sync table, the hooks table, what conflicted,
and the log.

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.

[Bug] Selection borders disappear when using Ctrl+Shift+Down

3 participants