detached 06af173

refactor(modes): group interactive startup submission

commit
06af173e96906cfb1d9fe0b0080beb1837c4c112
author
brice · · 2026-08-14 03:34 UTC
committer
brice · · 2026-08-14 03:56 UTC
parent
4f3ea4d
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +39 -39
M packages/agent/modes/interactive.go +0 -39
@@ -3839,45 +3839,6 @@ func (i *Interactive) appendExtensionNote(extName, msg, level string) {
38393839 // holds an interface, not a concrete *Interactive, so these methods
38403840 // are the only thing the manager sees.
38413841
3842-// completeStartupPre applies deferred InitialInput after entry.pre finishes.
3843-// When AutoSubmitInitial was set, the deferred prompt is submitted; otherwise
3844-// it only pre-fills the editor (CLI-supplied prompts).
3845-func (i *Interactive) completeStartupPre() {
3846- i.mu.Lock()
3847- if !i.awaitingStartupPre {
3848- i.mu.Unlock()
3849- return
3850- }
3851- i.awaitingStartupPre = false
3852- deferred := i.deferredInitialInput
3853- auto := i.autoSubmitDeferred
3854- i.deferredInitialInput = ""
3855- i.autoSubmitDeferred = false
3856- onDone := i.cfg.OnStartupPreDone
3857- i.mu.Unlock()
3858- if onDone != nil {
3859- onDone()
3860- }
3861- i.startupPreDone <- startupPreResult{deferred: deferred, autoSubmit: auto}
3862- i.invalidate()
3863-}
3864-
3865-// applyStartupPreResult runs on the TUI event loop so the editor remains
3866-// single-threaded. Input entered while resources were reloading wins over the
3867-// deferred prefill rather than being overwritten.
3868-func (i *Interactive) applyStartupPreResult(result startupPreResult) {
3869- if result.deferred == "" {
3870- return
3871- }
3872- if result.autoSubmit {
3873- i.Submit(result.deferred)
3874- return
3875- }
3876- if i.ed.IsEmpty() {
3877- i.ed.SetValue(result.deferred)
3878- }
3879-}
3880-
38813842 // ApplySessionAgent swaps the live agent after a validated session resume.
38823843 // Unlike ApplyChangedCWD it does not mutate cwd-scoped resources or startup
38833844 // context; the session loader is changing the transcript/provider only.
@@ -3839,45 +3839,6 @@ func (i *Interactive) appendExtensionNote(extName, msg, level string) {
3839 // holds an interface, not a concrete *Interactive, so these methods3839 // holds an interface, not a concrete *Interactive, so these methods
3840 // are the only thing the manager sees.3840 // are the only thing the manager sees.
3841 3841
3842-// completeStartupPre applies deferred InitialInput after entry.pre finishes.
3843-// When AutoSubmitInitial was set, the deferred prompt is submitted; otherwise
3844-// it only pre-fills the editor (CLI-supplied prompts).
3845-func (i *Interactive) completeStartupPre() {
3846- i.mu.Lock()
3847- if !i.awaitingStartupPre {
3848- i.mu.Unlock()
3849- return
3850- }
3851- i.awaitingStartupPre = false
3852- deferred := i.deferredInitialInput
3853- auto := i.autoSubmitDeferred
3854- i.deferredInitialInput = ""
3855- i.autoSubmitDeferred = false
3856- onDone := i.cfg.OnStartupPreDone
3857- i.mu.Unlock()
3858- if onDone != nil {
3859- onDone()
3860- }
3861- i.startupPreDone <- startupPreResult{deferred: deferred, autoSubmit: auto}
3862- i.invalidate()
3863-}
3864-
3865-// applyStartupPreResult runs on the TUI event loop so the editor remains
3866-// single-threaded. Input entered while resources were reloading wins over the
3867-// deferred prefill rather than being overwritten.
3868-func (i *Interactive) applyStartupPreResult(result startupPreResult) {
3869- if result.deferred == "" {
3870- return
3871- }
3872- if result.autoSubmit {
3873- i.Submit(result.deferred)
3874- return
3875- }
3876- if i.ed.IsEmpty() {
3877- i.ed.SetValue(result.deferred)
3878- }
3879-}
3880-
3881 // ApplySessionAgent swaps the live agent after a validated session resume.3842 // ApplySessionAgent swaps the live agent after a validated session resume.
3882 // Unlike ApplyChangedCWD it does not mutate cwd-scoped resources or startup3843 // Unlike ApplyChangedCWD it does not mutate cwd-scoped resources or startup
3883 // context; the session loader is changing the transcript/provider only.3844 // context; the session loader is changing the transcript/provider only.
M packages/agent/modes/interactive_submit.go +39 -0
@@ -20,3 +20,42 @@ func (i *Interactive) Submit(text string) {
2020 }
2121 i.startTurn(parent, text)
2222 }
23+
24+// completeStartupPre applies deferred InitialInput after entry.pre finishes.
25+// When AutoSubmitInitial was set, the deferred prompt is submitted; otherwise
26+// it only pre-fills the editor (CLI-supplied prompts).
27+func (i *Interactive) completeStartupPre() {
28+ i.mu.Lock()
29+ if !i.awaitingStartupPre {
30+ i.mu.Unlock()
31+ return
32+ }
33+ i.awaitingStartupPre = false
34+ deferred := i.deferredInitialInput
35+ auto := i.autoSubmitDeferred
36+ i.deferredInitialInput = ""
37+ i.autoSubmitDeferred = false
38+ onDone := i.cfg.OnStartupPreDone
39+ i.mu.Unlock()
40+ if onDone != nil {
41+ onDone()
42+ }
43+ i.startupPreDone <- startupPreResult{deferred: deferred, autoSubmit: auto}
44+ i.invalidate()
45+}
46+
47+// applyStartupPreResult runs on the TUI event loop so the editor remains
48+// single-threaded. Input entered while resources were reloading wins over the
49+// deferred prefill rather than being overwritten.
50+func (i *Interactive) applyStartupPreResult(result startupPreResult) {
51+ if result.deferred == "" {
52+ return
53+ }
54+ if result.autoSubmit {
55+ i.Submit(result.deferred)
56+ return
57+ }
58+ if i.ed.IsEmpty() {
59+ i.ed.SetValue(result.deferred)
60+ }
61+}
@@ -20,3 +20,42 @@ func (i *Interactive) Submit(text string) {
20 }20 }
21 i.startTurn(parent, text)21 i.startTurn(parent, text)
22 }22 }
23+
24+// completeStartupPre applies deferred InitialInput after entry.pre finishes.
25+// When AutoSubmitInitial was set, the deferred prompt is submitted; otherwise
26+// it only pre-fills the editor (CLI-supplied prompts).
27+func (i *Interactive) completeStartupPre() {
28+ i.mu.Lock()
29+ if !i.awaitingStartupPre {
30+ i.mu.Unlock()
31+ return
32+ }
33+ i.awaitingStartupPre = false
34+ deferred := i.deferredInitialInput
35+ auto := i.autoSubmitDeferred
36+ i.deferredInitialInput = ""
37+ i.autoSubmitDeferred = false
38+ onDone := i.cfg.OnStartupPreDone
39+ i.mu.Unlock()
40+ if onDone != nil {
41+ onDone()
42+ }
43+ i.startupPreDone <- startupPreResult{deferred: deferred, autoSubmit: auto}
44+ i.invalidate()
45+}
46+
47+// applyStartupPreResult runs on the TUI event loop so the editor remains
48+// single-threaded. Input entered while resources were reloading wins over the
49+// deferred prefill rather than being overwritten.
50+func (i *Interactive) applyStartupPreResult(result startupPreResult) {
51+ if result.deferred == "" {
52+ return
53+ }
54+ if result.autoSubmit {
55+ i.Submit(result.deferred)
56+ return
57+ }
58+ if i.ed.IsEmpty() {
59+ i.ed.SetValue(result.deferred)
60+ }
61+}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close