Add ScreenScaler tests#109
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a test module to scaler.rs, an f32 comparison helper, multiple unit tests for FontScaler::glyph_position and ScreenScaler gutter/size behaviors, and resets smooth_gutter_x/y to zero before recomputing in change_physical_size_smooth. ChangesFontScaler and ScreenScaler test coverage
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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 `@bracket-terminal/src/hal/scaler.rs`:
- Around line 372-380: The test smooth_resize_resets_previous_gutter_values
fails because ScreenScaler::change_physical_size_smooth only updates one axis'
gutter and never clears the other, leaving stale state (e.g., smooth_gutter_x)
from a prior call; modify change_physical_size_smooth to reset both
smooth_gutter_x and smooth_gutter_y (or at minimum clear the opposite axis)
before applying the new per-axis gutter values so previous smooth gutters cannot
persist across calls, ensuring the test (and the field smooth_gutter_x) is
cleared as expected.
🪄 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
Run ID: 61518d10-f0d5-45d3-9985-45ad92a4a553
📒 Files selected for processing (1)
bracket-terminal/src/hal/scaler.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Format all Rust code usingcargo fmt --all
Fix allcargo clippywarnings — the CI enforces-D warnings
Add tests for new functionality in the relevant module; for split domains, prefer colocatedtests.rs
Files:
bracket-terminal/src/hal/scaler.rs
🔇 Additional comments (1)
bracket-terminal/src/hal/scaler.rs (1)
250-369: LGTM!Also applies to: 382-415
|
@coderabbitai help |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
CodeRabbit configuration file (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
What
Add regression tests for
ScreenScalerandFontScalerresize-related calculations.This PR adds test coverage for:
Why
Resize and gutter calculations are relatively isolated but are easy to accidentally break during rendering or window-management refactors.
These tests help protect rendering coordinate behavior and make future resize-related changes safer and easier to validate.
Closes #108
Checklist
Required
cargo check --allpassescargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warnings -A clippy::multiple-crate-versionspassescargo test --allpassesCloses #123)Functional Validation
Configuration & Docs
README.md,ARCHITECTURE.md, or relevant manual pages, if applicable)If Applicable
cargo auditlocally if needed)Summary by CodeRabbit
Bug Fixes
Tests