Skip to content

fix(editor): restore unmerge option + in-editor merge confirmation (#691)#1024

Open
sampjvv wants to merge 1 commit into
mainfrom
691-restore-unmerge-option
Open

fix(editor): restore unmerge option + in-editor merge confirmation (#691)#1024
sampjvv wants to merge 1 commit into
mainfrom
691-restore-unmerge-option

Conversation

@sampjvv
Copy link
Copy Markdown
Contributor

@sampjvv sampjvv commented Jun 3, 2026

What & why

Fixes #691"merged content no longer shows the option to unmerge" — plus a UX follow-up on the merge confirmation.

1. Unmerge button no longer showed (the reported bug)

In Source Editing (correction) mode the provider intentionally keeps merged cells in the translation units so they can be unmerged, and CellContentDisplay renders a Cancel merge button on them. But CellList was filtering merged cells out in exactly that mode (filteredTranslationUnits), so the merged cell never reached CellContentDisplay and the button could never render.

The filter contradicted the rest of CellList, which already styles merged cells (greyed at opacity: 0.5, line number). Removing it restores the intended behavior; it's safe because the provider already strips merged cells in every other mode.

2. Merge confirmation moved into the editor

Confirming a merge used a native vscode.window.showWarningMessage, which pops up in the bottom-right corner of the screen — far from the cell — and wrongly said the action "cannot be undone" (merges are reversible via unmerge).

It's now a small in-editor modal (the same Dialog pattern as the existing auth/offline modals) with reversible wording and Cancel / Merge buttons. confirmCellMerge is only posted once the user confirms; the handler no longer shows the native dialog (its child-cell guard is preserved), and the now-unused message payload field is removed from the type.

Note: per the ticket, unmerge intentionally only re-exposes the cell (sets merged: false); it does not reverse the content concatenation. That behavior is unchanged here.

Changes

  • webviews/.../CodexCellEditor/CellList.tsx — remove the merged-cell filter.
  • webviews/.../CodexCellEditor/CellContentDisplay.tsx — in-editor merge-confirmation modal.
  • src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts — drop the native confirmation from confirmCellMerge.
  • types/index.d.ts — remove the unused message field from confirmCellMerge.
  • Tests: CellList.mergedCellUnmerge.test.tsx, CellContentDisplay.mergeConfirm.test.tsx.

Testing

  • Webview suite: 160 passed / 2 skipped (19 files), including the 2 new tests.
  • ESLint: 0 new warnings; extension typecheck clean for the changed files.
  • Manual: Source Editing Mode → merge a non-first cell → in-editor modal appears (not the screen corner); Cancel aborts, Merge proceeds and the merged cell stays greyed with a working unmerge button.

🤖 Generated with Claude Code

…ditor (#691)

Merged cells stopped showing the unmerge button in Source Editing mode:
CellList filtered merged cells out in exactly the mode where the provider
intentionally keeps them, so the "Cancel merge" button could never render.
Remove that filter so merged cells render (greyed out) with the unmerge
button again.

Also replace the native VS Code merge-confirmation popup — which appeared
in the bottom-right corner of the screen and wrongly claimed the action
"cannot be undone" — with a small in-editor confirmation modal using
reversible wording. confirmCellMerge no longer shows the native dialog
(its child-cell guard is preserved), and the now-unused `message` payload
field is dropped.

Adds regression tests for unmerge-button visibility and the confirmation
modal gating the merge.

Fixes #691

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Bug: merged content no longer shows the option to unmerge

1 participant