feat: jj-lib stash with dual-pane browser and Apply… flow - #241
Open
Ziinc wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Thin orchestration over jj + local_db: resolve workspace roots, mint bookmark names, and persist metadata (LOC, files, labels) for the browser UI.
- Apply target uses the same
.home-endpoint convention astreq mv - Diff/patch resolve via the stash commit id so the preview is isolated from any target branch
There was a problem hiding this comment.
Stash commits are real jj commits kept reachable via treq/stash/… bookmarks (filtered from get_branches).
- Apply overlays stash file values onto the target WC tree (
MergedTreeBuilder) so the stash itself stays intact and re-applicable - Checkout passes
old_wc = Noneafter snapshot because tree_state already matches disk — avoids ConcurrentCheckout (same pattern as restore_file)
There was a problem hiding this comment.
New stashes table mirrors prompt_history patterns: additive schema in init_local_db, denormalized workspace_label, JSON files_changed.
- Keeps stash index queryable even if a source workspace is later deleted
- Bookmark name stored so delete can drop the jj reachability ref
There was a problem hiding this comment.
Dual-pane browser modeled on PromptHistoryModal: list metadata on the left, isolated get_stash_diff on the right.
- More menu: apply-to-workspace submenu (copy semantics), copy as git patch, delete
- Apply does not remove the stash entry — matches the “local gist” re-apply requirement
|
Apply… UX rationale (this commit)
|
|
Commit stash rationale
|
Ziinc
marked this pull request as ready for review
August 12, 2026 03:57
Stash working-copy changes into immutable commits (local gist storage), browse them in a dual-pane modal, apply as copies onto any workspace, export git patches, and delete stash entries. Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Pass None for old WC after snapshot to avoid ConcurrentCheckout, move stash-all handler out of the oversized useFileActions hook, and add integration + screenshot coverage for the dual-pane modal. Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Replace nested apply-to-workspace with an Apply… popover of activity-sorted workspaces, plus New workspace… that opens create with the stash preselected and Create & apply stash (copy via applyStash, stash stays immutable). Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Park an existing commit into the stash browser (duplicate under treq/stash bookmark, abandon from branch), then apply via the existing Apply… flow onto another or new workspace. Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/jj-stash-dual-pane-dc83
branch
from
August 12, 2026 05:42
7e31579 to
7edbff4
Compare
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
Adds immutable working-copy and commit stashing backed by jj-lib. Stashed changes act like local gist storage: they are parked under
treq/stash/…bookmarks, browsed in a dual-pane modal, and can be copied onto any workspace (or new workspace) via Apply….Backend
stashestable in the local SQLite DBjj_stash_working_copy/jj_stash_commit/jj_apply_stash_commit/jj_export_commit_git_patch/jj_delete_stash_bookmarkFrontend
StashModalwith Apply… popover (Home + activity-sorted workspaces) and New workspace…Tests / QA
Stash commit action
Stash modal after commit stash
Applied on target
To show artifacts inline, enable in settings.