Repository navigation
Join borders only within a layer - #199
Merged
Merged
Conversation
Borders whose strokes touch join into corners and tees by the cells alone, so a sticky header's rule grew a tee wherever a border scrolled under it. Each border cell now records the stacking context that stroked it, and strokes join only within one. A border drawn over another layer's covers it instead of crossing it. A sticky or fixed box is a layer of its own with no z-index too. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GVbRv5n8btiCtaRBtLrLig
A grid is what the terminal shows: it is swapped with the last frame's and compared with it. Which layer stroked a border is the painter's record, read only where borders join, so the framebuffer keeps one array of it for the frame last painted and writes it in place, as it keeps the borders as painted. A frame keeps its own and joins its own borders. A frame that repaints some rows is now checked against a whole one on the layers too, which found that a box given isolation repainted nothing though its borders changed layer. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GVbRv5n8btiCtaRBtLrLig
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GVbRv5n8btiCtaRBtLrLig
brainkim
force-pushed
the
fix/border-layer-join
branch
from
November 23, 2026 19:54
d3c0bda to
fbe4760
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A sticky header with a
border-bottomgrew a tee in its rule wherever a border scrolled under it. Reported from Riposte's pager, where ablockquote'sborder-leftpasses under the header:Cause
joinTouchingBordersjoins any two strokes in neighbouring cells. It reads only the cells, with no record of which layer painted each stroke, so the header's rule joined a bar in the layer beneath it.Change
CellContext.layer): a stacking context, or a sticky or fixed box with noz-index, which stays put while others scroll under it.Framebuffer.layers).joinRowskips a neighbour in another layer, and a border drawn in a cell that holds another layer's border replaces it instead of merging into a cross.isolationis among the properties whose change repaints a box. Giving a boxisolation: isolatechanged the layer of the borders inside it and repainted nothing.Layout
The layers are not part of
CellGrid. A grid is what the terminal shows: it is swapped with the last frame's and compared with it, and it is also a pty's screen, a canvas's cells and the diff. Which layer stroked a border is the painter's record, read only by the join, like the borders as painted thatprevBorderskeeps. Nothing compares it with the frame before, so there is one array, written in place: a frame painted over the last writes only in its bands, and a value in a cell with no border is never read. It shifts withprevBorderswhen the terminal scrolls rows.A grid drawn into another has its borders settled into glyphs first, so the layers never travel with a grid. An iframe's renderer keeps its own array and settles its own borders.
The number is an id for the layer's element, the same every frame. The join only asks whether two are equal.
Not changed
z-index: autois not a layer here. Aposition: relativetable cell would otherwise lose its corners.┌┬). That content is in the scroller's own layer, only clipped. Refusing every join across a clip would break a borderedoverflow: autopanel whose dividers meet its walls, so it needs a rule of its own.Tests
In
tests/sticky-position.test.ts: the rule stays plain as the bar scrolls under it across partial repaints, with and without az-index; the same inside an iframe; a rule still joins a bar in its own layer; and a box that becomes a layer repaints the borders inside it. Under tests a frame that repaints some rows is checked against one painted whole, now on the layers too. The full suite passes on Node and Bun.🤖 Generated with Claude Code
https://claude.ai/code/session_01GVbRv5n8btiCtaRBtLrLig