Skip to content

fix(vegas): stop capping plugin width by default - #445

Merged
ChuckBuilds merged 2 commits into
mainfrom
feat/vegas-uncap-by-default
Aug 7, 2026
Merged

fix(vegas): stop capping plugin width by default#445
ChuckBuilds merged 2 commits into
mainfrom
feat/vegas-uncap-by-default

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Why

Vegas plugins read as "cut off early" or "starting in the middle". That is the per-plugin width budget in plugin_adapter.py, not the scroll engine — overflow_mode=rotate is designed to resume mid-content on each appearance, so the symptom was the feature working as specified.

Measured over a 17-plugin fleet on a 512px panel, the cap turned out to be a bad trade. Only four plugins were ever wide enough to hit the 3.0 default:

Plugin Content Time @ 50px/s vs 1536px cap
ledmatrix-leaderboard 11,518px 3m50s over
news 10,021px 3m20s over
odds-ticker 4,643px 1m33s over
hockey-scoreboard 1,508px 30s at the line
ledmatrix-weather 650px 13s never touched
ledmatrix-flights 512px ~10s never touched
11 others 87–1,104px 2–22s never touched

So it bought nothing on thirteen plugins while costing two visible faults on four:

  • Content entered mid-item. A news ticker started at column 6027 of its own strip.
  • The final rotation window was whatever was left. An 1,840px stocks ticker against a 1,536px budget split 1,492 + 348px — seven seconds of panel time before it cut.

What changed

max_plugin_width_ratio defaults to 0 (uncapped), so every plugin contributes all of its content and is always entered at its beginning. Updated in the dataclass, the from_config fallback, config.template.json, CONFIG_REFERENCE.md, and the web UI's help text and fallback value.

The cap is unchanged and still available. vegas_max_width_screens still caps an individual plugin, which is where the knob belongs — a genuinely long ticker is a property of that plugin, not of the fleet.

Verification

  • test_width_cap_is_off_by_default added; 195 tests pass across test_vegas_density.py, test_vegas_continuous_refresh.py, test_vegas_render_pipeline_recompose.py.
  • Live on a 512px device: 327 budget crops in the preceding six hours, none after.

Not addressed here

Two defects in the capping path, now dormant at the default but live for anyone who sets a cap:

  1. _crop_to_budget has no minimum window size, hence the 348px runt above.
  2. The stored pixel offset is reused after a plugin re-renders at a different width (news went 9,793 → 9,505px mid-rotation), so the offset points at different content — breaking the "everything is seen eventually" promise for any ticker that refreshes.

Happy to follow up on those separately.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5

Summary by CodeRabbit

  • Improvements

    • Vegas Scroll now allows plugin content to use unlimited width by default.
    • The “Max Plugin Width” setting and configuration documentation now clarify that 0.0 means unlimited width.
    • When a width limit is applied, content can continue through the middle of the display.
  • Tests

    • Added coverage confirming the new unlimited-width default.

Vegas plugins read as "cut off early" or "starting in the middle". That
was the per-plugin width budget, not the scroll engine:
overflow_mode=rotate is designed to resume mid-content on each
appearance, so the symptom was the feature working as specified.

Measured over a 17-plugin fleet on a 512px panel, the cap was a bad
trade. Only four plugins were ever wide enough to hit the 3.0 default --
leaderboard 11,518px, news 10,021px, odds-ticker 4,643px, hockey
1,508px. Weather is 650px and flights 512px; the cap never touched them
or the other eleven. So it bought nothing on thirteen plugins while
costing two visible faults on four: content entering mid-item (a news
ticker started at column 6027 of its own strip), and a final rotation
window of whatever happened to be left -- 348px of an 1,840px stocks
ticker, seven seconds of panel time.

Default max_plugin_width_ratio to 0 (uncapped), so every plugin
contributes all of its content and is always entered at its beginning.
The cap remains available, and vegas_max_width_screens still caps an
individual plugin -- which is where the knob belongs, since a genuinely
long ticker is a property of that plugin rather than of the fleet.

Verified on a live 512px device: 327 budget crops in the preceding six
hours, none after.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ChuckBuilds, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b96fdfb1-7cce-44b5-a2df-b076816631f4

📥 Commits

Reviewing files that changed from the base of the PR and between e0d62a9 and f8d700e.

📒 Files selected for processing (1)
  • test/test_vegas_density.py
📝 Walkthrough

Walkthrough

The default max_plugin_width_ratio changes from 3.0 to 0.0. Configuration loading, documentation, the UI, and tests now reflect the unlimited default.

Changes

Plugin width default

Layer / File(s) Summary
Configuration default behavior
src/vegas_mode/config.py, test/test_vegas_density.py
VegasModeConfig and empty configuration parsing now default max_plugin_width_ratio to 0.0. Tests cover both construction paths.
Configuration and UI surfaces
config/config.template.json, docs/CONFIG_REFERENCE.md, web_interface/templates/v3/partials/display.html
The template, reference documentation, and Max Plugin Width control use and describe 0.0 as the unlimited default.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: disabling the default Vegas plugin-width cap.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/vegas-uncap-by-default

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
test/test_vegas_density.py (1)

784-789: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the preserved opt-in path.

The test checks only omitted values. Add a case with an explicit 3.0 value. This protects the contract that the width cap remains available after the default changes.

Suggested regression case
     def test_width_cap_is_off_by_default(self):
         # Capping made wide plugins resume mid-content on every appearance and
         # emit runt final windows; it is now opt-in per plugin instead.
         assert VegasModeConfig().max_plugin_width_ratio == 0.0
         assert VegasModeConfig.from_config({}).max_plugin_width_ratio == 0.0
+
+    def test_width_cap_can_be_enabled(self):
+        cfg = VegasModeConfig.from_config({
+            'display': {'vegas_scroll': {
+                'max_plugin_width_ratio': 3.0
+            }}
+        })
+        assert cfg.max_plugin_width_ratio == 3.0
🤖 Prompt for 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.

In `@test/test_vegas_density.py` around lines 784 - 789, Add an explicit opt-in
assertion to test_width_cap_is_off_by_default by constructing
VegasModeConfig.from_config with max_plugin_width_ratio set to 3.0 and verifying
the resulting value remains 3.0, while preserving the existing default-value
assertions.
🤖 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.

Nitpick comments:
In `@test/test_vegas_density.py`:
- Around line 784-789: Add an explicit opt-in assertion to
test_width_cap_is_off_by_default by constructing VegasModeConfig.from_config
with max_plugin_width_ratio set to 3.0 and verifying the resulting value remains
3.0, while preserving the existing default-value assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 680fb3cc-b35a-47b2-b5ea-ea37f99217e0

📥 Commits

Reviewing files that changed from the base of the PR and between fc25a70 and e0d62a9.

📒 Files selected for processing (5)
  • config/config.template.json
  • docs/CONFIG_REFERENCE.md
  • src/vegas_mode/config.py
  • test/test_vegas_density.py
  • web_interface/templates/v3/partials/display.html

Defaulting the cap off must not quietly remove it. Asserts that an
explicit ratio is honoured and validates, alongside the existing check
that omitting it means uncapped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5
@ChuckBuilds
ChuckBuilds merged commit 6287acd into main Aug 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant