Skip to content
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

fix: handle chat command selection wrapping #1556

Merged
merged 3 commits into from
Oct 31, 2023
Merged

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Oct 31, 2023

CLOSE #1344

Fix issue where notification for version update steals chatbox input focus

  • In Chat.tsx, code was added to focus the textarea on mount

image

Also made changes to handle wrapping of chat command selection when using arrow keys:

  • In Chat.tsx, the logic to calculate the next chat command index was updated to wrap around when reaching the end.
  • In ChatCommands.tsx, code was added to scroll the command list on selection change, and focus the selected command.

This fixed issue where the command box does not scroll with user selection.

Test plan

Before

The window is stuck at the top even when you are selecting items that is at the bottom of the window

Screen.Recording.2023-10-31.at.7.18.16.AM.mov

After

Scrolls automatically based on your selected item

Screen.Recording.2023-10-31.at.7.09.49.AM.mov

@abeatrix abeatrix requested a review from a team October 31, 2023 14:20
Copy link
Contributor

@umpox umpox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niceeeee

@abeatrix abeatrix enabled auto-merge (squash) October 31, 2023 14:57
@abeatrix abeatrix merged commit 157f4b0 into main Oct 31, 2023
13 checks passed
@abeatrix abeatrix deleted the bee/fix-commands-box branch October 31, 2023 15:17
@toolmantim
Copy link
Contributor

Thanks for digging into this @abeatrix!

Looking at the video… the two more common patterns for scrolling are when you go off the bottom then you scroll down a whole page, so the selected item is now at the very top. Or you just show one item at a time (ala Finder):

Screen.Recording.2023-11-01.at.5.13.14.pm.mov

I'd probably opt for the latter by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opt+/ shortcut does not focus chat input if a notification is shown
3 participants