Repository navigation
Feature/preselect first search result item in assistant - #5656
Merged
dtslvr merged 9 commits intoOct 4, 2025
Merged
Conversation
Contributor
Author
|
hey @dtslvr , please let me if you need anything update. thanks |
dtslvr
requested changes
Oct 4, 2025
dtslvr
left a comment
Member
There was a problem hiding this comment.
Thanks for your contribution, @yashranaway! 😎
I have reviewed your changes and added a few comments.
Could you also add a changelog item? Thanks.
| this.searchResults = searchResults; | ||
| this.changeDetectorRef.markForCheck(); | ||
|
|
||
| // Trigger preselection of first item |
| } | ||
|
|
||
| public ngOnDestroy() { | ||
| // Clear preselection timeout |
| 'TAG' | ||
| ]; | ||
| private keyManager: FocusKeyManager<GfAssistantListItemComponent>; | ||
| private preselectionTimeout: any; |
| private preselectionTimeout: any; | ||
| private unsubscribeSubject = new Subject<void>(); | ||
|
|
||
| private readonly PRESELECTION_DELAY = 100; |
| * Gets the first search result item based on priority order: | ||
| * Quick Links → Accounts → Holdings → Asset Profiles | ||
| */ | ||
| private getFirstSearchResultItem(): ISearchResultItem | null { |
| /** | ||
| * Preselects the first search result item with debouncing | ||
| */ | ||
| private preselectFirstItem(): void { |
Contributor
Author
|
right on it |
…ect for first search result in assistant
…with assistant preselection feature
dtslvr
requested changes
Oct 4, 2025
dtslvr
left a comment
Member
There was a problem hiding this comment.
Thanks for the update, @yashranaway! 👍🏻
Could you please address all open comments?
| if (this.preselectionTimeout) { | ||
| clearTimeout(this.preselectionTimeout); | ||
| } | ||
| this.unsubscribeSubject.next(); |
| 'SYMBOL', | ||
| 'TAG' | ||
| ]; | ||
| private keyManager: FocusKeyManager<GfAssistantListItemComponent>; |
| 'TAG' | ||
| ]; | ||
| private keyManager: FocusKeyManager<GfAssistantListItemComponent>; | ||
| private unsubscribeSubject = new Subject<void>(); |
dtslvr
approved these changes
Oct 4, 2025
dtslvr
left a comment
Member
There was a problem hiding this comment.
I have made some final adjustments. Ready to merge now.
Contributor
Author
|
thank you @dtslvr |
Member
Thank you, likewise. And congrats on your first contribution, @yashranaway 🙌🏻 |
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.
Auto-preselect first search result in assistant
Fixes : #4902
What: Automatically preselects the first search result when assistant results are displayed, allowing users to press Enter immediately without needing arrow keys first.
Why: Improves UX by reducing keystrokes - users can now type and immediately press Enter to activate the first result.
How:
getFirstSearchResultItem()to determine first item by priority (Quick Links → Accounts → Holdings → Asset Profiles)preselectFirstItem()with 100ms debouncing to auto-focus first resultFocusKeyManagerfor seamless keyboard navigationTesting: Manual testing confirmed automatic preselection works correctly with immediate Enter key activation.