diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-26 11:37:09 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-26 11:40:58 -0300 |
| commit | e9991ca68067ee835af43868a193e8e6bd5dd420 (patch) | |
| tree | fede7dc9f15803b75d0e2776effb5ca5f3a372b2 /core/draw.zig | |
| parent | 26e5fae651e4261321c2937094fdec7b7d3b299f (diff) | |
| download | pardes-e9991ca68067ee835af43868a193e8e6bd5dd420.tar.gz pardes-e9991ca68067ee835af43868a193e8e6bd5dd420.zip | |
mouse, TagState, keys, draw, Pick, exec, panes, Trail: the mouse never ends a picker or a prompt as a side effect: a click elsewhere leaves a state with a field waiting for the keyboard, the wheel scrolls the results, B1 on a row moves the cursor and B3 lands it, and only an act on the panes the picker lives in ends it first (UX DESIGN O2, O3, binding; the user: "Using the mouse just closes the picker? That is extremely bad the mouse shoudn't do implicit actions like this and I should be able to at least scroll on the resuls (doing a right click Look should also work though)"); THE WAY IT WAS: handleMouse's deferred check ended any state whose host was not `v.active` after any event (motion and the wheel too: from a held pane, whose picker the made pane hosted, a bare pointer motion ended it, UX7's t5), and W5's hostTagAt ended a state on any press on its tag; bandPress returned for the wheel, and its B3 landed through TagState.point and landHere whatever step the row was in (an act's row set the list's cursor; a theme's row rolled the picker up and wore nothing); THE CHANGE: TagState.waits, one bool (in the view, so in the dump and the digest), cleared by toRest: an event that moves the keyboard off the host, or B1 anywhere off the head and the band (the host's own tag, its body under the band, a header, a grip), leaves a state with a field (Help, a picker, a text prompt, `:`, rename) up and waiting, and ends a level, the registers or describe-key first, as Esc does (they hold no typed text; W5's hostTagAt branch deleted); while it waits, keys go where the keyboard is (keys.handleKey) and Esc ends it first, the pane's own Esc ladder from the next; B1 on its head or band, or a key that moves the keyboard to its pane (`C-w … ⏎`, `SPC w k`), gives it back; the waiting box shows its pane's mode and the field no caret (draw.zig: `typing` and the head's caret, behaviour only); TagState.pending echoes keys typed meanwhile on the notice row; bandPress: the wheel moves a picker's cursor by `wheel_rows` (Pick.wheel; the band's eleven and the preview follow as for a key) and Help's; B1 on a row is Pick.press (the list's cursor, or the act step's), B3 Enter there (a row landed, Shift-B3 below as S-Enter, an act applied, a source switched, a theme worn, an action applied); B2 and B3 on the head's words and B2 on a row's run with a picker or prompt up; B2 or B3 on the text a picker previews lands it first (Pick.previewsAt, landHere), then acts in the landed file; O3's guard, Pick.yieldFor: the live picker, waiting or not, ends as Esc does when Get, Undo, Redo, Save (acme's Put), Del or Keep is run on the pane it asks from or previews in (exec.runBuiltinFrom), when that pane is removed (panes.removePane) or a walk step replaces its file (Trail.show: a trail word, a Look landing there); anything else (Wrap, Snarf, a Look opening elsewhere) leaves it up; RUN (TEST FIRST): four mouse.zig tests, each failing on the change before (its `waits` checks taken out to compile there) and passing now: "the mouse never ends a picker as a side effect ..." (motion and the wheel over the preview and the window row, the wheel over the rows ±1 and the preview following, B1 on the third row and Up/Down in the field, B3 on the preview's text landing three.zig in the held pane's reader, Shift-B3 on a row opening a pane below: fails at mouse.zig:2121, the wheel moved no cursor, 0 for 1), "B1 in another pane: a picker waits ..." (B1 on the preview: waiting, the held box its mode, no caret in the head, `j` the reader's; B1 on the head back, `w` in the field; `C-w k ⏎` back; B1 under the band, `i`, Esc ends the picker with insert mode kept, the next Esc normal: fails at mouse.zig:2179, the picker ended), "B1 on the asking pane's own tag: the picker waits ...; B2 Del ends it first ... and closes the pane" (B2 Wrap leaves it up; B2 Del closes the held pane and the reader made for it: fails at mouse.zig:2238, the picker ended), "the act step and the rows under the mouse ..." (B2 Wrap in a row's text, B1 on `y Copy` sets the act step's cursor to 6, B2 on it copies `…one.zig:2`, the picker up: fails at mouse.zig:2286, act_at 0 for 6); TagState's W5 test, renamed, now asks Help to stay up after B2 Wrap in its tag and to wait after a click in the other pane, and an `s` prompt to wait the same; a user hit it with every click while a picker was up, and with any pointer motion from a held pane; GATES (Debug tui): core-test 1172/1346 (174 skipped: + 4; one program's 7 cached), shell-test 1387/1390 (3 skipped: + 4); the dump changes (TagState.waits): the dump fuzz and the soak run on the last change of this line; load 1.8 to 4.2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/draw.zig')
| -rw-r--r-- | core/draw.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/draw.zig b/core/draw.zig index 3caf27ca..a94c8e60 100644 --- a/core/draw.zig +++ b/core/draw.zig @@ -521,8 +521,9 @@ fn renderPane(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: // In window mode the box holds the pane's letter instead of its mode. const label: ?u8 = if (p.view().window_pick != null) layout.windowLabel(p, id) else null; // A tag in a typing state is typed in: its box says so (walk UI SPEC - // §3.2), whatever the body's mode. - const typing = p.view().tag_state.kind != .rest and TagState.hostOf(p) == id; + // §3.2), whatever the body's mode; not while it waits for the keyboard + // (UX DESIGN O2). + const typing = p.view().tag_state.kind != .rest and !p.view().tag_state.waits and TagState.hostOf(p) == id; s.set(r.x, tag_y, if (label) |*letter| @as(*const [1]u8, letter) else if (typing) config.tag_insert else switch (pane.body.mode) { .normal => config.tag_normal, .insert => config.tag_insert, @@ -1065,7 +1066,7 @@ fn joinBand(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: R for (0..rows) |y| joinCells(s, r.x + TAG_TEXT_INSET, y0 + @as(u16, @intCast(y)), storage[y * columns ..][0..columns], 0, r.w - TAG_TEXT_INSET, .{ .rgb = fg }); // A head typed in: its caret a bar at the field's, the keyboard's // where the pane has it. - if (head.caret) |c| if (active) { + if (head.caret) |c| if (active and !p.view().tag_state.waits) { const at = modal.positionAt(shown.text, shown.fromReal(c)); if (at.row < drawn.head) { const col = panes.File.rawDisplayCol(tab, lines[at.row], @min(at.col, lines[at.row].len)); |
