Skip to content

Keep table row dividers when a table scrolls into view, and stop an iOS crash in table-heavy chats - #1467

Merged
dylanplayer merged 1 commit into
mainfrom
codevisor/juniper
Nov 24, 2026
Merged

dylanplayer merged 1 commit into
mainfrom
codevisor/juniper

Conversation

@dylanplayer

Copy link
Copy Markdown
Member

What changed

  • macOS: tables paint their own row dividers and header tint. They used to be borders and fills on the text cells, which AppKit only paints in a redraw that also reaches that row's text. A table that scrolled or resized into view a few points at a time was drawn in strips, and a strip holding a divider but no text left it blank until the whole table redrew (selecting text was the usual way to get it back). The table now fills them from the row positions in its own draw pass, so any strip gets them.
  • iOS: dividers use the same shared code, painted into the existing table tiles, instead of one layer per divider repositioned on every scroll.
  • iOS: fixed a crash when scrolling table-heavy chats. When the visible part of a table was a sliver under half a point, the tile range was built with its upper bound below its lower bound. This was already on main.

Table layout is unchanged: the old 1pt cell border became 1pt of bottom padding, so row heights and measured table heights are the same. The redraw-widening workaround in TableTextView is removed.

How it was checked

  • New regression tests: a redraw of a strip with no text in it still paints the dividers and header tint (failed on the old code for all 7 strips); adopting a replacement prepared layout moves the dividers; a sliver thinner than half a point still covers one tile (reproduced the same Range requires lowerBound <= upperBound fatal error on the old math).
  • bun run check passes, including the full Swift suites.
  • macOS dev app, 80-turn chat with 320 tables: growing the window 3pt at a time left the dividers under rows 15–18 of a 26-row table missing on main, and all present with this change.
  • iOS simulator, same chat, scripted touch-scroll: main crashed mid-scroll, this change completed the pass.
  • macOS table drawing, best of three runs against main: about 10% faster for a full draw and 20–40% faster for partial redraws (debug build, off screen, on a busy machine, so the direction is solid and the exact figures are rough).

Not checked

  • A real trackpad scroll in the macOS app (no input access to the app during testing); the strip exposure was driven by resizing the window instead.
  • iOS table painting time was not measured directly.

🤖 Generated with Claude Code

…OS crash in table-heavy chats

On macOS a table's row dividers and header tint were borders and fills on
the text cells, so AppKit only painted them in a redraw that also reached
that row's text. A table that scrolled or resized into view a few points
at a time was drawn in strips, and a strip that held a divider but no
text left the divider blank until something redrew the whole table.

Tables now paint their own dividers and header tint from the row
positions, in the table's draw pass, so any strip gets them. The shared
MarkdownTableChrome works out where they go and fills only the ones inside
the rectangle being redrawn. The old 1pt cell border became 1pt of bottom
padding, so row heights and measured table heights are unchanged, and the
redraw-widening workaround is gone.

iOS paints its dividers with the same code, into the existing table tiles,
instead of keeping one layer per divider and repositioning them on every
scroll.

Scrolling a table-heavy chat on iOS could crash: when the visible part of
a table was a sliver under half a point, the tile range was built with its
upper bound below its lower bound. The range is now clamped.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@dylanplayer
dylanplayer merged commit 491988c into main Nov 24, 2026
@dylanplayer
dylanplayer deleted the codevisor/juniper branch November 24, 2026 00:19
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.

1 participant