Collapse review_action to what it now is: a per-project viewer name - #137
Merged
Conversation
Splitting the review keys took the medium decision away from projects.review_action and left it naming one thing: which [viewers.<name>] table a project's local diffs open in. The type still carried the old shape, where ReviewAction::Auto, ::Pr and ::Viewer(None) were three spellings of "name no viewer, use the default" — a value that has to be read twice before it can be trusted. The column is now projects.viewer, holding that name or NULL, and the enum is gone: Project::viewer is an Option<String>. Migration 0017 converts in place — viewer:<name> keeps its name, auto/pr/viewer become NULL. The CLI verb is `voro project viewer <project> [NAME]`, naming no viewer to fall back to the default; the projects screen's `v` picker offers the default viewer and each named one instead of two entries that did nothing distinguishable. Verified against a copy of a real v16 database: all four legacy spellings migrate as intended and the TUI picker, its status line, the projects-row marker, and the viewer-delete guard read the new column. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbFevF3VMe27CLTXowayzG
MJohnson459
force-pushed
the
project-viewer-name
branch
from
August 13, 2026 14:31
f59a36d to
cc3d99d
Compare
MJohnson459
added a commit
that referenced
this pull request
Aug 13, 2026
#137 collapsed projects.review_action to projects.viewer while this branch was teaching viewers to be built in, and the two meet in exactly the places you would expect. Resolved so both survive: * the projects screen's `v` picker keeps main's collapsed option list (the default viewer, then each named one) but populates it from viewer_entries(), so the built-ins are offered — a project may pin one with no table defining it, which `voro project viewer demo code` and the picker both now do. * the `viewer remove` refusal keeps main's wording ("is the viewer of") over a user-defined viewer, since `zed` is a built-in name here and the round-trip test needs one that can actually be removed. * the CLI help and the starter config keep this branch's entries with main's renamed verb, `voro project viewer <p> <name>`. * DESIGN.md §5 keeps this branch's built-in-viewer paragraphs with main's column rename applied inside them; §8 keeps main's rewritten paragraph with this branch's built-in fallback sentence re-applied to it. Verified after resolving: cargo test --workspace (747), clippy with -D warnings, and fmt are clean; `voro project viewer demo code` pins a built-in with no voro.toml at all, `voro viewer list` and the `v` picker both offer the three built-ins, and `o` with none installed still raises the add-viewer form.
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.
Splitting the review keys (#388) took the medium decision away from
projects.review_actionand left it naming one thing: which[viewers.<name>]table a project's local diffs open in. The type still carried the old shape,
where
ReviewAction::Auto,::Prand::Viewer(None)were three spellings of"name no viewer, use the default" — a value that has to be read twice before it
can be trusted.
What changed. The column is now
projects.viewer, holding a viewer name orNULL, and the enum is gone:
Project::vieweris anOption<String>, andStore::set_review_actionisStore::set_viewer(project_id, Option<&str>),which refuses a blank name rather than silently reading it as "the default".
Migration 0017 renames the column and converts in place —
viewer:<name>keepsits name;
auto,prand a bareviewerall become NULL.The surface follows the type:
voro project action <p> <auto|pr|viewer[:NAME]>is nowvoro project viewer <p> [NAME], naming no viewer to fall back to theconfig's
default_viewer. It echoesdemo viewer: default viewer -> zed.vpicker lists the default viewer and each namedviewer, dropping the
auto/prentries that did nothing distinguishable.Its title, key line and
?map entry now say "viewer".voro project listand the projects row keep the[viewer:NAME]marker,shown only when a project names one.
"viewer 'zed' is the viewer of demo — repoint it with
voro project viewer <project> [NAME]before removing it".DESIGN.md §5 (schema and the
voro.tomlprose), §8, §9 and §12 are updated inthe same change, as is the
voro agent initskeleton comment, the README, andthe CHANGELOG.
Verification.
cargo test --workspace(691 tests), clippy with-D warnings, andcargo fmtare clean. Two new tests cover the shape: around-trip over
set_viewerincluding the blank-name refusal, and a migrationtest that opens a v16 database carrying all five pre-split spellings and asserts
what each reads back as. Beyond that I ran the built binary against a copy of a
real v16 database —
viewer:zed,pr,auto, a bareviewerand NULL allmigrated as intended — and drove the TUI in tmux: the
vpicker listsdefault viewer / difftool / zed / new viewer…with(current)on the rightrow, setting one paints
[viewer:difftool]on the projects row andviewer -> difftoolon the status line, and choosingdefault viewerclearsit back.
Note for triage: this invalidates proposed task #135's implementation. #135
("Make the review next-action verb medium-aware") derives the verb from the
stored
ReviewAction, mappingviewer/viewer:<name>to review andauto/prto pr. After #388 that reasoning was already unsound —grunsthe GitHub flow on a viewer project too — and after this change the values it
switches on no longer exist: every project either names a viewer or names none,
and neither says whether the project publishes. #135's problem may survive in
another form (a
reviewrow in a non-GitHub project still readsnext: pr),but its stated approach cannot be implemented as written. Left untouched rather
than silently retriaged.