Skip to content

Grid: freeze panes by dragging the freeze handles (#195) - #309

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
vangel76:feat/drag-freeze-lines
Oct 11, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
vangel76:feat/drag-freeze-lines

Conversation

@vangel76

Copy link
Copy Markdown
Contributor

Fixes #195

Root cause

Freezing panes was only possible through View › Freeze Panes. The issue's screenshot is Excel for the web, which has draggable freeze handles at the top-left of the headers; GridCraft had nothing to drag.

What changed (crates/ui-egui/src/grid.rs)

  • Two freeze handles, drawn as small grey bars:
    • one in the upper 40 % of the column-header strip, on the right edge of the frozen columns;
    • one in the left 40 % of the row-header strip, on the bottom edge of the frozen rows.
  • With nothing frozen, the handles sit on the select-all corner's edges.
  • The rest of each header edge still resizes the column or row; the existing resize and AutoFit tests still pass.
  • Dragging a handle shows an accent line where the freeze will go. On release it freezes up to the nearest column or row boundary through the existing view.freezePanes {cell} command, so it is undoable and recorded like the menu command. The other direction's freeze is kept. Dragging back to the corner unfreezes that direction; when nothing is left frozen, panes are unfrozen.
  • The frozen pane is limited so the scrolling pane keeps room on screen.
  • Hover shows a resize cursor and a tooltip ("Drag to freeze columns/rows"); the tooltips are in all catalogs.
  • This is separate from Do not draw the selection over the frozen pane when it lies only in the scrolling pane (#198) #217 (selection drawing over frozen panes): different functions in grid.rs.

Tests

  • New crates/ui-egui/tests/freeze_handles.rs, with real pointer drags:
    • the corner column handle to column C freezes 2 columns;
    • the row handle to row 4 freezes 3 rows and keeps the columns;
    • dragging both back to the corner unfreezes.
  • I checked the handles visually with the offscreen snapshot, with and without a freeze.
  • Commands run:
    • cargo test -p gridcraft-ui-egui --lib --test freeze_handles --test header_autofit --test popup_dismissal --test interaction
    • cargo fmt -p gridcraft-ui-egui -- --check
    • cargo clippy -p gridcraft-ui-egui --all-targets -- -D warnings

Not done

  • Scrolled sheets: GridCraft freezes from row 1 / column A, not from the scrolled top-left cell as Excel does (topLeftCell). Dropping a handle on a scrolled sheet can therefore freeze more lines than are visible, limited to what fits on screen.
  • Excel desktop's split boxes / Split view (view.split) are not part of this.
  • There is no keyboard path for the handles; the View › Freeze Panes commands remain the keyboard route.

Unverified assumptions (needs confirmation in Excel)

  • I matched the handle placement and look to the reporter's Excel-for-the-web screenshot only. I didn't measure its exact size or hit area.

🤖 Generated with Claude Code

Like Excel for the web, a bar in the upper part of the column-header strip
and one in the left part of the row-header strip sit on the frozen panes'
edges (the corner's edges when nothing is frozen). Dragging one previews
the line and, on release, freezes up to the nearest column or row boundary
through view.freezePanes; dragging back to the corner unfreezes.

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 cf1ba20 into storytold:main Oct 11, 2026
@echelon

echelon commented Oct 11, 2026

Copy link
Copy Markdown
Member

Merged — thank you for the contribution!

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>
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.

[Feature] "Freeze" top/left columbs by dragging lines from base.

3 participants