Lite: use branch operand as source/target for whole branch rather than just branch reference#13807
Lite: use branch operand as source/target for whole branch rather than just branch reference#13807OliverJAsh wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts Lite workspace outline operations so a branch operand represents the whole branch segment rather than only the branch reference.
Changes:
- Wraps the full branch segment with
OperandCso branch source/target behavior applies to the whole segment. - Limits
referenceBytesrelative moves toabovebranch targets to avoid treating “below branch” as below only the reference.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
apps/lite/ui/src/routes/project/$id/workspace/OutlinePanel.tsx |
Moves branch operand wrapping from just BranchRow to the full branch TreeItem. |
apps/lite/ui/src/operations/operation.ts |
Updates branch-target relative move matching to only allow above branch-reference moves. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: daee7a5508
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // contents. However, `RelativeTo` is interpreted to mean just the | ||
| // branch reference rather than the whole branch (reference + contents), | ||
| // meaning we `below` won't work as expected. | ||
| side: "above", |
There was a problem hiding this comment.
Restore below-reference moves onto branches
When a commit is moved onto a branch target with side: "below", this new branch match no longer produces a relativeTo, so getOperations() disables moveBelow entirely for branch operands. That removes the UI path for moving a commit onto an empty branch/branch header; the existing CLI/TUI implementations perform that exact operation as RelativeTo::Reference(...), InsertSide::Below in crates/but/src/command/legacy/status/tui/operations.rs:273-278 and crates/but/src/command/legacy/rub/mod.rs:709-714. Please keep a separate branch-reference target or allow the commit-to-branch below case to continue using referenceBytes.
Useful? React with 👍 / 👎.
7b94edf to
f6a3694
Compare
daee7a5 to
eb22290
Compare
eb22290 to
0c352ac
Compare
0c352ac to
4b70a16
Compare
4fded45 to
9da0c0b
Compare
4b70a16 to
9700aea
Compare
9da0c0b to
f00a6ac
Compare
9700aea to
355bf40
Compare
… branch reference
355bf40 to
6329862
Compare
Table of all permutations for future reference. In Jujutsu I believe all of these operations can be expressed as follows, using
-rfor commit sources and-bfor branch sources:jj rebase <source> -A <target>jj rebase <source> -o <target>jj rebase <source> -B <target>moveBranchmoveBranchcommitMovewithrelativeTo: { type: "referenceBytes" }commitMovewithrelativeTo: { type: "referenceBytes" }commitMovewithrelativeTo: { type: "referenceBytes" }commitMovewithrelativeTo: { type: "commit" }commitMovewithrelativeTo: { type: "commit" }