ledmatrix-stocks: compact layout — definite chart size + content-sized entries - #225
Open
ChuckBuilds wants to merge 2 commits into
Open
ledmatrix-stocks: compact layout — definite chart size + content-sized entries#225ChuckBuilds wants to merge 2 commits into
ChuckBuilds wants to merge 2 commits into
Conversation
The inline mini-chart was anchored to the far-right of the per-entry scroll canvas (~2x display width), while the price text sits just right of the logo. On larger panels this left a big empty gap between the price and the chart (e.g. ~135px at 256x64). Draw the chart immediately to the right of the text column (small fixed gap, clamped so it stays on-canvas for unusually wide text), then crop the entry canvas to the content so the leftover space doesn't become dead scroll gap. _draw_mini_chart gains an optional chart_x (defaults to the old right-anchored position). Also removes the now-unneeded text/chart overlap clamp. Verified by rendering mock data: price->chart gap drops from 135px to 6px at 256x64 (already tight at 128x32), no overlap, wide-text case stays on-canvas, and the safety harness passes at all sizes. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ
Contributor
📝 WalkthroughWalkthroughChangesStock chart layout
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/ledmatrix-stocks/display_renderer.py`:
- Around line 299-318: The chart placement in the renderer can overlap the text
when the clamped chart position falls inside the text column. Update the
toggle_chart path around _draw_mini_chart to preserve the intended chart_width
by expanding the rendering canvas before drawing, or skip the chart when it
cannot fit beside text; do not move the chart left into the text area. Ensure
rendering remains correct for all supported matrix sizes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b1bf0b5f-caae-4364-befa-b46b70d0c1fa
📒 Files selected for processing (3)
plugins.jsonplugins/ledmatrix-stocks/display_renderer.pyplugins/ledmatrix-stocks/manifest.json
Make the mini-chart a fixed pixel size (chart_width_px / chart_height_px, default 64x32) instead of a fraction of the display. Previously width was a fraction of the display-scaled canvas and height a fraction of the display height, so the chart ballooned on wide chains and tall 4x panels (and looked "massive" in vegas mode). Also size each entry's canvas to its actual measured content (logo + text + chart) instead of a display-scaled guess that was then clamped. This removes the dead space between tickers and fixes a chart/text overlap that the clamp caused on narrow panels with a large logo. Replaces the chart_width_percent / chart_height_percent config keys with chart_width_px / chart_height_px (README + schema updated). Verified: chart is a constant 64x32 at 64x128, 256x64, 128x32; no overlap on the tall panel; vegas-style strips are compact; safety harness passes at all sizes. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ
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.
Problem
The stock ticker layout scaled with the display, so it got massive on large/4x panels and in vegas mode:
display_width × multiplier) and its height a fraction of the display height — so it ballooned on wide chains (e.g. ~204px wide at 256) and on tall 4x panels (e.g. ~85px tall at 128).Changes
display.chart_width_px/display.chart_height_px(default 64×32), a fixed pixel size that does not scale with the display and is clamped to the panel. Replaceschart_width_percent/chart_height_percent.Verification
Manifest bumped 2.4.0 → 2.5.0 (config schema change); README + schema updated.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