Skip to content

fix(desktop): update scroll-to-bottom for xterm.js 6.0#1163

Merged
Kitenite merged 1 commit into
mainfrom
kitenite/scroll-to-bottom-no-longer-works
Feb 3, 2026
Merged

fix(desktop): update scroll-to-bottom for xterm.js 6.0#1163
Kitenite merged 1 commit into
mainfrom
kitenite/scroll-to-bottom-no-longer-works

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 3, 2026

Summary

  • Fix scroll-to-bottom hotkey and button for xterm.js 6.0 compatibility
  • Use terminal.scrollToBottom() instead of manually scrolling .xterm-viewport DOM element
  • Use terminal.onScroll event instead of viewport scroll listener for detecting scroll position

Test plan

  • Open a terminal with scrollback history
  • Scroll up in the terminal
  • Press the scroll-to-bottom hotkey - should scroll to bottom
  • Click the scroll-to-bottom button - should scroll to bottom
  • Verify the button visibility updates correctly when scrolling

Summary by CodeRabbit

  • Refactor
    • Internal improvements to terminal component handling for enhanced code maintainability.

xterm.js 6.0 replaced the native browser scrollbar with VS Code's
scrollbar implementation. The old approach of manually scrolling
the .xterm-viewport element no longer works.

- Use terminal.scrollToBottom() directly instead of DOM manipulation
- Use terminal.onScroll event instead of viewport scroll listener
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Refactored terminal scroll handling to replace direct DOM event listeners with terminal-provided abstractions. The ScrollToBottomButton component now uses terminal.onScroll() instead of manually querying and listening to viewport elements. The scrollToBottom utility was simplified to remove the optional scroll behavior parameter and directly delegate to terminal.scrollToBottom().

Changes

Cohort / File(s) Summary
Terminal Scroll Refactoring
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/ScrollToBottomButton/ScrollToBottomButton.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/utils.ts
Migrated from DOM-based scroll event handling to terminal-provided abstractions. Replaced manual viewport listener with terminal.onScroll() hook. Simplified scrollToBottom utility by removing ScrollBehavior parameter and eliminating conditional viewport logic, now directly invoking terminal.scrollToBottom().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through scroll events so free,
Ditching DOM queries for hooks—oh what glee!
No more viewport DOM, just terminal's way,
Cleaner abstractions to brighten the day! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the key changes and includes a test plan, but uses a custom format instead of the required template structure with sections like 'Related Issues', 'Type of Change', 'Testing', etc. Restructure the description to follow the required template, including explicit sections for Related Issues, Type of Change (checkbox), and properly formatted Testing section with checkboxes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: updating scroll-to-bottom functionality for xterm.js 6.0 compatibility, which aligns with the changes in both files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/scroll-to-bottom-no-longer-works

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.

@Kitenite Kitenite merged commit ff72654 into main Feb 3, 2026
5 checks passed
@Kitenite Kitenite deleted the kitenite/scroll-to-bottom-no-longer-works branch February 3, 2026 07:00
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

Kitenite added a commit that referenced this pull request Feb 5, 2026
Kitenite added a commit that referenced this pull request Feb 5, 2026
* Revert "fix(desktop): update scroll-to-bottom for xterm.js 6.0 (#1163)"

This reverts commit ff72654.

* Revert "fix(desktop): update xterm CSS for 6.0.0 viewport changes (#1133)"

This reverts commit 5800bfd.

* Revert "chore(desktop): upgrade xterm.js to v6.0.0 (#1125)"

This reverts commit cce723b.

* chore: remove unused FilesView/types.ts (dead react-arborist import)
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