Skip to content

Clean up Terminal api#1083

Merged
Kitenite merged 2 commits intomainfrom
terminal-debug
Jan 31, 2026
Merged

Clean up Terminal api#1083
Kitenite merged 2 commits intomainfrom
terminal-debug

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Jan 31, 2026

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
    • Terminal handling updated to distinguish pane vs. tab identity for clearer, more consistent behavior.
  • Bug Fixes
    • Improved focus management, session attach/restore, and restart flows for terminals to reduce mismatches and race conditions.
  • User Experience
    • More reliable title updates and more predictable terminal session restoration across pane/tab changes.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

Terminal and its cold-restore hook were changed to accept an explicit paneId in addition to tabId; TabPane invocation and internal references were updated so pane and tab identifiers are passed and used separately across creation, attach, focus, restore, and title-update flows.

Changes

Cohort / File(s) Summary
Terminal core & types
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/types.ts
Component signature updated to ({ paneId, tabId, workspaceId }); removed local paneId = tabId alias; internal logic now uses both paneId and tabId explicitly; TerminalProps adds paneId: string.
Terminal hook (cold-restore)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/hooks/useTerminalColdRestore.ts
Hook signature/options now include tabId (removed parentTabIdRef); create/attach payloads and callbacks use explicit tabId; dependency arrays updated.
TabPane usage
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsx
Invocation of Terminal changed from tabId={paneId} to paneId={paneId} and tabId={tabId}, adapting to the new dual-identifier props.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I hopped through panes and tabs today,

clip-clop of keys, a gentle sway.
Now every pane knows its proper name,
tab and pane each play their game.
Bravo — a rabbit's little celebratory nibble! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is entirely empty with only the template placeholders remaining; no substantive information was provided by the author. Complete the description by explaining what props are being renamed, why the change is needed, and confirm testing with the commit message 'Pass tabId'.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 'Clean up Terminal api' directly relates to the main change: refactoring Terminal props by replacing tabId aliasing with explicit paneId and tabId props, improving the public API clarity.

✏️ 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 terminal-debug

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 changed the title Rename props Clean up Terminal api Jan 31, 2026
@Kitenite Kitenite merged commit 9f1927d into main Jan 31, 2026
5 checks passed
@Kitenite Kitenite deleted the terminal-debug branch January 31, 2026 19:18
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

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

Thank you for your contribution! 🎉

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