Skip to content

fix(core): adjust pushClip for active translateY to fix nested clip coordinate mismatch#1635

Merged
Karanjot786 merged 1 commit into
Karanjot786:mainfrom
ionfwsrijan:fix/1630-clip-translate-coords
Jun 21, 2026
Merged

fix(core): adjust pushClip for active translateY to fix nested clip coordinate mismatch#1635
Karanjot786 merged 1 commit into
Karanjot786:mainfrom
ionfwsrijan:fix/1630-clip-translate-coords

Conversation

@ionfwsrijan

Copy link
Copy Markdown
Contributor

Description

pushClip() stores clip regions in absolute terminal coordinates, while setCell() applies _translateY to the row before checking the clip. When a parent widget applies a translate (e.g., ScrollView scrolling) and a child widget pushes a clip, the child's clip region doesn't account for the parent's translate offset. Content inside the inner clip is incorrectly clipped out.

Fix

Adjusted pushClip() to convert the input region from absolute to visual coordinates by adding the current _translateY to region.y before storing. This makes the clip check in setCell() consistent with the translated coordinate space.

Tests

  • pushClip with active translateY adjusts clip region correctly
  • nested clips with active translate work correctly
  • setCell is clipped by translate-adjusted region when parents have translate

Closes #1630

@ionfwsrijan ionfwsrijan requested a review from Karanjot786 as a code owner June 19, 2026 06:18
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ionfwsrijan, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 29 minutes and 24 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

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

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d561b69-8d0a-488a-a0d1-1b84e256f16b

📥 Commits

Reviewing files that changed from the base of the PR and between 4b874c0 and beff8d5.

📒 Files selected for processing (2)
  • packages/core/src/terminal/Screen.test.ts
  • packages/core/src/terminal/Screen.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions Bot added type:bug +10 pts. Bug fix. area:core @termuijs/core type:testing +10 pts. Tests. labels Jun 19, 2026
@ionfwsrijan

Copy link
Copy Markdown
Contributor Author

@Karanjot786 Please review this

@Karanjot786 Karanjot786 merged commit ec28c12 into Karanjot786:main Jun 21, 2026
7 checks passed
@Karanjot786 Karanjot786 added gssoc:approved Approved PR. Earns +50 base points. level:advanced +55 pts. Complex task. quality:exceptional x 1.5 multiplier. Exceptional work. labels Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core @termuijs/core gssoc:approved Approved PR. Earns +50 base points. level:advanced +55 pts. Complex task. quality:exceptional x 1.5 multiplier. Exceptional work. type:bug +10 pts. Bug fix. type:testing +10 pts. Tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Nested pushClip/pushTranslateY coordinate mismatch causes invisible content in nested ScrollViews

2 participants