Repository navigation
sidebar: async project tree loads with stale-result protection - #668
Closed
andyrewlee wants to merge 1 commit into
Closed
andyrewlee wants to merge 1 commit into
andyrewlee wants to merge 1 commit into
Conversation
…ction Move every os.ReadDir off the Bubble Tea Update goroutine: expand, refresh, workspace switch, and hidden-toggle now return commands that produce immutable ProjectTreeDirectoryLoaded snapshots. Update remains the sole owner of tree nodes and applies a result only when its workspace generation and per-node request identity still match, so superseded refreshes, collapse- during-load, and workspace churn can never mutate current state. Reads run through a bounded per-tree scheduler (4 in flight, FIFO queue); superseded queued jobs are dropped before they ever run, and stale running jobs release their slots on delivery without publishing content. Refresh keeps the old tree visible behind a shadow root, then restores expansion and selection by path as each remembered listing arrives — unless the user navigated in between. Results route through TabbedSidebar.Update and the app input switch regardless of focus or active tab. Failed reads surface a sanitized node-local marker instead of masquerading as an empty directory. Gates: go test -race ./internal/ui/sidebar green; full make test-race green; verify-loop green; harness-presets ran clean; lint-strict-new 0 issues. Ambient: PERF_STRICT=1 perf-check exceeds baselines on all presets at load ~60 — identical failure on parent commit 55ebdd5 (host contention, not a render regression). test-race-tmux/devcheck e2e hit the known TempDir RemoveAll teardown flake twice; all assertions passed.
8 tasks done
Owner
Author
|
Superseded — content landed on main via merge 8580442 (plans/ scaffolding intentionally excluded). |
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.
Summary
Stacked on #667 (plan 054). Implements plan 055: the project tree no longer performs
os.ReadDiron the Bubble Tea Update goroutine.SetWorkspace, expand, refresh,.hidden-toggle, and rebase-fallback all returntea.Cmd; commands snapshot the per-modelreadDirseam and a path — never a mutable node — and yield immutableProjectTreeDirectoryLoadedresults.Updateremains the sole owner of every node.pendingRequest); superseded refreshes, collapse-during-load, cross-workspace stragglers, and pre-rebase reads are all discarded without mutating the tree. Queued obsolete jobs are dropped before ever running.ReadDircan't be canceled — retained as a documented limitation).pendingRoot; remembered expansion paths restore incrementally as listings arrive, and selection restores by path — unless the user navigated during the refresh (navVersionfence), in which case their cursor wins. Deleted targets fall through to the flat-list clamp.…-suffix error +rretry hint; it never renders as an empty directory. Root load shows aLoading…state.TabbedSidebar.Updateandinternal/approuteProjectTreeDirectoryLoadedto the tree regardless of focus or active tab (same pattern asBranchChangesLoaded/AheadBehindLoaded); follow-up restore commands propagate as returned cmds.ARCHITECTURE.mdnames the leaf-widget async boundary; README gains the Project-tab key table;docs/CONFIG.mdanddocs/ORCHESTRATION.mddocument the loading contract (no config/session surface).Test plan
go test -race ./internal/ui/sidebar ./internal/app— greenenv -u AMUX_WORKSPACES_ROOT make test-race— all packages greenenv -u AMUX_WORKSPACES_ROOT make verify-loop— greenmake harness-presets— all presets rendermake lint-strict-new— 0 issuesgit diff --check— cleanPERF_STRICT=1 make perf-check— exceeds baselines on all 3 presets at host load ~60; identical failure reproduced on parent commit 55ebdd5 (ambient contention, not a render regression; the changed code adds ~2 comparisons per rendered row and isn't exercised by the monitor preset at all).make test-race-tmux/make devcheck— all assertions pass including tmux/pty race suites; e2e hit the known ambientt.TempDir RemoveAllteardown flake twice (unlinkat ... directory not empty) — same signature recorded on plans 050/051/054.