feat(ui): Analyze/Refine top-bar flow with incremental refinement - #17
feat(ui): Analyze/Refine top-bar flow with incremental refinement#17jakob1379 wants to merge 1 commit into
Conversation
Top bar: plain Analyze and Refine buttons replace the in-panel refinement banner. Analyze is blue before an analysis exists, red once one is loaded, and asks for a second click before discarding current groups. Refine greys out with a tooltip naming why it is unavailable. Refinement: incremental mode carries the previous refined grouping onto a fresh analysis and asks the LLM only for adjustments; in-flight jobs can be cancelled; a cached refinement is only auto-applied after re-analysis when its head commit and full file set match the fresh diff, otherwise it becomes the baseline for the next update. Review fixes: re-analysis cancels an in-flight refinement and rejects its pending stream so the top bar cannot stick on "Refining"; a job that finishes after a fresh analyze no longer overwrites it; the in-memory refinement baseline is cleared on every analyze so it cannot leak across repos; carried-over groups only keep files the fresh pass still groups; the PR head watcher no longer emits a phantom push when its seed poll failed. Adds a `typecheck:e2e` script so spec files are type-checked without launching a browser.
|
Here's a thought, should we just have 2 buttons.
Then allow the user to specifically set a default in the UI? We want to minimize clicks here. |
I'm not sure I made it clear enough, the the red re-analyze was also meant for when something upstream is pushed to e.g. the PR you are looking at. To continue on this it might be worth thinking about the other potential clicks around the UI. What about analyze flow, though it might be a token-heavy operation, its almost always the feedback I reach for, at least for larger MRs. What are your thought here, do you think there is an elegant way to bind them together? |
|
Having thought about it, my suggestion is as follows:
Then people can opt out of using an LLM pass but it's a single click for users that just want to run the automated review. The other thing to consider here is that we might want to pass the existing groupings to claude if we are doing a reanalysis (changed code upstream). It's worth checking we do this rather than starting from scratch, as we could then just look at new files and merge/change groupings rather than reading the entire context again. |
|
Agreed. Red and a double verify as to not accidentally lose the current state. This will make the width of but button constant without changing wording. Regarding context forwarded I partly agree. The simple approach is purge an re-run. Alternatively we will have to follow the edges to find the affected code by the recent changed, and updated relevant groups based on this. What would be your primary concern on what to optimize here? I am not sure incremental updates like this necessarily saves tokens. |
|
My view point would be on the concern is as the diffsize grows, the search grows. Imagine if 1 file had changed and we throw away at 200 file grouping to start re-grouping. Re-analysis - small edits: We probably want something like if there is less than 10% of new files -> add new files to be classified into the existing groups. |
|
I'll see if a can make the traversal work to ensure we only hit the right stuff, then :D |
|
Cool, just to clarify:
Hope that clarifies that we're trying to save tokens + search time on LLMs, not necessarily graph traversal. |
Summary
Top bar. Two plain buttons replace the in-panel refinement banner.
Refinement backend.
carry_over_grouping).RefinementResultrecordshead_shaand the coveredfiles; older cached JSON still deserializes (tested).File 'src/sepseeq/cli.py' not found in diffafter re-analyzing with a stale cached refinement.Also: PR/MR head polling with a "New commits" bar, and a
typecheck:e2enpm script so Playwright spec files are type-checked without a browser.Preview
Tests
cargo test -p diffcore-core -p diffcore-tauri: 2229 passed, 0 failed.npx tsc --noEmitandnpm run typecheck:e2e: clean.npm run build: OK.