fix(patch): cherry-pick e5615f4 to release/v0.33.0-preview.12-pr-21037 to patch version v0.33.0-preview.12 and create version 0.33.0-preview.13#21922
Conversation
…nconstrained heights (#21037) Co-authored-by: jacob314 <jacob314@gmail.com>
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 cherry-picks a commit to patch a preview release, primarily focusing on enhancing the flexibility of UI layout within the CLI. The key change involves introducing an 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: +121 B (0%) Total Size: 25.9 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request includes important fixes and improvements related to UI layout and dynamic content display. The correction in packages/cli/src/ui/AppContainer.tsx addresses an issue where the available terminal height was miscalculated, leading to unnecessary content truncation. Additionally, the introduction of unconstrainedHeight in the Question interface and its implementation in packages/cli/src/ui/components/AskUserDialog.tsx provides greater flexibility for rendering questions that require more vertical space, enhancing the user experience for interactive dialogs.
| staticExtraHeight - | ||
| 2 - | ||
| backgroundShellHeight, | ||
| terminalHeight - controlsHeight - backgroundShellHeight - 1, |
There was a problem hiding this comment.
The previous calculation for availableTerminalHeight was incorrectly subtracting staticExtraHeight (which is 3) and an additional 2 lines, resulting in a total of 5 lines being subtracted from the available height for static elements. This led to an overly constrained UI, potentially truncating content unnecessarily. The revised calculation, which now subtracts only 1 line for static elements, correctly frees up 4 additional lines of vertical space, resolving a significant layout bug and improving content visibility.
References
- The fix improves UI layout consistency by preventing content truncation, aligning with the principle of ensuring consistent and readable layouts.
- The calculation involves specific numerical values (
1,2,3,5) used for layout adjustments. While this comment describes a fix, it's a good practice to replace such 'magic numbers' with named constants for improved readability and maintainability, as per repository guidelines.
ca0db7e
into
release/v0.33.0-preview.12-pr-21037
This PR automatically cherry-picks commit e5615f4 to patch version v0.33.0-preview.12 in the preview release to create version 0.33.0-preview.13.