Repository navigation
Conversation
…pdate rows in place The panel was resized from a Combine sink one main-queue turn after its items changed, by reading the hosting view's fittingSize, a full SwiftUI layout of the panel on every key. It is now sized from the items in the same turn, with only the preview below the list measured, and placed before it is ordered front. Rows were keyed by their offset, so a re-rank gave every visible row new content under the same identity. They are keyed by what they show, and the label view compares equal when it draws the same, so a row a re-rank only moved is kept.
This branch has not been deployed
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.
Summary
receive(on:)hop and thefittingSizeread of the whole panel are gone.orderFront, so it never appears at the last session's size. Placement uses the screen that holds the caret, since a panel not yet on screen can report the screen its last session used.CodeSuggestionLabelViewisEquatable, so a re-rank moves rows and skips rebuilding a row that only moved. Keyboard scrolling follows the new row ids, and a chosen row is found again by its id after a refresh.Not in this PR: hosting the list in an
NSTableView. The issue makes that conditional on SwiftUI still dominating after these two steps, which needs thetyping-1900kTime Profiler run to decide.Test plan
SuggestionPanelSizeTests: the panel has its final size in the turn its items are set, with the panel still hidden, and equal to the hosting view'sfittingSizefor five item sets; moving onto a row with a preview grows it by the preview and back; row ids follow the entry and stay unique. The first case fails onmain, where the size only lands a main-queue turn later.verify.sh teston everySuggestion*suite andTextViewControllerSuggestionsTests: 61 executed, 61 passed (SuggestionControllerPlacementTestsskips here without a screen).fittingSizein this harness, so the issue's 99 ms over 420 keys and the SwiftUI share need thetyping-1900kre-run on the maintainer's Mac.Closes #4541