fix(ui): Adaptive flexbox layout for services table#118
Merged
Conversation
Replace fixed column allocation with a three-section flexbox layout that adapts to terminal width and the longest service name in the profile
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #118 +/- ##
==========================================
+ Coverage 89.23% 89.36% +0.12%
==========================================
Files 60 60
Lines 5650 5697 +47
==========================================
+ Hits 5042 5091 +49
Misses 480 480
+ Partials 128 126 -2
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates the services table layout to adapt to terminal width and the longest service name, introducing a three-section (name / center / metrics) flex layout and adding tests for wrapping/truncation behavior.
Changes:
- Extend table layout computation to account for preferred service-name width and distribute surplus width into left/right “flex” gaps.
- Update services view rendering to use the new layout (flex gaps + metric-value truncation).
- Add/adjust tests to cover truncation, long uptime rendering, wide-terminal distinguishability, and Unicode name behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/app/ui/services/view.go | Renders headers/rows using left/right flex gaps; truncates metric values to avoid wrap. |
| internal/app/ui/services/update.go | Recomputes layout on terminal resize and after profile resolution. |
| internal/app/ui/services/helpers.go | Adds longest-name measurement and centralized layout recomputation. |
| internal/app/ui/services/view_test.go | Adds tests for long uptime/no-wrap, wide-terminal name distinguishability, and Unicode behavior. |
| internal/app/ui/components/layout.go | Adds preferred-name bucketing and updated layout allocation with flex gaps. |
| internal/app/ui/components/layout_test.go | Updates/extends layout tests for new layout inputs and preferred-name bucketing. |
| internal/app/ui/components/constants.go | Introduces new layout constants (buckets, divisors, flex-related constants) and adjusts some existing ones. |
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.
Replace fixed column allocation with a three-section flexbox layout that adapts to terminal width and the longest service name in the profile