Repository navigation
fix(tabs): keep a reordered tab's transcript on screen - #901
Merged
xintaofei merged 2 commits intoOct 9, 2026
Merged
Conversation
Dragging a tab along the strip permutes the tab list, and each group rendered its conversation views in that same order. React carries out a keyed permutation by moving DOM nodes, and a node that is taken out of the document and put back loses every scroll offset inside it: Chromium resets scrollTop to 0 and fires no scroll event. The virtualized transcript keeps rendering the rows for the offset it last saw (usually the bottom of a long conversation), while the viewport now sits at the top over an empty spacer, so the moved tab, or a hidden tab React happened to move, shows blank until it is scrolled. The views are now emitted in an order a reorder cannot change (by tab id), and the strip order reaches the screen only through the CSS order property, which only a tiled row uses. Opening or closing a tab still inserts or removes just its own node.
The panel wiring check only matched the destructuring of the id-sorted map, so handing renderTabWrapper any other index (the sorted position, a constant) still passed while a tiled row fell back to tab-id order and the wrong tile dropped its left border. Require the strip position itself to be the index the wrapper receives. Also note that WebKit, not only Chromium, resets a reinserted node's scroll offsets without a scroll event.
Collaborator
|
codeg work task |
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.
Reordering conversation tabs within a strip can leave a tab's transcript blank until it is scrolled. #726 fixed the cross-group drag; this is the within-strip reorder, which also affects the unsplit strip.
Each group rendered its conversation views in strip order, so a reorder permuted keyed children and React moved their DOM nodes. A node that leaves the document and is reinserted loses its scroll offsets: Chromium resets scrollTop to 0 and fires no scroll event. The virtualized transcript keeps rendering rows for the offset it last saw, typically the bottom of a long conversation, while the viewport is now at the top over an empty spacer. The dragged tab, or any hidden tab React moved, shows blank.
Views are now emitted in an order a reorder cannot change (by tab id), and the strip order reaches the screen only through CSS
order, which only the tiled flex row uses. Opening or closing a tab still inserts or removes just that tab's node.Tests:
src/lib/tab-view-order.test.tsxcovers the helper, a control showing strip-order rendering does move nodes, reorder and tiled-reorder with zero node removals, tab-open insertion, and the panel wiring.