Repository navigation
feat(ui): add textview, read-only text that selects, copies and colors - #36
Merged
Merged
Conversation
Process output, logs and the details of a record are text a user reads and copies but never edits. A code editor in read-only mode is too heavy for that, and components.TextSelection is only the selection model, so each app ends up writing its own view. ui/textview draws such text on the fixed-pitch grid, only the rows in view when it scrolls, colors and links runs of it through spans, and takes the selection a code editor takes: a drag across lines that scrolls past an edge, a double click for a word, a triple click for a line, Shift with a click to extend, Primary+C to copy, Primary+A to select everything and Escape to drop it. A link opens on a click and selects on a drag. A trail after a line (a note or a button) is never selected or copied. Painting costs the same for 100 lines and 100000: one allocation of 48 B per frame on Apple Silicon.
This was referenced Nov 17, 2026
1lck
marked this pull request as ready for review
November 18, 2026 03:37
15 of 18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The same branch as vivaui#337, opened against the fork's
mainas well. It has two commits on82a3318, which is already on forkmain, so merging it brings in nothing else:3724c4fadds the package, and0e17e51answers the upstream review by giving links and trail buttons identities of their own (Handlers.Parts).It adds
ui/textview, a read-only text view that can be selected, copied and colored. It covers process output, logs and record details. Lithe currently keeps its own copy indesktop/internal/textview(1lck/Lithe-IDEA#2085, for 1lck/Lithe-IDEA#2073). Once this is on forkmainand the Lithe pin includes it, Lithe can importgithub.com/vivaui/viva/ui/textviewand delete that copy.The upstream PR has the full description, the verification, benchmarks and screenshots. In short, on macOS 27 / arm64:
go vet ./...are clean.go test ./... -count=1passes in 92 packages.cmd/vivafails the same way without this change, because of the local toolchain (min_system12.0 vs macOS 13.0).go vet ./ui/textview/is clean for windows/amd64, windows/arm64, linux/amd64 and js/wasm.dde7a5b, theinternal/layeringtests pass with the package added.If upstream asks for changes, the same branch is updated, so both PRs stay in step.