detached 9725a6d

refactor(prompt): rename CLI confirmer package to confirm

commit
9725a6d912ca3a3cf8fcfc7771abffd5da6391fb
author
brice · · 2026-07-03 09:13 UTC
parent
206ab7a
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
4 files · +8 -8
M internal/app/run.go +3 -3
@@ -24,8 +24,8 @@ import (
2424 "github.com/bnema/vev/internal/adapters/term"
2525 "github.com/bnema/vev/internal/ports"
2626 "github.com/bnema/vev/internal/usecase/client"
27+ "github.com/bnema/vev/internal/usecase/confirm"
2728 "github.com/bnema/vev/internal/usecase/daemon"
28- "github.com/bnema/vev/internal/usecase/prompt"
2929 )
3030
3131 // cmdKind identifies which sub-command the CLI parsed.
@@ -254,14 +254,14 @@ func runAttach(ctx context.Context, intent uint8, name, remoteTarget string) err
254254 }
255255
256256 return runLocalAttachWithRecovery(ctx, intent, name, attachRecoveryDeps{
257- confirmer: prompt.NewConfirmer(os.Stdin, os.Stderr),
257+ confirmer: confirm.NewConfirmer(os.Stdin, os.Stderr),
258258 attach: attachLocalDaemon,
259259 killDaemon: requestDaemonStop,
260260 })
261261 }
262262
263263 type attachRecoveryDeps struct {
264- confirmer prompt.Confirmer
264+ confirmer confirm.Confirmer
265265 attach func(context.Context, uint8, string) error
266266 killDaemon func(context.Context) error
267267 }
@@ -24,8 +24,8 @@ import (
24 "github.com/bnema/vev/internal/adapters/term"24 "github.com/bnema/vev/internal/adapters/term"
25 "github.com/bnema/vev/internal/ports"25 "github.com/bnema/vev/internal/ports"
26 "github.com/bnema/vev/internal/usecase/client"26 "github.com/bnema/vev/internal/usecase/client"
27+ "github.com/bnema/vev/internal/usecase/confirm"
27 "github.com/bnema/vev/internal/usecase/daemon"28 "github.com/bnema/vev/internal/usecase/daemon"
28- "github.com/bnema/vev/internal/usecase/prompt"
29 )29 )
30 30
31 // cmdKind identifies which sub-command the CLI parsed.31 // cmdKind identifies which sub-command the CLI parsed.
@@ -254,14 +254,14 @@ func runAttach(ctx context.Context, intent uint8, name, remoteTarget string) err
254 }254 }
255 255
256 return runLocalAttachWithRecovery(ctx, intent, name, attachRecoveryDeps{256 return runLocalAttachWithRecovery(ctx, intent, name, attachRecoveryDeps{
257- confirmer: prompt.NewConfirmer(os.Stdin, os.Stderr),257+ confirmer: confirm.NewConfirmer(os.Stdin, os.Stderr),
258 attach: attachLocalDaemon,258 attach: attachLocalDaemon,
259 killDaemon: requestDaemonStop,259 killDaemon: requestDaemonStop,
260 })260 })
261 }261 }
262 262
263 type attachRecoveryDeps struct {263 type attachRecoveryDeps struct {
264- confirmer prompt.Confirmer264+ confirmer confirm.Confirmer
265 attach func(context.Context, uint8, string) error265 attach func(context.Context, uint8, string) error
266 killDaemon func(context.Context) error266 killDaemon func(context.Context) error
267 }267 }
M internal/app/run_test.go +3 -3
@@ -9,7 +9,7 @@ import (
99
1010 "github.com/bnema/vev/internal/ports"
1111 "github.com/bnema/vev/internal/usecase/client"
12- "github.com/bnema/vev/internal/usecase/prompt"
12+ "github.com/bnema/vev/internal/usecase/confirm"
1313 )
1414
1515 func TestParseArgs(t *testing.T) {
@@ -103,7 +103,7 @@ func TestRunLocalAttachPromptsAndRestartsOnProtocolMismatch(t *testing.T) {
103103 killCalls := 0
104104
105105 err := runLocalAttachWithRecovery(context.Background(), ports.IntentEphemeral, "", attachRecoveryDeps{
106- confirmer: prompt.NewConfirmer(answers, &prompts),
106+ confirmer: confirm.NewConfirmer(answers, &prompts),
107107 attach: func(context.Context, uint8, string) error {
108108 attachCalls++
109109 if attachCalls == 1 {
@@ -137,7 +137,7 @@ func TestRunLocalAttachDeclineKeepsOriginalError(t *testing.T) {
137137 killCalls := 0
138138
139139 err := runLocalAttachWithRecovery(context.Background(), ports.IntentEphemeral, "", attachRecoveryDeps{
140- confirmer: prompt.NewConfirmer(answers, &bytes.Buffer{}),
140+ confirmer: confirm.NewConfirmer(answers, &bytes.Buffer{}),
141141 attach: func(context.Context, uint8, string) error {
142142 attachCalls++
143143 return wantErr
@@ -9,7 +9,7 @@ import (
9 9
10 "github.com/bnema/vev/internal/ports"10 "github.com/bnema/vev/internal/ports"
11 "github.com/bnema/vev/internal/usecase/client"11 "github.com/bnema/vev/internal/usecase/client"
12- "github.com/bnema/vev/internal/usecase/prompt"12+ "github.com/bnema/vev/internal/usecase/confirm"
13 )13 )
14 14
15 func TestParseArgs(t *testing.T) {15 func TestParseArgs(t *testing.T) {
@@ -103,7 +103,7 @@ func TestRunLocalAttachPromptsAndRestartsOnProtocolMismatch(t *testing.T) {
103 killCalls := 0103 killCalls := 0
104 104
105 err := runLocalAttachWithRecovery(context.Background(), ports.IntentEphemeral, "", attachRecoveryDeps{105 err := runLocalAttachWithRecovery(context.Background(), ports.IntentEphemeral, "", attachRecoveryDeps{
106- confirmer: prompt.NewConfirmer(answers, &prompts),106+ confirmer: confirm.NewConfirmer(answers, &prompts),
107 attach: func(context.Context, uint8, string) error {107 attach: func(context.Context, uint8, string) error {
108 attachCalls++108 attachCalls++
109 if attachCalls == 1 {109 if attachCalls == 1 {
@@ -137,7 +137,7 @@ func TestRunLocalAttachDeclineKeepsOriginalError(t *testing.T) {
137 killCalls := 0137 killCalls := 0
138 138
139 err := runLocalAttachWithRecovery(context.Background(), ports.IntentEphemeral, "", attachRecoveryDeps{139 err := runLocalAttachWithRecovery(context.Background(), ports.IntentEphemeral, "", attachRecoveryDeps{
140- confirmer: prompt.NewConfirmer(answers, &bytes.Buffer{}),140+ confirmer: confirm.NewConfirmer(answers, &bytes.Buffer{}),
141 attach: func(context.Context, uint8, string) error {141 attach: func(context.Context, uint8, string) error {
142 attachCalls++142 attachCalls++
143 return wantErr143 return wantErr
R internal/usecase/prompt/confirm.go → internal/usecase/confirm/confirm.go +1 -1 renamed, 98% similar
@@ -1,4 +1,4 @@
1-package prompt
1+package confirm
22
33 import (
44 "bufio"
@@ -1,4 +1,4 @@
1-package prompt1+package confirm
2 2
3 import (3 import (
4 "bufio"4 "bufio"
R internal/usecase/prompt/confirm_test.go → internal/usecase/confirm/confirm_test.go +1 -1 renamed, 98% similar
@@ -1,4 +1,4 @@
1-package prompt
1+package confirm
22
33 import (
44 "bytes"
@@ -1,4 +1,4 @@
1-package prompt1+package confirm
2 2
3 import (3 import (
4 "bytes"4 "bytes"

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 12

Tags 11

↑↓ moveenter openesc close