criew 0.0.3

Terminal-first Linux kernel patch mail workflow TUI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# Keybindings

This page lists the current CRIEW TUI keys by page and modal state.
Use it for operator reference,
training material,
and future screenshots or annotated UI guides.

## Scope

- Key behavior is state-dependent.
  The same key can mean page toggle,
  completion,
  or indentation depending on the active modal surface.
- `ui.keymap` affects only the main page navigation layer.
  Reply editing,
  config editing,
  search,
  and the inline code editor keep their own fixed bindings.
- The current source of truth is the TUI input handler in
  `src/ui/tui/input.rs`.

## Main pages

### Suggested image slot

- Suggested file:
  `images/keybindings-main-pages.png`
- Suggested capture:
  Mail page and code-browser page with the header keymap label visible.

### Shared page keys

- `:`:
  Open the command palette.
  This is the preferred entry key.
- `F1`:
  Toggle the command palette open or closed.
- `Ctrl+backtick`:
  Toggle the command palette.
  CRIEW also accepts several terminal-specific encodings of the same shortcut.
- `Tab`:
  Toggle between the Mail page and the Code Browser page.
  This fails when no kernel tree is configured.
- `Enter`:
  Act on the current selection.
  On the Mail page it opens the selected mailbox or thread.
  On the Code Browser tree it expands,
  collapses,
  or selects the current row.
- `Esc`:
  Show the reminder to use the command palette.
- `q`:
  Does not exit from the main page.
  CRIEW tells you to use the command palette instead.
- `Ctrl+C`:
  Does not exit from the main page.
  CRIEW tells you to use the command palette instead.

### Main navigation by `ui.keymap`

- `ui.keymap = "default"`:
  `j` and `l` move focus between panes.
  `i` and `k` move inside the focused pane.
  `count+i` and `count+k` repeat vertical movement.
- `ui.keymap = "vim"`:
  `h` and `l` move focus between panes.
  `j` and `k` move inside the focused pane.
  `count+j` and `count+k` repeat vertical movement.
  `gg` jumps to the top of the active pane.
  `G` jumps to the bottom.
  `qq` exits quickly.
- `ui.keymap = "custom"`:
  The active bindings come from `ui.keymap_base`
  plus any overrides from `[ui.custom_keymap]`.
  Open `:keymap` to inspect or change them from the TUI.

The same navigation layer is reused on both top-level pages:

- Mail page:
  focus moves between `Subscriptions`,
  `Threads`,
  and `Preview`.
- Code Browser page:
  focus moves between `Tree` and `Source`.

## Mail page

### Suggested image slot

- Suggested file:
  `images/keybindings-mail-page.png`
- Suggested capture:
  Three-pane mail layout with one subscription selected,
  one thread selected,
  and preview content visible.

### Mail workflow keys

- `/`:
  Open thread search.
  Search is available only on the Mail page.
- `y`:
  Enable the selected subscription.
  Works only when `Subscriptions` has focus.
- `n`:
  Disable the selected subscription.
  Works only when `Subscriptions` has focus.
- `Enter` on `Subscriptions`:
  Open the selected mailbox.
- `Enter` on `Threads`:
  Select the current thread and move focus to `Preview`.
- `-`:
  Select the previous thread while `Preview` keeps focus.
- `=` or `+`:
  Select the next thread while `Preview` keeps focus.
- `e`:
  Open the reply panel when `Preview` has focus.
- `r`:
  Open the reply panel from anywhere on the Mail page.
- `[`:
  Expand the focused mail pane to the left.
- `]`:
  Expand the focused mail pane to the right.
- `{`:
  Shrink the focused mail pane toward the left.
- `}`:
  Shrink the focused mail pane toward the right.
  Pane widths are persisted in `ui-state.toml`.
- `a`:
  Apply the selected patch series.
  Works only when `Threads` has focus.
- `d`:
  Download or export the selected patch series.
  Works only when `Threads` has focus.
- `u`:
  Undo the last patch apply action.
  Works only when `Threads` has focus.

## Code Browser page

### Suggested image slot

- Suggested file:
  `images/keybindings-code-browser.png`
- Suggested capture:
  Tree pane on the left,
  source preview on the right,
  with one real source file selected.

### Code browser keys

- Main page navigation keys still apply here.
  They move between the tree and source panes,
  scroll source preview,
  and support count prefixes or `gg` and `G` when `ui.keymap = "vim"`.
- `Enter` on the tree pane:
  Expand or collapse directories.
  On files,
  keep the file selected and reset source scroll.
- `e` on the source pane:
  Enter the inline code editor.
- `E` on the source pane:
  Open the selected file in external `vim`.

## Command palette

### Suggested image slot

- Suggested file:
  `images/keybindings-command-palette.png`
- Suggested capture:
  Palette open with completion suggestions visible.

### Input keys

- `Esc`:
  Close the palette.
- `Enter`:
  Run the current command.
- `Backspace`:
  Delete one character.
- `Tab`:
  Apply completion.
  A second `Tab` can expand or show the current completion set.
- `F1` or `Ctrl+backtick`:
  Toggle the palette closed again.

### Built-in commands

- `quit` or `exit`:
  Exit CRIEW.
- `restart`:
  Restart the TUI with current startup config.
- `help`:
  Show the built-in command summary.
- `sync`:
  Sync all enabled mailboxes,
  or the current default mailbox when nothing is enabled.
- `sync <mailbox>`:
  Sync one mailbox immediately.
- `config show`:
  Open the visual config editor.
- `keymap`:
  Open the visual keymap editor.
- `config show <key>`:
  Show the file value or effective runtime fallback for one key.
- `config get <key>`:
  Read one config key.
- `config edit [key]`:
  Open the config editor,
  optionally focused on one supported field.
