-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
221 pressing tab on context selector duplicates the subsequent text if it exists #224
Merged
Jurredr
merged 12 commits into
main
from
221-pressing-tab-on-context-selector-duplicates-the-subsequent-text-if-it-exists
Jan 17, 2025
Merged
221 pressing tab on context selector duplicates the subsequent text if it exists #224
Jurredr
merged 12 commits into
main
from
221-pressing-tab-on-context-selector-duplicates-the-subsequent-text-if-it-exists
Jan 17, 2025
+71
−6
Conversation
This file contains 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
As user types after opening the context selector, the filtering was checking the written text from the cursor start to next space or line end character not what the actual cursor goes.
When VSCode hides the extension, it shrinks the width and height to 0. And since the container size also shrinks down, it was rescrolling to an unexpected position. Added resize global event and handler in chatwrapper to undertand if the root element size goes under 10px width or 10px height. When root elm gets resized back (more than 10px width and height for the first time), we're setting the scroll position back to the latest. The same applies for the tab switches. When a tab is switched, it looses height and width which causes scroll position to go to a random value. We added a new subscription called beforeTabChange which records the last scroll position and sets it back when the tab is selected back
Since the old structure was broken to keep the scroll position consistent, the snapshots are aslo updated to match the fixed one
dogusata
commented
Jan 16, 2025
dogusata
commented
Jan 16, 2025
dogusata
commented
Jan 16, 2025
dogusata
commented
Jan 16, 2025
dogusata
commented
Jan 16, 2025
Jurredr
previously approved these changes
Jan 17, 2025
Added more update mechanism like wheel, animationend etc. to record the last scroll position as it is updated, since the scrollPos already being updated (undesired value) when the resize event triggered.
Jurredr
previously approved these changes
Jan 17, 2025
Jurredr
approved these changes
Jan 17, 2025
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.
Problem
Solution
Scroll position misbehaviors:
When VSCode hides an extension panel, it shrinks the width and height of it to 0. And since the container size also shrinks down, it was setting the scroll position to an unexpected one. We added a
ROOT_RESIZE
global event and the handler for it in theChatWrapper
to understand if the root element size goes under 10px width or 10px height when that tab is active. When root elm gets resized back (more than 10px width and height but only once until the next lower than 10px), we're setting the scroll position back to the latest recorded before the hide precedure.The same applies for the tab switches. When a tab is deselected, it looses height and width which causes scroll position to go to a random value. We added a new subscription on tab store model called
beforeTabChange
and in the handler we're recording the last scroll position. When the tab get selected back we're resetting the scroll position to the latest recorded.Context selector misbehaviors:
As user types after opening the context selector, the filtering was checking the written text from the cursor start to next space or line end character not what the actual cursor goes. Now it checks depending on the cursor position. So as user types filtering matches what user types instead of trying to match the whole word starting from the init cursor index. When user hits tab, space or enter, it only adds the matching context item. If there is no context item in the filtered view, it just leaves it as is.
Tests
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.