Repository navigation
feat(ui): show each worked project's uncommitted +/- in Details - #21
guilhermexp wants to merge 7 commits into
Conversation
|
@coderabbitai review |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No merge-blocking issue was found; the worked-project counters and watch lifecycle are ready for normal merge checks. Pre-merge checks |
|
✅ Action performedReview finished.
|
|
| let request: zeron_rpc::ClientFrame = | ||
| serde_json::from_str(&requests.try_recv().unwrap()).unwrap(); | ||
| assert_eq!(request.params["cwds"], serde_json::json!(paths)); | ||
| sidebar.update(window, |sidebar, cx| sidebar.hide_worked_project_diffs(cx)); |
There was a problem hiding this comment.
Hidden-panel test bypasses Shell
This test calls hide_worked_project_diffs directly, so it still passes if Shell::render stops calling that helper. A later change could leave checkout watches running while Details is hidden without this test catching it.
Add a test using Shell that starts the watch, closes Details or opens Settings, checks the cancellation request, and reopens Details to check a fresh subscription. This is a non-blocking coverage improvement.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
What
In the Details sidebar (Orchestrator mode), each row of Projects worked now shows the same
+A / −Dcounter as the Project row: the uncommitted changes (including new files) of that project's checkout, right-aligned, with the same colors and separator.WorkersModel::reveal_project).How
WatchCheckoutDiffsaccepts an optionalcwdslist next to the existingcwd. It pins every checkout in the list for the life of the stream and releases all pins on drop; a non-git path does not affect the others. No entity or wire format changed. Without a pin, a checkout no chat points at (the usual Workers project) is never captured.details_sidebar/worked_project_diffs.rsopens one local subscription for the section, keyed by the local device and the sorted set of paths, instead of one stream per project (each stream carries every diff with its patch). The Workers registry is local, so the watch never goes to a remote chat's device. Rows match the diff by exactcwd.Shell::render). If the subscription fails or the stream ends, the current task clears its key so the next render subscribes again, without a redraw loop when the failure repeats.add-worked-project-diff-totals(proposal, tasks, delta spec) and DOX incrates/ui/AGENTS.mdandcrates/engine/AGENTS.md.Known limit (in the spec): a project registered below the repository root (a monorepo subfolder) or through a symlink shows no counter, because the engine reports the diff with the canonical git root as
cwd. Summing the whole repository into a subfolder row would be misleading.Testing
All on Linux (Ubuntu 24.04), on the agents box.
worked_project_rows_show_only_their_own_diff(GPUITestAppContext, in its own file): with the product code from before this change it fails onfirst project's +17 / −4 must appear; it passes here. It also checks that a project without a diff shows nothing and that an unrelated checkout's+999 / −888never appears.worked_project_diff_lifecycle_tests.rs): worktree row with a long name, remote chat still using the local watch, one stream across renders, collapsed section without a stream, incremental update, clean and unavailable snapshots, stream end and immediate failures without redraw loops, hide and show.checkout_diff_watch_pins_multiple_paths_and_releases_on_drop: two orphan repos plus a non-git folder in one stream; both diffs arrive, survive reconcile past the orphan grace, and retire after the stream is dropped.cargo fmt --all -- --check,cargo test --locked -p zeron-ui --lib(2263 passed; the pre-existing Linux-only failuremarkdown::link_interaction::rendered_tests::file_link_menu_hides_system_rows_for_remote_and_web_links, already failing onmain, is skipped by name) andcargo test --locked -p zeron-engine --lib(577 passed, 4 ignored).openspec validate add-worked-project-diff-totals --strictpasses.scripts/dev-demo.sh, isolated profiles, Xvfb with llvmpipe): an Orchestrator chat touching two temporary git repos registered as Workers projects. Before: both rows without counters. After:+5 / −2on the dirty repo (git diff --shortstat HEADgives +3/−2, plus a 2-line new file) and nothing on the clean one. One more line updated it to+6 / −2live, without reopening the chat.abb03ffdand61803952. The last round had no findings (CodeRabbit was out of quota in that round).Summary by CodeRabbit