Skip to content

feat(sidebar): show contextual terminal on project and home pages#1302

Merged
arnestrickmann merged 6 commits intogeneralaction:mainfrom
jschwxrz:emdash/feat-contextual-sidebar-terminal-609
Mar 5, 2026
Merged

feat(sidebar): show contextual terminal on project and home pages#1302
arnestrickmann merged 6 commits intogeneralaction:mainfrom
jschwxrz:emdash/feat-contextual-sidebar-terminal-609

Conversation

@jschwxrz
Copy link
Collaborator

@jschwxrz jschwxrz commented Mar 5, 2026

summary:

  • right sidebar showed empty "Changes" and "Terminal" placeholders when no project/task selected
  • no way to use a terminal

changes:

  • replaced the split changes + terminal placeholder panels with a full-height TaskTerminalPanel when no project/task selected
  • home/global terminal defaults to $HOME
  • terminal dropdown label and scope badge updated: "global" now really means global, "project" is project-scoped, "worktree" is task scoped

@vercel
Copy link

vercel bot commented Mar 5, 2026

@jschwxrz is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 5, 2026

Greptile Summary

This PR replaces the useless split "Changes / Terminal placeholder" panels in the right sidebar with a functional full-height TaskTerminalPanel on both the project page (no task selected) and the home page, and fixes the PTY fallback CWD from process.cwd() to os.homedir(). The changes are mostly solid, but two issues need addressing:

  • Dead code in RightSidebar.tsx: useAppSettings is imported and const { settings } = useAppSettings() is called (line 48), but settings is never used anywhere in the component. This is a leftover from an earlier iteration where settings-based fallback was planned; it should be removed to avoid an unnecessary React Query subscription.

  • Invisible task-placeholder PTY on the home page: Removing the if (!task && !projectPath) early-return guard means TaskTerminalPanel now renders its full terminal tree on the home page. taskKey evaluates to 'task-placeholder' when task is null, and useTaskTerminals eagerly creates a default terminal entry. The resulting TerminalPane (with keepAlive) is mounted but invisible — spawning a PTY in os.homedir() that the user can never access. This is a resource leak even if not user-visible.

Confidence Score: 3/5

  • Safe to merge after cleaning up dead code and addressing the invisible PTY leak on the home page.
  • The ptyManager.ts fix is correct and minimal. The RightSidebar.tsx cleanup is straightforward. However, the removal of the early-return guard in TaskTerminalPanel.tsx introduces a new resource leak (invisible PTY on home page) that should be fixed before merging. The core feature works (stable home key, correct scope labels, full-height terminal), but the unintended side effect needs attention.
  • src/renderer/components/TaskTerminalPanel.tsx (invisible PTY regression) and src/renderer/components/RightSidebar.tsx (unused settings import).

Comments Outside Diff (1)

  1. General comment

    Invisible task-placeholder PTY now spawns unconditionally on the home page

    taskKey is 'task-placeholder' whenever task is null, and useTaskTerminals('task-placeholder', undefined) creates a default terminal state (including a PTY-backed TerminalPane). Before this PR, the early-return guard if (!task && !projectPath) prevented the component from reaching this code on the home page. That guard has now been removed, so every home-page render mounts an invisible TerminalPane with keepAlive under the 'task-placeholder' key — spawning a PTY in os.homedir() that is never shown to the user (the Worktree SelectGroup only renders when task is truthy).

    Consider keeping the early return for the fully no-task/no-project case, or alternatively delaying useTaskTerminals initialization to only when task is non-null:

    This way the 'task-placeholder' state is never eagerly created when there is no task.

Last reviewed commit: 5a72a58

@jschwxrz
Copy link
Collaborator Author

jschwxrz commented Mar 5, 2026

@greptileai

@jschwxrz
Copy link
Collaborator Author

jschwxrz commented Mar 5, 2026

@greptileai

@jschwxrz
Copy link
Collaborator Author

jschwxrz commented Mar 5, 2026

@greptileai

@arnestrickmann arnestrickmann merged commit cb1f93b into generalaction:main Mar 5, 2026
2 of 3 checks passed
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.

2 participants