Skip to content

Fix resize flickering#332

Merged
Kitenite merged 2 commits intomainfrom
warm-barracuda-eba819
Dec 12, 2025
Merged

Fix resize flickering#332
Kitenite merged 2 commits intomainfrom
warm-barracuda-eba819

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Dec 12, 2025

  • Fix resize flickering

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • Refactor

    • Improved terminal resize handling with a single debounced handler to keep the terminal fitting and responsive while reducing redundant work.
  • Bug Fixes

    • Strengthened change-view loading guard to avoid rendering when essential status data is missing, preventing incorrect or partial displays.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Consolidates terminal resize logic into a single debounced handler that calls fitAddon.fit() and onResize(cols, rows); updates ResizeObserver and window resize listener to use it and adjusts cleanup. Also tightens a status guard in ChangesView to require several status fields before rendering the error state.

Changes

Cohort / File(s) Summary
Terminal resize handler refactoring
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/helpers.ts
Replaced prior delegated resize flow with one debounced handler that runs fitAddon.fit() and onResize(xterm.cols, xterm.rows). Updated ResizeObserver and window resize listener to use the new handler; cleanup now cancels debouncedHandleResize.
ChangesView status guard tightening
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/ChangesView.tsx
Replaced a simple null check for status with a stricter guard requiring status plus againstMain, commits, staged, unstaged, and untracked to be truthy before rendering the "Unable to load changes" state.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect closure capture of xterm and fitAddon in the debounced handler to ensure references remain valid across lifecycle.
  • Confirm all places that attached the old handlers now attach the new one and that debouncedHandleResize.cancel() is invoked on unmount/cleanup.
  • Verify the stricter status guard doesn't inadvertently hide valid states (check callers and tests around hasChanges, commitsWithFiles, and file lists).

Possibly related PRs

Poem

🐰 I hopped through code with gentle paws,
Merged two handlers without a pause,
Fit and resize now side by side,
Status checks tightened — tidy pride,
A little rabbit cheers the tidy cause! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description contains only unrelated PR references and unfilled template sections. The actual changeset details are missing, and no required sections are properly completed with relevant information about the resize flickering fix. Complete the Description section with details about the resize handling refactor. Fill in Related Issues, select the appropriate Type of Change (likely 'Bug fix'), and describe testing steps performed to verify the fix works.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix resize flickering' is clear and specific, directly matching the primary change described in the raw summary about reworking resize handling to eliminate flickering.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a46eb7 and 8eee90c.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/ChangesView.tsx (1 hunks)

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 12, 2025

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Database (Neon) View Branch
API (Vercel) Open Preview
Web (Vercel) Open Preview
Marketing (Vercel) Open Preview
Admin (Vercel) Open Preview
Docs (Vercel) Open Preview

Preview updates automatically with new commits

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