feat(selector): make an empty project list explain how to fill it - #30
Closed
abeljim8am wants to merge 1 commit into
Closed
feat(selector): make an empty project list explain how to fill it#30abeljim8am wants to merge 1 commit into
abeljim8am wants to merge 1 commit into
Conversation
This was referenced Jul 28, 2026
Flock deliberately does not go hunting for projects on its own, so on a fresh
install the empty project list is the first screen a new user sees. It said
" no project folders configured" and stopped there — a status line reporting
itself, with no way to act on it.
It is now the setup instructions:
no project folders configured
add them to your config.kdl:
flock {
root_dirs "~/src" "~/work"
}
then reopen the selector
The configured-but-empty state got the same treatment. " no projects found"
alone gives no way to spot the common misconfiguration, so it now names it:
root_dirs is scanned one level deep, meaning a root pointed at a project rather
than at the folder containing it finds nothing, and individual_dirs is the option
for a folder that is itself a project.
Both blocks fall back to a single line that still names the fix when the pane is
too short for the full form — a truncated block would trail off mid-snippet, which
is worse than a compact line. A search with no matches stays a plain status line;
mid-search is not the moment for setup instructions.
The planned in-app "add a project folder" action is deliberately not here. The
only way a plugin can persist to config.kdl is reconfigure, which rewrites the
whole file from the serialized config — it backs the old one up and prepends a
pointer to the backup, but comments and formatting do not survive in the live
file. It also needs a new Reconfigure permission, a one-time dialog for every
existing user, and for a declaratively-managed config (nix, dotfiles, chezmoi) it
would replace the symlink and break the manager. Paying that to save one paste, on
a file the user owns and that we document with comments, is the wrong trade.
Recorded in the plan doc as revisitable only if the flock { } block can be patched
surgically.
Verified by replaying the pty output of a real session onto a grid, so the block
was checked as rendered rather than as asserted: each row is separately
cursor-positioned, so the multi-line text is not contiguous in the byte stream and
a naive substring check on the whole phrase misses it.
The regenerated flock-selector.wasm is included because release builds embed
assets/plugins rather than target/; the other fourteen plugin assets also rebuilt
(different toolchain than whoever last committed them) and were reverted, per
AGENTS.md.
abeljim8am
force-pushed
the
feat/selector-empty-state
branch
from
August 4, 2026 15:34
77eea43 to
48f04cf
Compare
Collaborator
|
Superseded by mega PR #35 |
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.
Why
Flock deliberately does not go hunting for projects on its own (your call in the Phase 0 planning), and bare
flocknow opens the selector (#29). Those two together mean an empty project list is the first screen a new user sees — and it said" no project folders configured"and stopped there. A status line reporting itself, with no way to act on it.It is now the setup instructions:
The configured-but-empty state got the same treatment.
" no projects found"alone gives no way to spot the common misconfiguration, so it now names it:root_dirsis scanned one level deep, so a root pointed at a project rather than at the folder containing it finds nothing — andindividual_dirsis the option for a folder that is itself a project.Both blocks fall back to a single line that still names the fix when the pane is too short for the full form; a truncated block would trail off mid-snippet, which is worse than a compact line. A search with no matches stays a plain status line — mid-search is not the moment for setup instructions.
What I dropped, and why
The plan's second bullet was an in-app "add a project folder" action that writes to
flock { }. I recommended against it and you agreed, so it is not here.The only way a plugin can persist to
config.kdlisreconfigure, which rewrites the entire file from the serialized config. It does back the old one up and prepend a pointer to the backup — but comments and formatting do not survive in the live file. It also needs a newReconfigurepermission, which is a one-time dialog for every existing user, and for a declaratively-managed config (nix, dotfiles, chezmoi) it would replace the symlink and break the manager. Paying all of that to save one paste, on a file the user owns and that we deliberately document with comments, is the wrong trade.Recorded in the plan doc as revisitable only if the
flock { }block can be patched surgically with comments preserved.Verification
cargo xtask test— 2371 passing, 0 failures.cargo xtask format --checkclean.project_hintis a pure function returning rows, so the logic is tested directly: the unconfigured block names file + snippet, the short-pane fallback still names problem and fix, every tier fits the capacity it was given (looped over capacities 0–7), the configured-but-empty block names the one-level-deep behaviour andindividual_dirs, and a non-empty query stays a plain status line. One test goes throughrenderto prove the multi-row wiring and that the block is not selectable.grep -Fon the whole phrase reported "not found" even though it was rendering correctly. Verifying by substring search alone would have been misleading in both directions.Note on the
.wasmassetzellij-utils/assets/plugins/flock-selector.wasmis regenerated and included, because release builds embedassets/pluginswhile debug builds readtarget/(consts.rs:169-182) — without it the change would not ship. Rebuilding also rewrote the other fourteen plugin assets (they were last built with a different toolchain); those are reverted, perAGENTS.md's guidance to avoid committing regenerated assets that are not part of the change.🤖 Generated with Claude Code