feat(dev): lab parked-work view (ADR-0017 slice 3) #144
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!144
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/136"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ADR-0017 slice 3/3: a per-project Parked view to see and clean up the parked
lab//afk/branches and worktrees the guarded teardown keeps (dirty or unmerged).What's here
gatherParkedreuses the reconciliation derivation (managedBranch+ownedBranches): managed branches no live session owns, each paired with its worktree if one exists.GET /parked/<project>, off the ~4s poll): per entry — branch + kind (lab/vsafk/<N>), dirty ● / clean ○, commits ahead of mainline, last-commit age, unpushed warning, a best-effort PR badge (onetea ListPulls, Forgejo only), and the copyable worktree path. Fails loud in the strip on an enumeration error.POST /parked/discard/<project>): force-removes the worktree and deletes the branch regardless of dirty/merged — the one unguarded teardown, bypassing the guarded rule, behind the existing two-step confirm. The branch rides as a form field (names contain/); only managed branches are accepted. Discarding anafk/<N>entry frees the issue (ADR-0013).data-staticclient-owned-subtree rule so the lazily-fetched body survives background polls, and the strip is keyed so a poll patches it in place instead of rebuilding it (open state + fetched body preserved).CommitsAhead,UnpushedCount(a never-pushed branch's unpushed equals its ahead count),LastCommitTime.CONTEXT.mdgains a "Parked work / Parked view" entry.Verification
go test ./...,go vet ./...,go build ./...pass locally (pre-commit is eval-only — it does not build/run Go; thefwdry-build eval passed on commit).data-staticbody survives a poll without being wiped or snapping shut, the keyed strip survives a positional shift (an instance row appearing), and a non-static sibling still morphs.lab/+afk/; bare vs worktree-backed), the git helpers (pushed/never-pushed split), Discard-is-unguarded,afk/<N>→ claimable, route dispatch, and the template stampingdata-static.Mobile-first (single column, ~44px summary, reuses the
.menu/.btnidioms).Closes #136
Validation: PASS ✅ — merging via merge commit; this will auto-close #136.
go build ./...,go vet ./..., andgo test ./...run against the PR branch — all green (go testok, 42.7s). The repo's commit-time gate is eval-only and does not exercise the lab Go module, so this is the independent signal.Closes #136present ✓.handleDiscard→discardParked, which force-removes the worktree and force-deletes the branch, bypassing the guarded teardown — is doubly-gated byprojectDir(resolves against the scanned project list, no path traversal) andmanagedBranch(lab///afk/prefixes only); both are test-covered (TestHandleDiscard_rejectsNonManagedBranch,TestHandleDiscard_unguarded). New git helpers are read-only; per-field stats fail soft, enumeration fails loud. TemplateinnerHTMLis used only on the auto-escaped server fragment, error text viatextContent. Thedata-static+data-key="parked"morph contract that keeps the lazily-fetched body alive across polls is Go-test-guarded (TestLivePartial_parkedStrip).feat(dev):); CONTEXT.md updated with the "Parked work / Parked view" domain entry.