Skip to content

fix(terminals): show script tabs alongside terminals in the drawer - #3107

Open
claude[bot] wants to merge 2 commits into
mainfrom
terminal-drawer-always-show-scripts
Open

fix(terminals): show script tabs alongside terminals in the drawer#3107
claude[bot] wants to merge 2 commits into
mainfrom
terminal-drawer-always-show-scripts

Conversation

@claude

@claude claude Bot commented Sep 3, 2026

Copy link
Copy Markdown

Requested via Slack thread

Description

Before: The terminal drawer tab row shows either terminal tabs or script tabs, chosen with a Terminals/Scripts toggle on the right. Reaching a script's Run/Stop control takes an extra click, and script status is not visible while the terminals view is showing.

After: Both groups are always in the row. Terminal tabs (creation order) and the new-terminal button sit in the scrolling region on the left; script tabs (Prepare, Setup, Run, Teardown, configured ones only) are pinned on the right after the divider, with their status icons and Run/Stop actions as before. When no scripts are configured, the divider and script group are not rendered.

How: terminal-drawer-tab-bar.tsx drops the Tabs toggle and the mode/onModeChange props and renders the two role="tablist" groups side by side. terminal-panel.tsx removes the mode state (and the effect and handler that kept it in sync) and derives the active terminal, script, session, and pane-scope store from activeItem.kind, which already comes from the persisted drawer memento. The unreachable "No scripts configured" empty state is removed.

Related issues

None.

Testing

  • pnpm run format:check, pnpm run lint, pnpm run typecheck in apps/emdash-desktop
  • vitest run --project node src/core/features/terminals src/core/features/workspaces/browser/lifecycle-scripts.test.ts (9 files, 51 tests)
  • vitest run --project browser for terminal-panel-focus.browser.test.tsx and terminal-shell-menu.test.tsx (2 files, 4 tests)

Screenshot/Recording (if applicable)

Not yet captured.

Checklist
  • I kept this PR small and focused
  • I ran a self-review before opening this PR
  • I ran the relevant local checks or explained why not
  • I updated docs when behavior or setup changed (no docs reference the toggle)
  • I added or updated tests when behavior changed, or explained why not (existing panel tests cover the drawer; no new behaviour beyond layout)
  • I only added comments where the logic is not obvious
  • I used Conventional Commits for commit
    messages and, when possible, the PR title

馃 Generated with Claude Code

https://claude.ai/code/session_01X72hpiKUWt5CvF1YBiuChd


Generated by Claude Code

Drop the Terminals/Scripts mode toggle from the terminal drawer tab bar and
render both groups in the same row: terminal tabs and the new-terminal button
in the scrolling region on the left, script tabs pinned right after the
divider. The divider and script group are omitted when no scripts are
configured.

The panel no longer keeps a separate mode state; the active terminal, script,
session, and pane-scope store are derived from the persisted active drawer
item instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X72hpiKUWt5CvF1YBiuChd
@claude
claude Bot marked this pull request as ready for review September 3, 2026 16:16
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the terminal/script mode toggle and displays lifecycle-script tabs beside terminal tabs while deriving panel state directly from the persisted active item.

  • Keeps terminal tabs and terminal creation in a scrollable left-hand region.
  • Pins configured lifecycle scripts and their run/stop controls on the right.
  • Simplifies active-session and pane-scope selection in the terminal panel.

Confidence Score: 4/5

The layout overflow should be fixed before merging because narrowing the drawer can make terminal or script controls unreachable.

The new always-visible script group cannot shrink or scroll inside an overflow-clipped row, so configured scripts can consume the available drawer width and hide interactive controls.

Files Needing Attention: apps/emdash-desktop/src/core/features/terminals/browser/task-terminal/terminal-drawer-tab-bar.tsx

Important Files Changed

Filename Overview
apps/emdash-desktop/src/core/features/terminals/browser/task-terminal/terminal-drawer-tab-bar.tsx Renders terminal and script tablists concurrently, but the pinned non-scrollable script group can make controls unreachable in a narrow drawer.
apps/emdash-desktop/src/core/features/terminals/contributions/browser/task-terminal/terminal-panel.tsx Removes mode state and consistently derives the active session and pane-scope provider from the resolved active item.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Drawer[Terminal drawer row]
  Terminals[Scrollable terminal tabs]
  NewTerminal[New-terminal control]
  Divider[Divider]
  Scripts[Pinned script tabs]
  Drawer --> Terminals
  Terminals --> NewTerminal
  Drawer --> Divider
  Divider --> Scripts
Loading
Prompt To Fix All With AI
### Issue 1
apps/emdash-desktop/src/core/features/terminals/browser/task-terminal/terminal-drawer-tab-bar.tsx:145
**Pinned scripts overflow the drawer**

When the drawer is narrow and several lifecycle scripts are configured, this non-shrinking script group consumes the available width inside an overflow-clipped row, collapsing the terminal region and clipping rightmost script controls with no way to scroll to them.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix(terminals): show script tabs alongsi..." | Re-trigger Greptile

The pinned script group did not shrink, so in a narrow drawer it pushed
the terminal tablist down to nothing and the outer overflow-hidden row
clipped the rightmost script tab with no way to scroll to it. Let the
script group shrink and scroll like the terminal tablist, and give the
terminal tablist a minimum width so its tabs and the new-terminal button
stay usable.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X72hpiKUWt5CvF1YBiuChd
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