fix: make TUI charts fill available width on wide terminals#24318
fix: make TUI charts fill available width on wide terminals#24318gnodet wants to merge 2 commits into
Conversation
Charts previously used a fixed 60-point buffer which left empty space on wide terminals. Increase history buffers to 300 points and compute renderPoints dynamically from the available area width so sparklines and bar charts fill their panels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
All tested modules (2 modules)
|
davsclaus
left a comment
There was a problem hiding this comment.
Nice cleanup — the dynamic sizing logic is correct and the buffer increase is well-scoped.
One thing I noticed: CircuitBreakerTab has the same fixed-60 chart sizing (MAX_CHART_POINTS = 60 at line 52, renderPoints = MAX_CHART_POINTS at line 355) that this PR fixes in EndpointsTab. The CB history buffer in MetricsCollector is already bumped to 300 (it goes through recordEndpointSample → MAX_ENDPOINT_CHART_POINTS), but the render side is still hardcoded. Could be addressed in a follow-up.
Also a pre-existing nit: OverviewTab declares its own MAX_SPARKLINE_POINTS instead of referencing MetricsCollector.MAX_SPARKLINE_POINTS — they could drift.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
|
|
||
| private static final String[] SORT_COLUMNS = { "component", "route", "dir", "total", "body", "hdr", "uri" }; | ||
| private static final int MAX_CHART_POINTS = 60; | ||
| private static final int MAX_CHART_POINTS = 300; |
There was a problem hiding this comment.
CircuitBreakerTab also has MAX_CHART_POINTS = 60 and a hardcoded renderPoints = MAX_CHART_POINTS (line 355) — same pattern this PR fixes here. The MetricsCollector buffer is already bumped (CB history uses MAX_ENDPOINT_CHART_POINTS via recordEndpointSample), so only the render side needs the same Math.min(MAX, Math.max(2, width - 6)) treatment. Could be a follow-up.
There was a problem hiding this comment.
Claude Code on behalf of Guillaume Nodet
Good catch! Applied the same treatment to CircuitBreakerTab: bumped MAX_CHART_POINTS to 300, computed renderPoints dynamically from vSplit.get(1).width() - 6, and made the x-axis labels dynamic too. See 398034a.
Same treatment as EndpointsTab: increase MAX_CHART_POINTS to 300, compute renderPoints from available width, and use dynamic x-axis labels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Claude Code on behalf of Guillaume Nodet
Charts previously used a fixed 60-point history buffer which left significant empty space on wide terminals. This PR makes charts dynamically size to fill the available width.
Changes
MAX_SPARKLINE_POINTSfrom 60 to 300 (bar chartrenderPointswas already computed dynamically from available width)MAX_CHART_POINTSfrom 60 to 300 and computerenderPointsdynamically from the chart area width in all three chart methods (renderEndpointFlow,renderSingleEndpointChart,renderPayloadSizeChart)Test plan
🤖 Generated with Claude Code