# refactor\(web\): ChatView's terminal actions live in useChatTerminalActions · PR \#23063 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/23063)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: refactor/split2-chatview-terminal

Target branch: refactor/split2-chatview-send

Head commit: 089570e0a46fc41404d2402da2d54826d55380d9

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/23063)

[Commits](https://git.cafe/pingdotgg/t3code/pull/23063/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/23063/diffs?format=markdown)

## Description

---

Drawer and right-panel terminal actions, project scripts, and chat code blocks move into `chat/useChatTerminalActions.ts`, with the terminal store selectors, terminal session actions, and the last-invoked-script storage they use.

One small cleanup: `runShellCommand` called the script runner through a ref kept fresh by a layout effect. The runner is already a stable callback that reads the latest render, so it now calls it directly and the layout-effect ref assignment is gone.

| | Before | After |
|---|---|---|
| `ChatView.tsx` lines | 5,700 | 5,420 |

Tests: `tsc-rs --noEmit` for apps/web, oxlint on the changed files, `vp test run src/components/ChatView.logic.test.ts`, and the React Compiler coverage test for every changed file (0 bailouts). ChatView stays in the coverage test's slow set.

Part of the ChatView split (7,258 → 3,975 lines across the stack).

Opus 5.5, Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

