summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-25 11:40:05 -0300
committerGabriel Schneider <[email protected]>2026-10-25 12:24:05 -0300
commit685b4050bb0caaa95c4c6a209e69f7777469e9fc (patch)
treeb1c34301f9f1febd5e70dfdfee52425cdca0ef4a /docs
parent29d753b420385d7ca214250909e3a33c85cfab8d (diff)
downloadpardes-685b4050bb0caaa95c4c6a209e69f7777469e9fc.tar.gz
pardes-685b4050bb0caaa95c4c6a209e69f7777469e9fc.zip
query: a row is its place as text, `path:line:col` then its code, the path the shortest a Look from the query pane resolves (Query.lookPath: relative, `../` included, when shorter, else absolute, never `@pN` but for a text with no file), aligned per group, the declaration headers `path:line`; its code coloured as its file's language colours it, the file painted whole on the worker (Stream.paintRows, highlightApart, kept in the locations cache, Query.Shades a walk a refill, Query.recolor in place as each lands) with the match tinted over it; the +Preview's places are the query's hits in its file (a Grep searched, a list fed), tinted and ticked, the row's one current and selected, as in a pane that already shows it; tests for B3 on an address, a saved list's Looks, the shortest path, the preview's places and colours, the worker's colours; fsearch, grep, lookrange, lsp-client, lsprelpath (now `../shade.zig`), stepgrain, tagbottom goldens: the address rows; docs/next-searchrows.md: the design and the numbers
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016u3hBPFfja5pK4EBRC1UVD
Diffstat (limited to 'docs')
-rw-r--r--docs/next-searchrows.md89
-rw-r--r--docs/search-proto-converge.md48
-rw-r--r--docs/typ/guide.typ9
3 files changed, 133 insertions, 13 deletions
diff --git a/docs/next-searchrows.md b/docs/next-searchrows.md
new file mode 100644
index 00000000..79ffc444
--- /dev/null
+++ b/docs/next-searchrows.md
@@ -0,0 +1,89 @@
+# searchrows: query rows that are addresses, coloured as their files
+
+The author's ask (2026-10-25): the search results "should show Lookable
+locations for the matches, and it should highlight the near text on the
+preview/result pane", then "using treesitter for the highlight I mean",
+then on the row format: "the row can be just path:line:row but the path
+should be minimal i.e. it should be the smallest one that doesn't refer to
+panes like @p1 but that resolves a Look". Change `tsyvmpux`, on
+`zmluwpuv`. Positions, not a verdict.
+
+## The row
+
+ Places.zig:163:8 pub fn firstFrom(hits: []const Hit, at: usize) usize {
+ Places.zig:237:19 const i = firstFrom(set.hits.items, at);
+ ../shade.zig:1:11 pub const Shade = enum {
+
+- `path:line:col`, then the line's code from its first non-blank: plain
+ text, so B3 anywhere on the address is a Look as anywhere, a sweep copies
+ it, and a frozen pane saved is a list of addresses that still work.
+- The path is `Query.lookPath(buf, path, dir)`: the shortest text a Look
+ from the query pane resolves: relative to the pane's directory (`x`,
+ `sub/x`, `../x`) when strictly shorter, else absolute. A relative name a
+ Look would read as something else (`@p...`, `://`) stays absolute. One
+ function, used by every hit row and by the file and declaration headers
+ of Grep, `/`/All and the language server lists.
+- On every row, `/` in the owner included: a bare `:12:5` would be looked
+ up in the +Search itself (a Look resolves against the pane it is in) and
+ a saved list would lose its file.
+- A group's code starts in one column: the address padded to
+ `path + ':' + digits(longest line in the group) + ':' + 3`, then two
+ spaces (a column of four digits or more pushes its own row one cell).
+- Declaration headers carry `path:line` in the same column; file headers
+ stay the bare path (itself a Look).
+
+## Colours
+
+- Rows: `Stream.paintRows` paints a whole file on the worker
+ (`syntax.highlightApart`, the same call as the anim paint-ahead): the text
+ of the pane that shows it, else read from disk there. It lands in the
+ locations cache beside Callstack's (`locations.Cache.put`); each row takes
+ its line's slice when the line still reads as the row does
+ (`Query.Shades`, one walk down each file a refill). Until then rows are
+ plain; on arrival `Query.recolor` colours every query pane's plain rows
+ in place and asks for the next file: one at a time, each (path, revision)
+ once a Grep (a 256 ring). The match tint (`decorateRow`) sits on top, its
+ position past the address (`code_start`). Not on the loop, not in a 9P
+ write (asked again on the next step), not without workers.
+- The +Preview: colours are its own pane's (painted as any file pane), and
+ the query's hits in that file are its places (`Places.search` literal for
+ a Grep, `Places.feed` from the rows for a list), tinted and ticked, the
+ current row's one current and selected, centred. A pane that already
+ shows the file gets the same (`selectPlace`).
+
+## Numbers
+
+`zz grep rows timings` (src/Stream.zig, `GREP_TIMES=<path>`): Debug, a
+TestShell worker, 160x50, the stress file (src/layout.zig x17, 1.22 MB,
+29002 lines), typing `pane` three times with 400 ms of frames after each
+key, then Enter on 2000 rows. Load 2.4-3.0 before, 2.7-2.8 after; after is
+three runs.
+
+| frame work | before | after |
+|---|---|---|
+| keystroke (update + render) p50 / p90 / max | 2.2 / 4.2 / 6.0 ms | 2.0-2.1 / 2.9-6.5 / 4.4-6.7 ms |
+| refill frame (rows remade) p50 / p90 / max | 4.4 / 5.2 / 5.2 ms | 4.8-5.1 / 5.4-6.1 / 5.4-6.1 ms |
+| other frames p50 / p90 / max | 0.9 / 1.3 / 10.6 ms | 0.9 / 1.2-1.3 / 10.0-10.2 ms |
+| Enter (2000 rows written) | 27.0 ms | 28.2-28.7 ms |
+| frames after Enter p50 / max | 0.9 / 1.7 ms | 0.9 / 1.3-1.7 ms |
+
+Rows coloured after Enter: 1718 of 2000; the other 282 are plain in the
+file's own colours too (checked against `highlightApart` of the file). A
+refill costs ~0.4 ms more (the wider rows and the Shades walk), inside the
+noise of the keystroke column; the paint itself never shows on the loop.
+
+## Pushback and rough edges
+
+- The current row's address is barely legible: the address's dim location
+ colour on the current row's mark tint (visible in the screenshot). The
+ thing B3 aims at should read; a brighter location fg on the marked row is
+ a one-line theme decision I left to you.
+- A text with no file (a +New scratch) has no path any Look resolves, so
+ its `/` rows keep `@pN`, the only address that works there.
+- `lsprelpath` asserted the opposite policy ("must NOT become
+ `../shade.zig`"); the author's shortest-path rule wins, the script says so.
+- Rows of a file over 4 MB, and of markdown/typst (their injections share
+ parsers, so no worker paints them) stay plain; a disk file changed after
+ it was painted keeps plain rows for its changed lines until the next Grep.
+- One file painted at a time: a Grep over hundreds of files colours file
+ by file (each lands in a frame); a worker per file if that is slow.
diff --git a/docs/search-proto-converge.md b/docs/search-proto-converge.md
index 99adbc2c..7a3e361a 100644
--- a/docs/search-proto-converge.md
+++ b/docs/search-proto-converge.md
@@ -40,13 +40,40 @@ only the prompts that are not search.
`Search <line 1>` is the builtin under the three argument paths
(`config.leader_args`, pick's table).
-**Rows look like Callstack's**: a gutter line number, the hit's line with
-the match tinted (every match on a line tinted, one row a line), under the
-declaration it is in (once a parse exists, see below), under the file
-(Grep, the LSP lists), under `@pN name (count)` in serial order (All).
-B3 on a row's line number looks at its address; B3 on its code is a word
-Look as anywhere; B2 on line 1 runs it again. The pane has no gutter of its
-own, and its rows are read-only while live (queryline's clampEdit).
+**Rows look like Callstack's**: each row's place first, as text,
+`path:line:col`, the path the shortest a Look from the query pane
+resolves (relative to its directory, `../` included, when that is shorter,
+else absolute; `Query.lookPath`), never an `@pN` but for a text with no
+file, padded so a group's code starts in one column, then
+the hit's line coloured as its file's language colours it, the match
+tinted over that (every match on a line tinted, one row a line); under the
+declaration it is in (once a parse exists, see below; the header has its
+`path:line` too), under the file (Grep, the LSP lists), under `@pN name
+(count)` in serial order (All). B3 on the address is a Look as anywhere, a
+sweep copies it, and a frozen pane saved is a list of addresses that still
+work; B3 on its code is a word Look; B2 on line 1 runs it again. The pane
+has no gutter of its own, and its rows are read-only while live
+(queryline's clampEdit). The address is on every row, `/`'s included:
+a bare `:12:5` would be looked up in the +Search itself (a Look resolves
+against the pane it is in), and a saved list would lose its file.
+
+The rows' colours are their files' whole (`Stream.paintRows`): a file is
+painted once on the worker (`syntax.highlightApart`, the text of the pane
+that shows it, else read there from disk), kept in the locations cache
+beside Callstack's, and each row takes its line's slice when the line
+still reads as the row does (`Query.Shades`, one walk down each file a
+refill). Until then the rows are plain; when a file lands, every query
+pane's plain rows from it are coloured in place (`Query.recolor`), which
+asks for the next file, one at a time. Without workers (tests) the rows
+stay plain.
+
+**The +Preview is the file as its own pane shows it**: its colours are
+the file's (`colorAlgo` `.source`, painted ahead as any pane), and the
+query's hits in it are its places (a Grep's searched there as in an open
+pane, a list's fed from its rows), tinted and ticked, the current row's
+one current and selected, centred with its neighbours round it. A pane
+that already shows the file gets the same: its places, the row's one
+selected.
**Keys** on line 1, typing: Ctrl-n / Ctrl-p (and Down / Up, `config.query_next`
/ `query_prev`) step the current row; Enter lands; Esc cancels. Tab stays the
@@ -197,9 +224,10 @@ of 100 (the Debug SafeAllocator's stack capture per allocation was 30% at
- LookNext / LookPrev do not step query rows (their addresses are in row
metadata, not text).
-- Grep rows carry no syntax colours; `/` rows are coloured where the
- owner's highlights cover them (zeros elsewhere, so no fragment parse per
- refill).
+- Rows of a file bigger than 4 MB, of markdown and typst (their
+ injections share parsers, so no worker paints them) stay plain; a disk
+ file changed after it was painted keeps plain rows for its changed
+ lines until the next Grep.
- Rail ticks are not carried over the detached wire (a detached frontend
shows tints, not ticks).
- In a window too short for the group (4 rows), only the query pane's tag
diff --git a/docs/typ/guide.typ b/docs/typ/guide.typ
index 61ba5455..58e5d907 100644
--- a/docs/typ/guide.typ
+++ b/docs/typ/guide.typ
@@ -175,7 +175,7 @@ is born #word("SearchRows") rows tall and never resizes itself; nothing
found is a count of `0` in its tag, not an exit.
#pairs(
- [#key("/") `vw`], [every match in the text tinted and ticked on its scroll rail, the first after the cursor selected; the rows under line 1 are the lines holding it, a line number in the gutter, each under the declaration it is in],
+ [#key("/") `vw`], [every match in the text tinted and ticked on its scroll rail, the first after the cursor selected; the rows under line 1 are the lines holding it, each its place as text first (`file:line:col`, the shortest path a #word("Look") from the pane resolves), then the line coloured as the file is, under the declaration it is in],
[#keys("Ctrl-n", "Ctrl-p")], [the next or previous match, typing; the text follows it],
[#key("Enter")], [the keyboard on the match, the pattern in `/`, the rows kept as text (#word("Save") keeps them as a file)],
[#keys("n", "N")], [the next or previous match in the text, round the end without a word],
@@ -202,8 +202,11 @@ typing, #keys("n", "N") and #keys("j", "k") in the pane's normal mode);
#btn("B1") on the rows places the caret and selects, as in any pane, and
moves nothing else. #key("Enter") lands the current row, making the
preview that file's pane where it stands.
-#btn("B3") on a row's line number looks at the row; #btn("B2") on line 1
-runs it again. The next search from the same pane reuses its query pane,
+The preview colours the file as its own pane does, and the query's hits
+in it are its places, tinted and ticked, the current one selected.
+#btn("B3") on a row's place goes there, as on any address; the rows kept
+as text (#word("Save")) are a list of places that still work.
+#btn("B2") on line 1 runs it again. The next search from the same pane reuses its query pane,
its kept rows back on #key("Esc") (#word("SearchPane") `new`: a pane each;
#word("SearchPlace") `column`: in a finder column at the right). A PDF's
and a terminal's #key("/") still ask on the message row and list a