You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File > New: keep the template tiles inside the right margin in a narrow window - #1471
Cause.backstage.rs called ui.set_max_width(CONTENT_W) (1180) inside the page frame. In egui that also widens: when the window is narrower than 1180 points, the page grows past its 36pt right margin and the scroll area, so the last tile of each row is cut off at the screen edge (the "Paper" tile in the screenshot on the issue).
Fix.ui.set_max_width(ui.available_width().min(CONTENT_W)), the same clamp recent_list already uses.
What ran. Linux only, headless egui_kittest (no real window, no WSLg screenshot, no Windows or macOS run):
New test new_tiles_keep_the_right_margin_in_a_narrow_window renders File > New at 1000 points wide. Without the fix it fails ("Nocturne ends at 1136"); with the fix it passes.
cargo test -p deckcraft-ui-egui --lib backstage: 26 passed.
…torytold#1421)
set_max_width(CONTENT_W) widened the page past the margin whenever the window was
narrower than CONTENT_W, so the last tile in each row ran off the screen edge.
Reviewing files that changed from the base of the PR and between 55e5ee5 and b5928a1.
Files selected for processing: 2
crates/ui-egui/src/backstage.rs
crates/ui-egui/src/backstage/tests.rs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Walkthrough
The Backstage page now caps its content width to the available width when that width is below CONTENT_W. A new test checks template tile margins in a 1000-point-wide window.
Changes: Backstage layout
Layer / File(s)
Summary
Content width and layout validation crates/ui-egui/src/backstage.rs, crates/ui-egui/src/backstage/tests.rs
The content width is capped at the smaller of the available width and CONTENT_W. A new test checks that seven template tiles stay within the 36-point right margin in a 1000-point-wide window.
The focused layout change is supported by source inspection and targeted test coverage, with no concrete merge-blocking risk identified.
Architecture risk: Low · up to b5928
The change affects 1 system.
Changed systems:crates
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — crates (service) was modified; 2 changed files map to changed impact.
Before / after behavior
observed — Modified behavior in crates/ui-egui/src/backstage.rs: The content width maximum now uses the smaller of the available width and CONTENT_W; previously it used CONTENT_W unconditionally. The accompanying comment describes clipping in narrower windows.
observed — Modified behavior in crates/ui-egui/src/backstage/tests.rs: Adds a narrow-window layout test that opens the New page in a 1000-point-wide harness and checks that each of seven named tiles stays within the 36-point right margin.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and specifically describes the main change: keeping template tiles within the right margin in a narrow File > New window.
Linked Issues check
Issue [#1421] requires space between the screen edge and the template list on the new-document page. backstage.rs now clamps the page width with ui.available_width().min(CONTENT_W). The added `new…
Out of Scope Changes check
The pull request changes only the new-document page width calculation and adds a focused regression test for issue [#1421]. The changes support the stated objective and show no unrelated behavior or f…
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check
Explanation
Issue [#1421] requires space between the screen edge and the template list on the new-document page. backstage.rs now clamps the page width with ui.available_width().min(CONTENT_W). The added new_tiles_keep_the_right_margin_in_a_narrow_window test verifies that seven template tiles end at or before 964 points in a 1000-point window.
Full details: Out of Scope Changes check
Explanation
The pull request changes only the new-document page width calculation and adds a focused regression test for issue [#1421]. The changes support the stated objective and show no unrelated behavior or files.
Full details: Docstring Coverage
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.
Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
Clippy (1.99.0)
Clippy execution timed out
Comment @coderabbitai help to get the list of available commands.
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
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.
Fixes #1421.
Cause.
backstage.rscalledui.set_max_width(CONTENT_W)(1180) inside the page frame. In egui that also widens: when the window is narrower than 1180 points, the page grows past its 36pt right margin and the scroll area, so the last tile of each row is cut off at the screen edge (the "Paper" tile in the screenshot on the issue).Fix.
ui.set_max_width(ui.available_width().min(CONTENT_W)), the same clamprecent_listalready uses.What ran. Linux only, headless egui_kittest (no real window, no WSLg screenshot, no Windows or macOS run):
new_tiles_keep_the_right_margin_in_a_narrow_windowrenders File > New at 1000 points wide. Without the fix it fails ("Nocturne ends at 1136"); with the fix it passes.cargo test -p deckcraft-ui-egui --lib backstage: 26 passed.cargo fmt --checkandcargo clippy -p deckcraft-ui-egui --tests -- -D warnings: clean.Summary by CodeRabbit