fix(ui): persist expansion in AskUser dialog when navigating options#20559
fix(ui): persist expansion in AskUser dialog when navigating options#20559
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where the UI's expanded state would inadvertently reset during user interaction with dialogs and lists. By strategically adjusting the priority of keypress handlers, interactive components can now correctly process navigation inputs, preserving their expanded views and improving the overall user experience without unexpected collapses. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: +18 B (0%) Total Size: 25.7 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces changes to the keypress handling logic within the AppContainer and related components to improve expansion persistence and prioritization. It ensures that keypresses handled by high-priority components, such as those in the AskUserDialog and BaseSelectionList, correctly maintain the expansion state of the application. Additionally, it resets the expansion state when a keypress is not handled by any component. The changes involve modifying the AppContainer component to use separate keypress handlers with different priorities for global keypresses and expansion toggling, and adding a priority prop to several components.
|
Tested and works for me 👏 Will let @jacob314 be the official reviewer |
01b197a to
fecbda4
Compare
e5e97ed to
4a1429b
Compare
- Lowered handleGlobalKeypress priority to Low in AppContainer. This ensures that focused interactive components (like AskUserDialog, BaseSelectionList, or text inputs) consume their keypresses first, preventing the global fallback logic from collapsing the expanded view during user interaction. - Added "Expansion Persistence" test suite to AppContainer.test.tsx. - Added a specific test case verifying that navigation (up/down arrow keys) correctly preserves expansion when handled by a high-priority component, while unhandled keys still trigger a collapse. - Verified that Ctrl+O correctly toggles the expansion state. - Confirmed that triggerExpandHint is correctly included in the handleGlobalKeypress dependency array to satisfy exhaustive-deps requirements. Fixes #18909
4a1429b to
35e8f86
Compare
Fixes #18909