projmux 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/agent-workflow.md +19 -14
- package/docs/architecture.md +2 -2
- package/docs/cli.md +147 -51
- package/docs/configuration.md +4 -3
- package/docs/globalization.md +1 -1
- package/docs/keybindings.md +5 -2
- package/docs/native-picker.md +103 -0
- package/docs/operational-diagnostics.md +47 -6
- package/docs/pr-guideline.md +1 -1
- package/docs/resource-attribution.md +61 -4
- package/docs/settings-ia.md +2 -2
- package/docs/statusbar.md +16 -5
- package/docs/tmux-surface-inventory.md +0 -1
- package/docs/upgrading.md +21 -0
- package/docs/usage-tracking.md +63 -19
- package/package.json +5 -5
- package/docs/native-picker-no-fzf-poc.md +0 -227
- package/docs/native-picker-parity.md +0 -155
- package/docs/picker-ui-plan.md +0 -91
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
# Native Picker Engine
|
|
2
|
-
|
|
3
|
-
This note tracks the native picker engine. Native is the only picker backend.
|
|
4
|
-
|
|
5
|
-
The fzf compatibility surface for the native engine is tracked in
|
|
6
|
-
[native-picker-parity.md](native-picker-parity.md).
|
|
7
|
-
|
|
8
|
-
## What This Covers
|
|
9
|
-
|
|
10
|
-
- `internal/ui/picker` is the backend-neutral contract for native picker rows,
|
|
11
|
-
actions, filtering, and typed-query prompts.
|
|
12
|
-
- `internal/ui/projmuxpicker` is the projmux-specific native picker surface for
|
|
13
|
-
frame, redraw updates, theme tokens, ANSI width/truncation,
|
|
14
|
-
prompt/footer/list rendering, and preview pane layout. The POC keeps `picker`
|
|
15
|
-
responsible for backend routing, keyboard input, filtering, preview command
|
|
16
|
-
execution, and result contracts, while moving visual composition into
|
|
17
|
-
`projmuxpicker` so projmux can evolve a native picker design without coupling
|
|
18
|
-
every visual tweak to the compatibility option/result shape.
|
|
19
|
-
Built-in fallback colors are centralized as semantic tokens in
|
|
20
|
-
`internal/theme/palette.go`; see [theme-palette.md](theme-palette.md) for the
|
|
21
|
-
current inventory and truecolor to tmux 256-color mapping policy.
|
|
22
|
-
- `internal/ui/pickercompat` remains an internal compatibility mapper between
|
|
23
|
-
the old option/result shape and the backend-neutral `picker.Options`
|
|
24
|
-
contract. It is not a runtime backend. App code should
|
|
25
|
-
describe picker intent as rows, actions, preview commands, and initial focus,
|
|
26
|
-
then route through the native picker.
|
|
27
|
-
- Settings > Labs remains available for Live system resources and Project
|
|
28
|
-
Hooks, but picker backend/source information has been retired.
|
|
29
|
-
- Picker flows covered by the native path include AI picker/settings, shell
|
|
30
|
-
update prompt, settings hub sections, switch settings/add-pin, the main
|
|
31
|
-
project switcher list, recent sessions, and notify sidebar.
|
|
32
|
-
- The native picker supports ranked fuzzy search/filter, arrow-key selection in
|
|
33
|
-
normal CSI and tmux application-cursor modes, Enter, Esc, Ctrl-C, Backspace,
|
|
34
|
-
Ctrl-U, Ctrl-W, PageUp/PageDown, Home/End, modified CSI keys, custom expect
|
|
35
|
-
keys such as Ctrl-X/Alt-P, printable expect keys such as notify `a`/`x`, control
|
|
36
|
-
expect keys such as notify `Ctrl-X`, `start:pos(N)` initial focus, preview
|
|
37
|
-
command output, preview cycle command bindings, and sidebar focus command
|
|
38
|
-
bindings.
|
|
39
|
-
- FZF-style movement keys are supported for native selection: `Ctrl-N` and
|
|
40
|
-
`Ctrl-J` move down, while `Ctrl-P` and `Ctrl-K` move up unless the app claims
|
|
41
|
-
the key as a custom action. Up/down-family movement wraps at list boundaries;
|
|
42
|
-
PageUp/PageDown and Home/End remain clamped or explicit jumps.
|
|
43
|
-
- Typed-query prompts support cursor-aware insertion/deletion with a visible
|
|
44
|
-
prompt cursor, Left/Right, Ctrl-A/E, Delete, Backspace, Ctrl-U, and Ctrl-W
|
|
45
|
-
for settings path entry.
|
|
46
|
-
- The native key parser keeps legacy parser-fixture coverage for app-specific
|
|
47
|
-
modified-key escapes, plus generic modified forms such as `ESC [ 115 ; 7 u`
|
|
48
|
-
for `Ctrl-Alt-S`. This is backend parser parity, not a product fallback
|
|
49
|
-
route.
|
|
50
|
-
- Native interactive picker screens use an alternate screen lifecycle to better
|
|
51
|
-
match fzf fullscreen behavior and restore the tmux pane after exit. Frame
|
|
52
|
-
updates and screen exit both return to column 0 before emitting terminal
|
|
53
|
-
control sequences, and screen exit resets styles plus clears the alternate
|
|
54
|
-
buffer from the home cursor before restore. This keeps restore/update escapes
|
|
55
|
-
and selected-session handoff output from visually trailing the bottom border
|
|
56
|
-
in tmux/script captures. Native also gives real TTY screen restore a short
|
|
57
|
-
settle window before returning to callers that may immediately draw a tmux
|
|
58
|
-
session.
|
|
59
|
-
- Native interactive picker screens render inside a full-screen border frame to
|
|
60
|
-
match the app's fzf `--height 100% --border` surface more closely.
|
|
61
|
-
- Popup-toggle commands use tmux `display-popup -B` when the native backend is
|
|
62
|
-
active so the native picker owns the visible frame and does not double-draw
|
|
63
|
-
with tmux's outer popup border.
|
|
64
|
-
- Native Alt-1 sidebar popups use the same responsive width calculation as fzf
|
|
65
|
-
with a smaller native-only minimum, so the borderless native frame is not
|
|
66
|
-
wider than the existing fzf sidebar surface on normal terminals.
|
|
67
|
-
- Native Alt-2 notify sidebar popups keep the fzf baseline width contract
|
|
68
|
-
(`24%`, minimum `64`) while still letting the native picker own the frame.
|
|
69
|
-
- Native sidebar popups reserve two rows at the bottom for the tmux statusbar
|
|
70
|
-
area instead of using the full client height.
|
|
71
|
-
- Simple native lists use the available terminal height after header, prompt,
|
|
72
|
-
footer, and preview reservations instead of a fixed page-sized viewport.
|
|
73
|
-
- Navigation-only native lists mirror fzf `--disabled --no-input`: the input
|
|
74
|
-
prompt is hidden, printable non-action keys do not alter the query, and
|
|
75
|
-
expect/action keys still work.
|
|
76
|
-
- Native frame content now uses the full inner border width so prompt/list/footer
|
|
77
|
-
separators reach the right border like fzf.
|
|
78
|
-
- Native frames can render an optional picker-owned titlebar row below the top
|
|
79
|
-
border when `picker.Options.Title` is set; empty titles keep the default frame
|
|
80
|
-
unchanged. Non-empty titles use a distinct neutral titlebar surface with rule
|
|
81
|
-
fill and a divider row separating the title section from the search/content
|
|
82
|
-
section. The native Alt-1 project sidebar uses this for a
|
|
83
|
-
`Projects` titlebar.
|
|
84
|
-
- Native width/truncation uses terminal cell width for Korean/CJK text, emoji,
|
|
85
|
-
and combining marks instead of raw rune count, so localized project names and
|
|
86
|
-
decorated notify headers do not push the right frame border out of alignment.
|
|
87
|
-
- Searchable native pickers draw an explicit `Search` label and a muted
|
|
88
|
-
separator under the prompt/count line so the query area reads as distinct
|
|
89
|
-
chrome rather than the first row of the list. Footer, down-preview, and
|
|
90
|
-
multi-line card gaps share the same `projmuxpicker` separator primitive for a
|
|
91
|
-
more consistent native surface.
|
|
92
|
-
- Native interactive mode enables SGR mouse reporting while the alternate screen
|
|
93
|
-
is active. Primary mouse down focuses the row under the cursor, primary mouse
|
|
94
|
-
up applies it, mouse wheel moves selection up/down, and reporting is disabled
|
|
95
|
-
again during screen restore.
|
|
96
|
-
- When terminal size detection is unavailable, native picker falls back to a
|
|
97
|
-
conservative 80x24 terminal instead of assuming a wider surface. Interactive
|
|
98
|
-
tmux popups still use the detected popup size when `stty size` is available.
|
|
99
|
-
- Simple and multi-line native rows share the same projmux current-row style and
|
|
100
|
-
pointer marker rather than falling back to terminal inverse video for simple
|
|
101
|
-
pickers.
|
|
102
|
-
- Selected multi-line rows use the same pointer-width `▌` continuation marker
|
|
103
|
-
as the first selected project line, so switch/session/notify cards read as one
|
|
104
|
-
focused block.
|
|
105
|
-
- Pointer and continuation markers render inside the current-row gutter style so
|
|
106
|
-
selected cards do not visually break between the marker and row content.
|
|
107
|
-
- Native redraws use terminal synchronized-update wrappers and coalesced
|
|
108
|
-
row-diff updates after the first frame. The frame/redraw renderer lives in
|
|
109
|
-
`projmuxpicker` rather than the backend loop, skips unchanged frames, and
|
|
110
|
-
avoids a trailing newline after the bottom border. This reduces visible
|
|
111
|
-
keyboard-navigation flicker and prevents exact-height popups from scrolling
|
|
112
|
-
the top border off screen.
|
|
113
|
-
- Native preview panes normalize tabs and control bytes before horizontal
|
|
114
|
-
clipping, preventing long preview rows from wrapping and consuming extra
|
|
115
|
-
vertical viewport rows in session popups.
|
|
116
|
-
- Native sidebar list scrollbars use the fixed list viewport as their track and
|
|
117
|
-
measure multi-line cards in rendered rows, so the thumb does not shrink or
|
|
118
|
-
jump when card heights vary.
|
|
119
|
-
- Switch picker git branch badges are capped more tightly for the native card
|
|
120
|
-
surface, so inactive branch backgrounds do not dominate narrow Alt-1 sidebar
|
|
121
|
-
rows.
|
|
122
|
-
- Native selection changes render their frame diff before running sidebar focus
|
|
123
|
-
commands, so tmux focus/switch side effects do not delay the visible picker
|
|
124
|
-
movement.
|
|
125
|
-
- In app TTY contexts, the native picker opens the controlling terminal
|
|
126
|
-
(`/dev/tty`) before entering raw mode. This avoids stdin/stdout mismatch and
|
|
127
|
-
line-mode escape leakage such as arrow keys appearing as `^[[`.
|
|
128
|
-
- Raw TTY reads keep polling briefly across empty reads while decoding
|
|
129
|
-
escape-key sequences, so split arrow/Alt key bytes are consumed by the picker
|
|
130
|
-
instead of leaking into the query or parent shell.
|
|
131
|
-
|
|
132
|
-
## Experimental Boundaries
|
|
133
|
-
|
|
134
|
-
- The `projmuxpicker` package is intended as a foundation that can be carried
|
|
135
|
-
forward, along with the compatibility option/result mapping in
|
|
136
|
-
`internal/ui/pickercompat`.
|
|
137
|
-
Its frame, row, preview, theme, ANSI, and redraw modules are foundation code;
|
|
138
|
-
Docker sandbox scripts and dependency-policy notes remain support
|
|
139
|
-
scaffolding.
|
|
140
|
-
- Switch and sessions preview panes are native previews for the concrete
|
|
141
|
-
projmux option shapes. Wide right-side preview windows render beside the
|
|
142
|
-
list, and sidebar-style `down,25%,border-top` previews render below the list
|
|
143
|
-
without a synthetic preview title row, using fzf-measured percent sizing.
|
|
144
|
-
Preview rows are padded by `projmuxpicker` to the full preview surface width
|
|
145
|
-
before the outer frame is applied, which keeps split/down preview columns
|
|
146
|
-
visually stable during redraws.
|
|
147
|
-
The full fzf preview-window grammar remains outside this POC surface.
|
|
148
|
-
- Preview cycle state is covered in Docker e2e against real tmux sessions: the
|
|
149
|
-
switch and sessions popup flows type a filtered query, send `Right` and
|
|
150
|
-
`Alt-Down`, and assert the stored preview window/pane cursor for the selected
|
|
151
|
-
session.
|
|
152
|
-
- Public doctor dependency policy no longer includes an external picker binary.
|
|
153
|
-
|
|
154
|
-
## Interactive No-fzf Sandbox
|
|
155
|
-
|
|
156
|
-
Use this when you want to enter a Docker container and experience this build
|
|
157
|
-
directly without `fzf`. It builds the no-fzf dependency image, mounts this
|
|
158
|
-
worktree, builds `projmux` inside the container, creates sample projects under
|
|
159
|
-
`/workspace/projects`, stores the native picker backend in the sandbox config,
|
|
160
|
-
writes a tmux config with the same backend in the tmux server environment, and
|
|
161
|
-
launches `projmux shell`. It also forces UTF-8 locale inside the container. This
|
|
162
|
-
uses `wt path` instead of `wt run` because `docker run -it` needs the current
|
|
163
|
-
terminal TTY:
|
|
164
|
-
|
|
165
|
-
```sh
|
|
166
|
-
bash "$(wt path poc/native-picker-no-fzf)/scripts/poc-native-picker-no-fzf-sandbox.sh"
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
Inside the tmux shell, try:
|
|
170
|
-
|
|
171
|
-
```sh
|
|
172
|
-
projmux switch
|
|
173
|
-
projmux settings
|
|
174
|
-
projmux doctor --json
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Manual UX checks for the Docker sandbox:
|
|
178
|
-
|
|
179
|
-
- Alt-1 opens with the top border/title visible, not clipped.
|
|
180
|
-
- Vertical borders stay continuous while moving Up/Down.
|
|
181
|
-
- Alt-1 closes the sidebar immediately when pressed again.
|
|
182
|
-
- Alt-2, Alt-4, Alt-5, and Alt-7 open their matching native popups and close
|
|
183
|
-
on the same Alt key immediately.
|
|
184
|
-
- Alt-3 opens Recent Windows.
|
|
185
|
-
- Arrow keys move selection without leaking `^[[` text into the query.
|
|
186
|
-
|
|
187
|
-
`fzf` is intentionally not installed in the image.
|
|
188
|
-
|
|
189
|
-
## Automated No-fzf Docker E2E Command
|
|
190
|
-
|
|
191
|
-
Run this from the repository root. It builds a Go 1.25 Trixie no-fzf
|
|
192
|
-
dependency image from `test/docker/no-fzf-poc.Dockerfile`, including Go module
|
|
193
|
-
cache, then mounts the repository into an isolated `--network none` container,
|
|
194
|
-
builds `projmux`, asserts `fzf` is not on `PATH`, runs the focused native-picker
|
|
195
|
-
tests, opens Settings > Labs with legacy `fzf` env/file values, verifies native
|
|
196
|
-
operation without a Labs picker-source row or config rewrite, exercises `projmux switch --ui=sidebar`
|
|
197
|
-
search/selection under a container PTY,
|
|
198
|
-
exercises `projmux switch --ui=popup` and `projmux sessions --ui=popup` against
|
|
199
|
-
existing tmux sessions under a wide 150x30 PTY, sends `Right` and `Alt-Down`
|
|
200
|
-
once to smoke the preview-cycle bindings, asserts those popup flows stay on the
|
|
201
|
-
right-side preview layout instead of falling back to inline preview, asserts the
|
|
202
|
-
explicit `Search` chrome across the searchable native picker surfaces, launches
|
|
203
|
-
`projmux shell` under a container PTY, verifies
|
|
204
|
-
that it creates a tmux session, verifies immediate launch-key close behavior for
|
|
205
|
-
Alt-1 through Alt-5 native popup surfaces, exercises `notify list --ui=sidebar`
|
|
206
|
-
with the printable `x` expect key, and exercises the settings picker under a PTY
|
|
207
|
-
using Enter and arrow-key navigation through the native backend. Settings flows
|
|
208
|
-
must keep stderr clean in the no-tmux-server container; tmux no-server noise is
|
|
209
|
-
treated as an e2e failure.
|
|
210
|
-
|
|
211
|
-
Short tmux-friendly form:
|
|
212
|
-
|
|
213
|
-
```sh
|
|
214
|
-
wt run poc/native-picker-no-fzf -- scripts/poc-native-picker-no-fzf-e2e.sh
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
The script contains the Docker image build and isolated `docker run` command:
|
|
218
|
-
|
|
219
|
-
```sh
|
|
220
|
-
scripts/poc-native-picker-no-fzf-e2e.sh
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
To compare another base image without editing the repo, override the build arg:
|
|
224
|
-
|
|
225
|
-
```sh
|
|
226
|
-
PROJMUX_POC_NO_FZF_BASE_IMAGE=golang:1.24-bookworm bash "$(wt path poc/native-picker-no-fzf)/scripts/poc-native-picker-no-fzf-sandbox.sh"
|
|
227
|
-
```
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
# Native Picker fzf Parity Map
|
|
2
|
-
|
|
3
|
-
This audit note reverse-engineers the subset of fzf behavior that projmux
|
|
4
|
-
currently uses and maps it to native picker evidence. It supports the default
|
|
5
|
-
native picker engine and is not a public dependency-policy change.
|
|
6
|
-
|
|
7
|
-
## App fzf Surface
|
|
8
|
-
|
|
9
|
-
| fzf surface | projmux usage | Native status | Evidence |
|
|
10
|
-
| --- | --- | --- | --- |
|
|
11
|
-
| `--prompt` | AI, settings, shell update, switch, sessions, notify | Covered | `renderNativeInteractive`, `renderNative`; `TestNativePromptLineIncludesInlineMatchCount` |
|
|
12
|
-
| prompt/list separation | native searchable picker chrome | Covered | native renders an explicit `Search` header label plus a separator under searchable prompt/count lines; `TestNativeInteractiveSeparatesSearchHeaderFromList`; Docker no-fzf e2e asserts the `Search` header in Settings, AI settings, mouse-click, switch sidebar, switch popup, sessions popup, and shell Alt-1 PTY logs |
|
|
13
|
-
| `--height 100%` / `--border` | all interactive picker screens | Covered for fullscreen rounded border frame | `renderNativeFrame`; screen-height list budgeting; conservative 80x24 fallback only when terminal size detection is unavailable; `TestNativeInteractiveRendersBorderFrame`; `TestNativeInteractiveUsesAvailableHeightForSimpleLists` |
|
|
14
|
-
| `--header` | AI, settings, shell update, notify | Covered | `renderNativeInteractive`, `renderNative`; settings native tests |
|
|
15
|
-
| `--footer` / `--footer-border line` | AI, settings, shell update, switch, sessions, notify | Covered for interactive native screens | `renderNativeInteractive` reserves bottom footer space and renders a separator line; `TestNativeInteractiveRendersFooterAtBottom` |
|
|
16
|
-
| `--ansi` | colored row labels from render package | Covered | native writes row labels directly, strips ANSI escapes from default search text, restores selected-row styling after embedded ANSI resets, and measures rendered cell width for Korean/CJK text, emoji, and combining marks; `TestFilterItemsIgnoresANSIEscapeSequences`; `TestNativeInteractiveUsesCurrentStyleForSimpleSelection`; `TestVisibleLenUsesTerminalCellWidth`; Docker e2e shows ANSI rows |
|
|
17
|
-
| hidden value after tab delimiter | all picker selections and default fzf matching | Covered by `picker.Item.Value` and default search text | `pickercompat.PickerOptions`; `TestNativeRunnerFiltersAndSelectsByNumber`; `TestFilterItemsSearchesHiddenValueWhenNoSearchKey` |
|
|
18
|
-
| plain fzf candidates without structured entries | compat option call shape | Covered | `pickercompat.PickerOptions`; `TestPickerOptionsFromCompatPickerMapsCandidatesWhenEntriesAreEmpty` |
|
|
19
|
-
| search key filtering (`--nth`/reload filter file) | switch/sessions/notify entries | Covered by `Item.SearchText` with fzf reload order preservation | `FilterItems`; `TestFilterItemsUsesSearchTextNotMetadata`; `TestFilterItemsPreservesSearchKeyOrder` |
|
|
20
|
-
| default `--smart-case` matching | all searchable picker rows | Covered | native filter keeps lower-case queries case-insensitive and uppercase queries case-sensitive; `TestFilterItemsUsesFZFSmartCase` |
|
|
21
|
-
| fzf match highlighting | searchable simple picker rows | Covered for non-search-key simple rows | native highlights matched visible label runes while preserving embedded ANSI style; search-key reload lists intentionally keep fzf disabled-filter rendering without match highlights; `TestNativeInteractiveHighlightsSimpleQueryMatches`; `TestNativeInteractiveDoesNotHighlightSearchKeyReloadLists` |
|
|
22
|
-
| `--disabled --no-input` | navigation-only notify sidebar | Covered | native suppresses prompt/query editing and ignores printable non-action input; `TestNativeInteractiveDisableSearchIgnoresPrintableInput`; Docker no-fzf e2e asserts notify prompt is hidden |
|
|
23
|
-
| fuzzy result ranking | simple non-search-key picker UX | Covered with fzf V2 dynamic scoring for normal app rows | `fuzzyScore`; `TestFilterItemsRanksBetterMatchesFirst`; `TestFilterItemsPrefersFZFBoundaryAndCamelCaseMatches`; `TestFuzzyScoreMatchesFZFV2ReferenceScores` |
|
|
24
|
-
| `--scrollbar █` | long switch/session/settings lists | Covered for app lists | `nativeListLinesWithScrollbarRows`; proportional multi-row thumb rendering in `projmuxpicker`; split-preview and sidebar list viewports keep a fixed row budget and scrollbar track; multi-line cards use rendered-row scroll units; `TestNativeInteractiveUsesScrollbarForLongLists`; `TestListLinesWithScrollbarUsesProportionalThumb`; `TestListLinesWithScrollbarMovesThumbGradually`; `TestListLinesWithScrollbarRowsKeepsViewportTrack`; `TestRenderSplitPreviewRowsKeepsRequestedViewport`; `TestNativeListScrollbarUnitsUseRenderedRowsForMultiline`; `TestNativeInteractiveKeepsMultilineScrollbarOnViewportTrack` |
|
|
25
|
-
| `--read0` multi-line rows | switch, sessions, notify | Covered | `Options.MultiLine`; `TestNativeInteractiveRendersFZFLikeMultilineSelection` |
|
|
26
|
-
| `--gap --gap-line ─` | switch, sessions, notify multi-line rows | Covered for app multiline rows | `nativeGapLine`, row-budgeted range; `TestNativeInteractiveRendersMultilineGapLine`, `TestNativeVisibleRangeCountsMultilineRenderedRows` |
|
|
27
|
-
| selected multi-line marker | selected switch/session/notify cards | Covered for app multiline rows | native uses the same compact pointer-width red `▌` gutter as the first selected project line, and metadata lines align to the project-name column without the old deeper indent; `nativeContinuation`; `TestNativeInteractiveRendersSelectedMultilineContinuationMarker`; `TestInteractiveRowLinesUsesCompactSelectedMetaIndent`; `TestInteractiveRowLinesAlignsUnselectedMetaWithProjectName` |
|
|
28
|
-
| fzf current row colors | simple and multi-line rows | Covered for app rows | `nativeCurrentStart`, `nativePointer`; pointer/continuation gutter tokens carry the current-row background; `TestNativeSelectedContentKeepsCurrentStyleAfterReset`; `TestNativeInteractiveUsesCurrentStyleForSimpleSelection` |
|
|
29
|
-
| `--expect` keys | Enter/Ctrl-X/Alt-P/notify keys | Covered | `pickercompat.PickerOptions`; `TestNativeInteractiveSupportsCustomExpectKeys` |
|
|
30
|
-
| printable expect keys | notify sidebar `a` ack and `x` non-critical clear | Covered | `TestNativeInteractiveSupportsPrintableExpectKeys`; Docker no-fzf e2e |
|
|
31
|
-
| control expect keys | notify sidebar `Ctrl-X`, settings `Ctrl-Alt-S` close | Covered | `TestNativeInteractiveSupportsControlExpectKeys`; `TestNativeInteractiveSupportsControlAltCloseKeys` |
|
|
32
|
-
| close `--bind key:abort` | Esc, Ctrl-C, Alt-N, Ctrl-Alt-S variants | Covered | `CloseActions`; `TestNativeRunnerUsesSharedCloseActions` |
|
|
33
|
-
| terminal modified-key encoding | legacy parser fixtures, Ghostty/kitty-style modified keys | Covered | native handles app-specific parser fixtures, generic modified letters/digits, and non-text keys such as Enter/Esc/Backspace/Tab; this is backend parity, not product fallback guidance; `TestNativeInteractiveSupportsCSIuAppKeyBindings` |
|
|
34
|
-
| `execute-silent(...)+refresh-preview` | switch/session preview cycling | Covered for command execution and rerender loop | `pickercompat.PickerOptions`/`pickercompat.OptionsFromPicker`; `TestNativeInteractiveRunsCustomActionCommandAndRefreshes`; `TestPickerOptionsMapsCompatBindingsToContractActions`; Docker no-fzf e2e sends `Right` and `Alt-Down` before selection |
|
|
35
|
-
| action-local/event-backed mutable refresh | notify sidebar `a` ack and `x` non-critical clear; notify sidebar queue-write event refresh; switch sidebar `Ctrl-X` kill | Covered for in-session row/live-state refresh without picker restart | `picker.Action.Mutate` returns a `DeferredUpdate`, notify queue-write events trigger the same `DeferredUpdate` path after an event arrives, and both reuse the native frame diff renderer plus value-then-clamp selection preservation; `TestNativeInteractiveCustomActionMutatesItemsAndRefreshes`; `TestNativeInteractiveCustomActionRefreshPreservesSelectedValue`; `TestNativeInteractiveDeferredUpdateTriggerRefreshesRepeatedly`; notify sidebar app tests assert one picker invocation with refreshed rows/live state and event subscription; switch sidebar kill app tests assert one native picker invocation with refreshed rows/preview and previous-live-session guard preservation |
|
|
36
|
-
| `focus:execute-silent(...)` | switch sidebar focus | Covered | native renders the selection frame diff before running sidebar focus commands so movement stays visible before tmux focus side effects; `runNativeFocusAction`; `TestNativeInteractiveRunsFocusActionOnSelectionChange` |
|
|
37
|
-
| `start:pos(N)` | switch sidebar initial row | Covered | `pickercompat.PickerOptions`/`pickercompat.OptionsFromPicker`; `TestPickerOptionsFromCompatPickerMapsStartPosToInitialIndex`; `TestPickerOptionsMapsCompatBindingsToContractActions` |
|
|
38
|
-
| `--preview` | switch, sessions | Covered by command output | `nativePreviewLines`; `TestNativeInteractiveRendersSelectedPreview` |
|
|
39
|
-
| `--preview-window right,60%,border-left` | switch popup, sessions popup | Covered for projmux option shape | `renderNativeSplitPreview` renders a single-column left border without a synthetic title row, uses fzf-measured percent sizing, normalizes preview tabs/control bytes before clipping, and pads both panes to fixed row widths so long preview rows do not wrap into extra vertical rows; `TestNativeInteractiveRendersWidePreviewBesideList`; `TestNativePreviewWidthUsesPreviewWindowPercent`; `TestRenderSplitPreviewRowsPadsBothPanes`; `TestRenderSplitPreviewRowsNormalizesPreviewTabsBeforeTruncating` |
|
|
40
|
-
| `--preview-window down,25%,border-top` | switch sidebar | Covered for projmux option shape | `renderNativeDownPreview` renders an immediate top border without a synthetic title row, uses fzf-measured percent sizing, and pads preview rows to the surface width; `TestNativeInteractiveRendersDownPreviewBelowList`; `TestNativePreviewHeightUsesPreviewWindowPercent`; `TestRenderDownPreviewPadsPreviewRows` |
|
|
41
|
-
| preview scrolling | long switch/session preview output | Covered for keyboard preview scroll | `previewOffset`; `TestNativeInteractiveRendersPreviewOffset` |
|
|
42
|
-
| `--query` | typed settings path defaults | Covered | `Options.InitialQuery`; settings tests |
|
|
43
|
-
| `--print-query` accept-query mode | typed settings path prompts | Covered | `Options.AcceptQuery`; `TestNativeRunnerAcceptsTypedQuery` |
|
|
44
|
-
| query cursor editing | typed settings path prompts | Covered | Left/Right, Ctrl-A/E, Delete, Backspace, Ctrl-U/W query editing plus visible prompt cursor; `TestNativeInteractiveEditsTypedQueryAtCursor`; `TestNativeInteractiveSupportsQueryLineEditingKeys`; `TestNativeInteractiveCtrlUDeletesBeforeCursor`; `TestNativePromptLineRendersQueryCursor` |
|
|
45
|
-
| terminal arrow key variants | interactive selection in tmux/docker | Covered | CSI, SS3/application cursor, modified CSI tests; up/down movement wraps at list boundaries while PageUp/PageDown and Home/End remain clamped or explicit jumps; app TTY `/dev/tty` fallback; raw TTY EOF polling keeps split ESC sequences from leaking into the query; `TestNativeInteractiveWrapsPreviousNavigationKeys`; `TestNativeInteractiveWrapsNextNavigationKeys`; `TestNativeInteractiveJumpNavigationRemainsClamped` |
|
|
46
|
-
| mouse support | optional fzf mouse picker interaction | Partially covered | native enables SGR mouse reporting in interactive alternate-screen mode, primary mouse down focuses the clicked row, primary mouse up applies it, and wheel input moves selection; drag gestures remain outside this POC; `TestNativeInteractiveSelectsOnMouseRelease`; `TestNativeInteractiveMouseDownOnlyFocuses`; `TestNativeInteractiveIgnoresMouseReleaseBeforeDown`; `TestNativeInteractiveSupportsMouseWheelSelection`; Docker no-fzf e2e clicks the AI settings row under a PTY |
|
|
47
|
-
| fzf navigation keys | interactive selection in searchable lists | Covered | native maps modified-key `Ctrl-J` plus `Ctrl-N` to down and `Ctrl-P`/`Ctrl-K` to up when not claimed by a custom action; up/down-family movement is safe on empty lists; raw LF remains Enter for PTY compatibility; `TestNativeInteractiveSupportsFZFNavigationKeys`; `TestNativeInteractiveNavigationKeysAreNoopForEmptyList` |
|
|
48
|
-
| alternate-screen lifecycle | fzf fullscreen picker screen restore | Covered | native frame updates and screen exit return to column 0 before terminal control sequences, screen exit resets styles plus clears the alternate buffer from the home cursor before restore, and real TTY restores get a short settle window before caller handoff; `nativeScreenEnter`; `TestNativeInteractiveUsesAlternateScreen`; `TestRenderFullFrameUpdateAlwaysHomesAndWritesFrame` |
|
|
49
|
-
| frame content width | fzf border inner width | Covered | `ContentLayout` uses the frame inner width so separators and rows reach the right border; `TestRendererContentLayoutUsesFrameInnerWidth` |
|
|
50
|
-
| picker-owned app background | native picker frame interior | Covered for renderer-owned cells | `ThemeFromEffective` applies built-in fallback and explicit effective `surface` / `chrome_foreground` SGR to the native frame, and frame rows resume the app style after embedded resets so content padding, empty no-footer rows, footer rows, scrollbars, and preview gaps do not leak terminal default background; `TestThemeFromEffectiveFallbackPaintsFrameBackground`; `TestRendererFrameBackgroundResumesAfterContentResetBeforePadding`; `TestNativeInteractiveNoFooterBlankRowsUseThemeBackground`; `TestNativeInteractiveSplitPreviewGapsUseThemeBackground`; `TestNativeInteractiveSettingsAIBadgeStyleLongPreviewClampsFrameRows` |
|
|
51
|
-
| tmux popup frame interaction | native picker popups launched through `popup-toggle` | Covered for native backend popups | `popup-toggle` passes tmux `display-popup -B` when `PROJMUX_PICKER_BACKEND=native`, so the native picker owns the visible frame instead of double-drawing with the tmux popup border; tmux 3.4 per-command `display-popup -s` is used for the popup body style, setting `bg` from `surface` and `fg` from `chrome_foreground` so tmux's blank/pre-draw popup body matches the native picker surface before the app renderer paints; no global `popup-style`, `popup-border-style`, shell pane background, `default-style`, `window-style`, OSC background, or status/window palette options are changed; native Alt-1 uses a compact native-only minimum while fzf keeps the previous project sidebar minimum; Alt-1/Alt-2 sidebar heights reserve two bottom statusbar rows; Alt-2 notify sidebar keeps the fzf-like `24%` / min `64` baseline; `TestAppRunTmuxPopupToggleUsesBorderlessPopupForNativeBackend`; `TestAppRunTmuxPopupToggleUsesNativePopupBodyStyleFromEffectiveTheme`; `TestBuildPopupToggleWithPickerBackendStylesNativeOnly`; `TestBuildDisplayPopupArgsAddsBodyStyle`; `TestSessionizerSidebarWidthKeepsFZFMinimum`; `TestSidebarPopupHeightLeavesStatusbarRows`; `TestNotifySidebarWidthMatchesFZFBaseline`; `TestAppRunTmuxPopupToggleKeepsNotifySidebarFZFSizingForNative` |
|
|
52
|
-
| optional native titlebar | native picker popup frame | Covered for empty-title compatibility and opt-in titles | `picker.Options.Title`; `RenderFrameWithTitle`; `ContentLayoutWithTitle`; empty titles keep the prior frame unchanged, non-empty titles render in a picker-owned section below the top border, titlebar text/divider/chip gaps inherit the frame `surface` / `chrome_foreground` instead of a separate titlebar overlay ANSI layer, and the native Alt-1 project sidebar opts into `Projects`; `TestRendererRenderFrameWithTitleKeepsDefaultWhenTitleEmpty`; `TestRendererRenderFrameWithTitleUsesTitlebarRow`; `TestRendererContentLayoutWithTitleReservesTitlebarRow`; `TestNativeInteractiveRendersOptionalTitlebar`; `TestSwitchCommandNativeSidebarSetsTitle` |
|
|
53
|
-
| redraw flicker/top clipping | keyboard navigation in exact-height tmux popup | Partially covered | native redraws use synchronized updates plus coalesced row diffs after the first frame, skip unchanged frames, render frame diffs before sidebar focus commands, frame rendering avoids trailing bottom-border CRLF, and screen exit clears the alternate buffer before restore; `TestNativeInteractiveWrapsRedrawsInSynchronizedUpdates`; `TestFrameUpdateRendererSkipsUnchangedFrame`; `TestFrameUpdateRendererCoalescesEachFrameUpdate`; `TestRendererRenderFrameUsesCRLFRowsForRawTTY`; `TestNativeInteractiveUsesAlternateScreen` |
|
|
54
|
-
|
|
55
|
-
## Native Surface Architecture
|
|
56
|
-
|
|
57
|
-
- `internal/ui/picker` remains the backend-neutral contract and owns native
|
|
58
|
-
routing, keyboard input, fuzzy filtering, action dispatch, preview command
|
|
59
|
-
execution, and result handling.
|
|
60
|
-
- `internal/ui/projmuxpicker` owns projmux-native visual composition: frame,
|
|
61
|
-
redraw updates, ANSI width/truncation, theme tokens, prompt/footer/list
|
|
62
|
-
rendering, selected row styling, scrollbars/gap rows, and preview pane
|
|
63
|
-
geometry/rendering.
|
|
64
|
-
- `internal/ui/pickercompat` remains as the internal compatibility option/result
|
|
65
|
-
mapper from older app option shapes to `picker.Options` for the native
|
|
66
|
-
backend. It is not a runtime backend. This keeps app code closer to a
|
|
67
|
-
DI-style picker contract instead of embedding binding strings at each call
|
|
68
|
-
site.
|
|
69
|
-
- Settings > Labs remains available for Live system resources and Project
|
|
70
|
-
Hooks, but no longer exposes picker backend/source information. Deprecated
|
|
71
|
-
saved/env backend values remain read-compatible and normalize to native.
|
|
72
|
-
- The split lets projmux grow a first-party picker design independently from
|
|
73
|
-
the compatibility option/result mapper.
|
|
74
|
-
|
|
75
|
-
## Frame Chrome ANSI
|
|
76
|
-
|
|
77
|
-
Native picker frame chrome is normalized in `internal/ui/projmuxpicker`.
|
|
78
|
-
Titlebar text, title dividers, and chip-strip gaps inherit the frame
|
|
79
|
-
`surface` / `chrome_foreground` instead of applying a second titlebar overlay ANSI layer;
|
|
80
|
-
chip bodies can still carry active/inactive/disabled tones. Search prompt and
|
|
81
|
-
footer separators fill the available frame width, and header, row, footer, and
|
|
82
|
-
preview lines close any active SGR style before padding or frame borders can
|
|
83
|
-
inherit it. This phase does not add popup modes or change the `popup-toggle`
|
|
84
|
-
contract; native popups still rely on the existing borderless tmux popup path.
|
|
85
|
-
|
|
86
|
-
## Verified Flows
|
|
87
|
-
|
|
88
|
-
- `ai` picker/settings: native backend routing covered by app tests. Docker
|
|
89
|
-
no-fzf e2e also types `Codex` into `projmux ai settings` and verifies the
|
|
90
|
-
native simple picker writes the `codex` mode without fzf.
|
|
91
|
-
- `shell` update prompt: native backend routing covered by shared compat-to-native
|
|
92
|
-
bridge and settings-style typed prompt tests.
|
|
93
|
-
- `settings`: native backend exercised in unit tests and Docker no-fzf e2e
|
|
94
|
-
using Enter plus arrow-key navigation under a PTY. The Docker e2e also fails
|
|
95
|
-
if the Settings flows write tmux no-server noise to stderr while running
|
|
96
|
-
outside tmux.
|
|
97
|
-
- `settings > Labs`: unit and Docker no-fzf coverage assert only Live system
|
|
98
|
-
resources and Project Hooks are visible. The Docker smoke starts with legacy
|
|
99
|
-
`fzf` env/file values, verifies Settings still uses native without fzf, and
|
|
100
|
-
confirms the compatibility file is read without being rewritten.
|
|
101
|
-
- `switch --ui=sidebar`: Docker no-fzf e2e creates sample projects, types
|
|
102
|
-
`bravo`, selects `bravo-web`, and confirms the opened tmux shell path.
|
|
103
|
-
- `switch --ui=popup`: Docker no-fzf e2e creates existing tmux sessions using
|
|
104
|
-
the app's session naming convention, runs the picker under a 150x30 PTY,
|
|
105
|
-
types `bravo`, sends `Right` and `Alt-Down` to exercise preview window/pane
|
|
106
|
-
cycle, asserts the popup stays on the right-side preview layout instead of
|
|
107
|
-
inline preview, asserts the stored preview cursor, selects `bravo-web`, and
|
|
108
|
-
asserts tmux reports the selected session's active target on the expected
|
|
109
|
-
window with the expected pane path.
|
|
110
|
-
- `sessions --ui=popup`: Docker no-fzf e2e creates existing tmux sessions,
|
|
111
|
-
runs the picker under a 150x30 PTY, types `bravo`, sends `Right` and
|
|
112
|
-
`Alt-Down` to exercise preview window/pane cycle, asserts the popup stays on
|
|
113
|
-
the right-side preview layout instead of inline preview, asserts the stored
|
|
114
|
-
preview cursor, selects `bravo-web`, and asserts tmux reports the selected
|
|
115
|
-
session's active target on the expected window with the expected pane path.
|
|
116
|
-
- `notify sidebar`: native routing is unit-covered; app tests cover
|
|
117
|
-
queue-write event subscription and picker tests cover repeated
|
|
118
|
-
event-triggered deferred refresh. Docker no-fzf e2e pushes a notification,
|
|
119
|
-
presses printable expect key `a`, and verifies the row is acked.
|
|
120
|
-
|
|
121
|
-
## Experimental Boundaries
|
|
122
|
-
|
|
123
|
-
- Preview-window parity is covered for the concrete projmux option shapes
|
|
124
|
-
(`right,60%,border-left` and `down,25%,border-top`) with fzf-measured percent
|
|
125
|
-
sizing. The full fzf preview-window grammar, threshold alternatives, sticky
|
|
126
|
-
headers, and offset expressions are intentionally outside this POC surface.
|
|
127
|
-
- fzf V2 dynamic scoring is covered for normal app-length non-search-key
|
|
128
|
-
rows, including reference scores for boundary, delimiter, camelCase/number,
|
|
129
|
-
gap, and consecutive bonuses. Very large `query * row` matrices intentionally
|
|
130
|
-
fall back to the greedy scorer to avoid pathological memory use. Search-keyed
|
|
131
|
-
app pickers preserve fzf's `--disabled` reload order instead of score-sorting.
|
|
132
|
-
- Mouse support is intentionally narrow in this POC: primary mouse down focuses
|
|
133
|
-
the clicked row, primary mouse up applies it, and wheel input moves selection.
|
|
134
|
-
Drag gestures and the full fzf mouse grammar are follow-up work.
|
|
135
|
-
- The public doctor/docs dependency policy no longer includes an external
|
|
136
|
-
picker binary.
|
|
137
|
-
- Draft PR: https://github.com/crevissepartners/projmux/pull/98.
|
|
138
|
-
|
|
139
|
-
## Commands
|
|
140
|
-
|
|
141
|
-
Automated no-fzf e2e:
|
|
142
|
-
|
|
143
|
-
```sh
|
|
144
|
-
wt run poc/native-picker-no-fzf -- scripts/poc-native-picker-no-fzf-e2e.sh
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Interactive no-fzf sandbox:
|
|
148
|
-
|
|
149
|
-
```sh
|
|
150
|
-
bash "$(wt path poc/native-picker-no-fzf)/scripts/poc-native-picker-no-fzf-sandbox.sh"
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Do not run the interactive sandbox through `wt run`: current `wt run` captures
|
|
154
|
-
child stdio instead of forwarding the caller's TTY, so Docker cannot attach
|
|
155
|
-
`-it` and terminal picker input will not behave like a real session.
|
package/docs/picker-ui-plan.md
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# Picker UI Plan
|
|
2
|
-
|
|
3
|
-
## Goal
|
|
4
|
-
|
|
5
|
-
The project switcher needs a rich native picker surface. The target interaction
|
|
6
|
-
is a card-like list where each item can show a title plus small contextual lines
|
|
7
|
-
such as session state, window/pane summary, branch, or path. Search should stay
|
|
8
|
-
focused on stable identity text, especially the project or session title,
|
|
9
|
-
instead of matching every contextual preview line.
|
|
10
|
-
|
|
11
|
-
## Current Contract
|
|
12
|
-
|
|
13
|
-
The picker contract is split in two layers:
|
|
14
|
-
|
|
15
|
-
- `internal/ui/picker` owns backend-neutral items, actions, preview metadata,
|
|
16
|
-
title-focused filtering, and the native runner.
|
|
17
|
-
- `internal/ui/pickercompat` is an internal compatibility option/result shape
|
|
18
|
-
for older app call sites. It is not a runtime backend, and product flows do
|
|
19
|
-
not execute the external fzf binary.
|
|
20
|
-
|
|
21
|
-
## fzf Capability Check
|
|
22
|
-
|
|
23
|
-
This section is historical context. Earlier design work evaluated fzf because it
|
|
24
|
-
supported multi-line items with `--read0`, where a single item can contain
|
|
25
|
-
newline characters when input records are NUL-delimited.
|
|
26
|
-
|
|
27
|
-
The simple fzf option path is not enough for the desired search behavior:
|
|
28
|
-
|
|
29
|
-
- `--read0` can display multi-line items.
|
|
30
|
-
- `--nth` can restrict search to selected fields.
|
|
31
|
-
- `--with-nth` can transform the displayed fields.
|
|
32
|
-
- In practice, once `--with-nth` is used to show a card field, fzf searches the
|
|
33
|
-
transformed visible text. Context lines become searchable.
|
|
34
|
-
|
|
35
|
-
So fzf can support "multi-line cards", but not "multi-line cards with title-only
|
|
36
|
-
search" through a small option-only extension while preserving the current
|
|
37
|
-
selection contract.
|
|
38
|
-
|
|
39
|
-
## Viable Paths
|
|
40
|
-
|
|
41
|
-
### 1. fzf card approximation
|
|
42
|
-
|
|
43
|
-
Use `--read0` and NUL-delimited multi-line entries. This is the smallest change,
|
|
44
|
-
but contextual card text will participate in search unless the visible card is
|
|
45
|
-
kept title-only. This does not meet the intended search model.
|
|
46
|
-
|
|
47
|
-
This path is retired and is not supported.
|
|
48
|
-
|
|
49
|
-
### 2. fzf custom filtering
|
|
50
|
-
|
|
51
|
-
Run fzf in a more controlled mode where query changes reload a filtered list
|
|
52
|
-
from `projmux`, and `projmux` performs title-focused matching. This keeps fzf as
|
|
53
|
-
the renderer but moves filtering into the app.
|
|
54
|
-
|
|
55
|
-
Tradeoffs:
|
|
56
|
-
|
|
57
|
-
- More shell quoting and reload complexity.
|
|
58
|
-
- More edge cases around selection identity and tracking.
|
|
59
|
-
- Still constrained by fzf's list layout and event model.
|
|
60
|
-
|
|
61
|
-
This bridge path is retired and is not supported.
|
|
62
|
-
|
|
63
|
-
### 3. Native picker TUI
|
|
64
|
-
|
|
65
|
-
Introduce a picker abstraction and implement a native terminal UI for card rows,
|
|
66
|
-
title-focused search, stable selection identity, and app-owned key handling.
|
|
67
|
-
|
|
68
|
-
This best matches the desired product direction:
|
|
69
|
-
|
|
70
|
-
- card rows are first-class data, not encoded fzf strings
|
|
71
|
-
- search fields are explicit
|
|
72
|
-
- preview/context fields can be visible but non-searchable
|
|
73
|
-
- future key behavior can be tested without relying on fzf internals
|
|
74
|
-
|
|
75
|
-
## Implemented Direction
|
|
76
|
-
|
|
77
|
-
Do not extend the retired fzf row format again. The previous hidden-field attempt
|
|
78
|
-
showed that small fzf encoding changes can break selection and navigation in
|
|
79
|
-
subtle ways.
|
|
80
|
-
|
|
81
|
-
Current implementation:
|
|
82
|
-
|
|
83
|
-
- Picker-domain model exists as `picker.Item` with `Title`, `Value`,
|
|
84
|
-
`SearchText`, `MetaLines`, `Badges`, and `PreviewTarget`.
|
|
85
|
-
- `picker.Options` carries backend-neutral actions, preview metadata, prompt,
|
|
86
|
-
footer, initial query, and multiline intent.
|
|
87
|
-
- Native is the picker backend and renders the popup/sidebar surfaces.
|
|
88
|
-
- Native supports multiline item rendering, title-focused search via
|
|
89
|
-
`SearchText`, numeric selection, and shared close actions.
|
|
90
|
-
- Switcher popup/sidebar use native preview panes, raw-key navigation, and
|
|
91
|
-
sidebar focus tracking.
|