Skip to content

fix: drop groups emptied in the interactive editor instead of aborting the session - #129

Open
vitali87 wants to merge 1 commit into
fix/interactive-move-recompute-locfrom
fix/editor-drops-empty-groups
Open

fix: drop groups emptied in the interactive editor instead of aborting the session#129
vitali87 wants to merge 1 commit into
fix/interactive-move-recompute-locfrom
fix/editor-drops-empty-groups

Conversation

@vitali87

@vitali87 vitali87 commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

Moving every hunk out of a group in the interactive editor ended the session with Groups ['pr-2'] are empty after editing. and exit 1 — all other edits were thrown away. Dissolving a group is a legitimate edit.

split now drops emptied groups (Dropped empty group(s) after editing: pr-2), rewires their dependants to the nearest kept ancestors (chains of emptied groups collapse transitively; a dropped root leaves its dependants as roots; diamonds keep both surviving parents), then re-validates the reduced plan. It only errors when every group is empty. README's editor paragraph now describes this.

Stacked on #60 (stack #74 = #58#60#129) because #60 recomputes LOC after each move — without it the dropped group's stale estimated_loc made validate_loc fail.

Test plan

  • TestDropEmptyGroups: no-op, single drop with inheritance, dropped root, transitive chain (unmasked), direct-edge dedup, diamond through dropped groups
  • TestEditorEmptiedGroupEndToEnd: unmocked _interactive_edit → drop → real validate_plan returns []
  • TestSplitEditorEmptiedGroup: CLI saves the one-group plan; all-empty exits 1
  • Review verified the e2e fixture (move a.py:2 pr-2 pr-1, done) now exits 0 with a valid one-group plan
  • 470 tests pass, ruff clean
  • Local review: 5/5 (after three fix→re-review rounds)

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dc58b6f5-1e2e-4ea8-a7a8-45f4a9980710

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vitali87
vitali87 force-pushed the fix/editor-drops-empty-groups branch from bdad187 to d07c3ed Compare August 30, 2026 16:38
@vitali87
vitali87 changed the base branch from fix/reject-out-of-range-hunk-indices to fix/interactive-move-recompute-loc August 30, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant