Remove flex from stats display. See snapshots for diffs.#14983
Remove flex from stats display. See snapshots for diffs.#14983
Conversation
Summary of ChangesHello @jacob314, 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 focuses on enhancing the visual presentation of statistics within the CLI's user interface. It specifically targets the Highlights
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
|
There was a problem hiding this comment.
Code Review
This pull request refactors the stats display to use fixed widths instead of flexible layouts, which is a great step towards a more stable and predictable UI in the terminal. The approach of calculating a totalWidth for the model usage table is solid. I've added a couple of suggestions to ensure all table columns behave consistently when the terminal window is narrow, which will help fully achieve the goal of a robust, non-flexible layout.
| {/* Header */} | ||
| <Box alignItems="flex-end"> | ||
| <Box width={nameWidth} flexGrow={1}> | ||
| <Box width={nameWidth}> |
There was a problem hiding this comment.
While removing flexGrow is correct for a fixed layout, this column can now shrink if the container is too narrow. Most other columns in the table have flexShrink={0} to prevent this. This inconsistency can cause column misalignment, which undermines the goal of a stable layout.
To ensure a rigid table structure, you should prevent this column from shrinking. The same applies to the corresponding data rows and the Usage left column (when visible), which also lacks flexShrink={0}.
| <Box width={nameWidth}> | |
| <Box width={nameWidth} flexShrink={0}> |
| {rows.map((row) => ( | ||
| <Box key={row.key}> | ||
| <Box width={nameWidth} flexGrow={1}> | ||
| <Box width={nameWidth}> |
There was a problem hiding this comment.
|
Size Change: +97 B (0%) Total Size: 21.6 MB ℹ️ View Unchanged
|
sehoon38
left a comment
There was a problem hiding this comment.
lgtm, thanks for the fix!
|
/patch preview |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
Summary
See snapshot tests for demos of how the widths changed.
@sehoon38 pointed out the flex looked bad on an ultrawide terminal.