Skip to content

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

Merged
juliusmarminge merged 1 commit into
chatview-split/composer-compilesfrom
chatview-split/project-scripts
Oct 17, 2026
Merged

juliusmarminge merged 1 commit into
chatview-split/composer-compilesfrom
chatview-split/project-scripts

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

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

Layer ChatView lines ChatView component body Compiler on ChatView Files held to strict compiler lint
main 11,660 10,007 crashes (internal error) 0
#20161 pending approvals and questions hook 11,222 9,624 crashes (internal error) 0
#20164 terminal drawer and panel file 10,614 9,624 crashes (internal error) 0
#20289 one terminal open/close hook 10,466 9,481 crashes (internal error) 0
#20292 compile-required lint list 10,466 9,481 crashes (internal error) 2
#20294 pending hook compiles 10,466 9,481 crashes (internal error) 3
#20296 /usage-limits panel hook 10,397 9,416 crashes (internal error) 4
#20304 queued-message editing hook 10,172 9,200 crashes (internal error) 5
#20308 linked pull request hook 10,078 9,106 crashes (internal error) 6
#20309 proactive panel hook 9,950 8,984 crashes (internal error) 7
#20312 agent-opened previews hook 9,855 8,890 crashes (internal error) 8
#20315 right panel close hook 9,743 8,779 crashes (internal error) 9
#20316 worktree setup hook 9,660 8,695 crashes (internal error) 10
#20321 two onSend phases split out 9,660 8,613 crashes (internal error) 10
#20340 compiler no longer crashes on ChatView 9,647 8,599 skips (32 reasons) 10
#20379 ChatView compiles 9,616 8,469 compiles 11
#20380 re-render fixes from profiling 9,661 8,514 compiles 11
#20392 provider pushes keep identity 9,628 8,481 compiles 11
#20393 keyboard shortcuts command map 9,340 8,265 compiles 13
#20396 Sidebar compiles, no manual memos 9,340 8,265 compiles 14
#20397 ChatComposer compiles 9,340 8,265 compiles 14
→ #20401 project script editing hook 9,110 8,049 compiles 15
#20402 MessagesTimeline compiles 9,110 8,049 compiles 16
#20418 ChatView strict: no memos, no sync effects 8,901 7,855 compiles 17

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

@juliusmarminge
juliusmarminge added this pull request to stack #20165 October 16, 2026 22:28
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Oct 16, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 16, 2026
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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.

@juliusmarminge
juliusmarminge force-pushed the chatview-split/project-scripts branch from 7f957e9 to e60266a Compare October 16, 2026 23:27
This was referenced Oct 16, 2026
@juliusmarminge
juliusmarminge force-pushed the chatview-split/project-scripts branch from e60266a to bacc457 Compare October 17, 2026 00:02
@juliusmarminge
juliusmarminge force-pushed the chatview-split/project-scripts branch from bacc457 to dd9e683 Compare October 17, 2026 00:11
@juliusmarminge
juliusmarminge force-pushed the chatview-split/project-scripts branch 2 times, most recently from 1fa186b to 6ac2ee5 Compare October 17, 2026 00:33
Adding, editing and deleting a project's scripts (and reconciling their
keyboard shortcuts) was 220 lines in ChatView plus three atom commands
only it used. useProjectScriptEditing owns them and returns stable
handlers for the scripts control. It reads the environment's server
config from the atom registry at call time instead of the render's
environment map, so the shortcut it replaces is the one currently
stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the chatview-split/project-scripts branch from 6ac2ee5 to b3db3c0 Compare October 17, 2026 00:39
@juliusmarminge
juliusmarminge marked this pull request as ready for review October 17, 2026 00:41
@juliusmarminge
juliusmarminge merged commit bf990c6 into main Oct 17, 2026
36 of 37 checks passed
@juliusmarminge
juliusmarminge deleted the chatview-split/project-scripts branch October 17, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant