Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(web): move project script editing out of ChatView #20401

Mergedjuliusmarmingemerged 1 commit intochatview-split/composer-compiles fromrefs/pull/20401/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

ChatView carried about 220 lines for adding, editing and deleting a project's scripts, plus three atom commands that nothing else in ChatView used: update settings, upsert keybinding and remove keybinding. That code also reconciles each script's keyboard shortcut.

chat/useProjectScriptEditing.ts now owns that code and returns stable saveProjectScript/updateProjectScript/deleteProjectScript handlers for the scripts control. The logic moved over unchanged, with one exception: the environment's server config, used for the keybindings to replace and the project-settings-override capability, is read from the atom registry when the handler runs, not from the render's environment map. The shortcut it replaces is therefore the one currently stored. Running scripts stays in ChatView because it drives the terminal drawer.

The hook is on the compile-required list. ChatView drops from 9,340 to 9,110 lines.

Tests: projectScripts, reactCompiledFiles (36 pass).

Stack progress

LayerChatView linesChatView component bodyCompiler on ChatViewFiles held to strict compiler lint
main11,66010,007crashes (internal error)0
#20161 pending approvals and questions hook11,2229,624crashes (internal error)0
#20164 terminal drawer and panel file10,6149,624crashes (internal error)0
#20289 one terminal open/close hook10,4669,481crashes (internal error)0
#20292 compile-required lint list10,4669,481crashes (internal error)2
#20294 pending hook compiles10,4669,481crashes (internal error)3
#20296 /usage-limits panel hook10,3979,416crashes (internal error)4
#20304 queued-message editing hook10,1729,200crashes (internal error)5
#20308 linked pull request hook10,0789,106crashes (internal error)6
#20309 proactive panel hook9,9508,984crashes (internal error)7
#20312 agent-opened previews hook9,8558,890crashes (internal error)8
#20315 right panel close hook9,7438,779crashes (internal error)9
#20316 worktree setup hook9,6608,695crashes (internal error)10
#20321 two onSend phases split out9,6608,613crashes (internal error)10
#20340 compiler no longer crashes on ChatView9,6478,599skips (32 reasons)10
#20379 ChatView compiles9,6168,469compiles11
#20380 re-render fixes from profiling9,6618,514compiles11
#20392 provider pushes keep identity9,6288,481compiles11
#20393 keyboard shortcuts command map9,3408,265compiles13
#20396 Sidebar compiles, no manual memos9,3408,265compiles14
#20397 ChatComposer compiles9,3408,265compiles14
→ #20401 project script editing hook9,1108,049compiles15
#20402 MessagesTimeline compiles9,1108,049compiles16
#20418 ChatView strict: no memos, no sync effects8,9017,855compiles17

Measured with the native React Compiler (oxc-transform-react) on each layer's ChatView.tsx. "Crashes" means it hit an internal codegen error and left ChatView uncompiled; "skips" means it reported reasons it could not compile it. Strict files must compile with no bailouts, no manual memoization and no effect-rule violations; lint and reactCompiledFiles.test.ts enforce it.

🤖 Generated with Claude Code (Claude Opus 5.5)


Devin Review
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. juliusmarminge added labelsmacroscope-review

    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ⚠️ The latest CI run did not produce a thread transfer result for 6ac2ee5.

      This comment will update automatically after the next completed run.

    4. juliusmarminge merged thisbf990c6

    5. juliusmarminge closed this

Sign in to join this conversation.