Re-measure timeline row when a collapsed event group expands#152
Merged
Conversation
Expanding a collapsed system-event group clipped its content at a fixed height. The table renderer caches row heights keyed by (messageID, width), and toggling expansion only flips the shared ExpandedGroupsState — it doesn't change the `rows` data, so `updateRows` never invalidates the cached height and `heightOfRow` keeps returning the collapsed value. NSTableView then clips the taller expanded content to that height. ExpandedGroupsState.toggle now fires an onToggle(groupID) callback; the table controller's new remeasureRow(forMessageID:) invalidates that row's cached height and notes its new height. heightOfRow's measurement host rebuilds the row reading the updated expansion state, so it returns the full expanded (or collapsed) height. Scroll position is preserved so expanding a row above the viewport doesn't shift the visible content. Fixes subpop#150. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
subpop
requested changes
Jun 26, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
subpop
approved these changes
Jun 26, 2026
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.
Fixes #150 — expanding a collapsed list of call/system events would clip the content and push the timeline off screen.
Cause
The table-backed timeline renderer caches row heights keyed by
(messageID, width). Expanding a collapsed group only flips the shared@Observable ExpandedGroupsState— it doesn't change therowsdata, soupdateRowsnever diffs that row, the height cache keeps the collapsed value, andheightOfRowreturns it. NSTableView then clips the taller expanded content to the old height, and the un-accounted-for growth throws off scroll position.Fix
ExpandedGroupsState.togglenow fires anonToggle(groupID)callback after mutating.remeasureRow(forMessageID:)invalidates that row's cached height and callsnoteHeightOfRows.heightOfRow's measurement host rebuilds the row reading the updated expansion state, so it returns the full expanded (or collapsed) height.expandedGroups.onToggleto the controller.The LazyVStack renderer auto-sizes and was never affected — this is specific to the table renderer's height cache.
Testing