- `config set <key> <value>`:
  Write a TOML value into the config file and reload runtime config.
- `config help`:
  Show config command usage.
- `vim`:
  Open the selected source file in external `vim`.
- `!<shell command>`:
  Run a local shell command.
  CRIEW uses the configured kernel tree as the working directory when one is
  available,
  otherwise it falls back to `HOME`.

## Search

### Suggested image slot

- Suggested file:
  `images/keybindings-search.png`
- Suggested capture:
  Mail page with the search input active and filtered thread results visible.

### Search keys

- `/`:
  Open search on the Mail page.
- `Enter`:
  Apply the current query.
- `Backspace`:
  Delete one character.
- `Esc`:
  Cancel search without applying the current edit.
- Any printable character:
  Append to the current query.

## Config editor

### Suggested image slot

- Suggested file:
  `images/keybindings-config-editor.png`
- Suggested capture:
  Left-side key list,
  right-side field details,
  and one field selected.

### Browse mode

- `Up` or `i`:
  Move to the previous editable field.
- `Down` or `k`:
  Move to the next editable field.
- `Enter` or `e`:
  Start editing the selected field.
- `Tab`:
  Cycle through preset values for the selected field.
- `x`:
  Unset the selected key from the config file.
- `Esc`:
  Close the config editor.

### Edit mode

- Any printable character:
  Append to the current TOML literal.
- `Backspace`:
  Delete one character.
- `Tab`:
  Cycle preset values for the selected field.
- `Enter`:
  Save the current value.
- `Esc`:
  Cancel the edit and return to browse mode.

## Reply panel

### Suggested image slot

- Suggested file:
  `images/keybindings-reply-panel.png`
- Suggested capture:
  Reply panel with editable headers and the body guide line visible.

### Normal mode

- `h`:
  Move the cursor left.
- `l`:
  Move the cursor right.
- `j` or `Down`:
  Move to the next header field or the next body line.
- `k` or `Up`:
  Move to the previous header field or the previous body line.
- `i`:
  Enter insert mode.
- `Enter` or `o`:
  Open a line below and enter insert mode.
- `x`:
  Delete the character under the cursor.
- `p`:
  Open Send Preview.
- `s`:
  Attempt to send.
  CRIEW still requires a confirmed Send Preview before it will actually send.
- `:`:
  Enter reply command mode.
- `Esc`:
  Close the reply panel when the draft is clean.
  If the draft is dirty,
  CRIEW tells you to use `:q!` to discard it.

### Insert mode

- Any printable character:
  Insert at the cursor.
- `Backspace`:
  Delete backward.
- `Enter`:
  Insert a newline.
- `Tab`:
  Insert four spaces.
- `Esc`:
  Return to reply normal mode.

### Command mode

- Any printable character:
  Append to the command line.
- `Backspace`:
  Delete one character.
- `Enter`:
  Run the current command.
- `Esc`:
  Cancel command mode.

Supported reply commands are:

- `:q`
  Close the reply panel only when the draft is clean.
- `:q!`
  Discard the reply draft.
- `:preview`
  Open Send Preview.
- `:send`
  Attempt to send the reply.

## Send Preview and reply notices

### Suggested image slot

- Suggested file:
  `images/keybindings-send-preview.png`
- Suggested capture:
  Send Preview dialog with warning or confirmation text visible.

### Send Preview keys

- `Enter` or `c`:
  Confirm the current preview.
- `s`:
  Attempt to send.
  If preview confirmation is still missing,
  CRIEW opens a blocked-send notice instead.
- `j` or `Down`:
  Scroll preview down.
- `k` or `Up`:
  Scroll preview up.
- `Esc`:
  Close Send Preview and return to the reply editor.

### Reply notice keys

- `Esc` or `Enter`:
  Close the current notice.
- `p`:
  Reopen Send Preview when the notice asks for preview confirmation first.
- `s`:
  Send when the notice says preview confirmation already succeeded.

## Inline code editor

### Suggested image slot

- Suggested file:
  `images/keybindings-inline-code-editor.png`
- Suggested capture:
  Source pane in inline edit mode with cursor and command hint visible.

### Entry conditions

- Start from the Code Browser page.
- Move focus to the `Source` pane.
- Press `e` for inline editing or `E` for external `vim`.

### Normal mode

- `h`:
  Move cursor left.
- `j`:
  Move cursor down.
- `k`:
  Move cursor up.
- `l`:
  Move cursor right.
- `i`:
  Enter insert mode.
- `x`:
  Delete the character under the cursor.
- `s`:
  Save the current buffer.
- `E`:
  Open external `vim`.
- `:`:
  Enter command mode.
- `Esc`:
  Exit edit mode only when the buffer is clean.
  If there are unsaved changes,
  CRIEW tells you to use `:w`,
  `:wq`,
  or `:q!`.

### Insert mode

- Any printable character:
  Insert at the cursor.
- `Backspace`:
  Delete backward or join with the previous line.
- `Enter`:
  Insert a newline.
- `Tab`:
  Insert four spaces.
- `Esc`:
  Return to normal mode.

### Command mode

- Any printable character:
  Append to the command line.
- `Backspace`:
  Delete one character.
- `Enter`:
  Run the current command.
- `Esc`:
  Cancel command mode.

Supported inline editor commands are:

- `:w`
  Save the current file.
- `:q`
  Exit only when the buffer is clean.
- `:q!`
  Discard unsaved changes and exit inline edit mode.
- `:wq`
  Save and exit.
- `:vim`
  Open the same file in external `vim`.

## See also

- [Configuration]Configuration.md
- [Sync and TUI]Sync-and-TUI.md
- [Patch and Reply]Patch-and-Reply.md