Skip to content

Readable line lengths and inline resolved cell edit functionality - #223

Merged
Avni2000 merged 29 commits into
mainfrom
readable-line-length
Apr 13, 2026
Merged

Avni2000 merged 29 commits into
mainfrom
readable-line-length

Conversation

@Avni2000

@Avni2000 Avni2000 commented Apr 12, 2026 •

Copy link
Copy Markdown
Owner

Readable line lengths look significantly better than not. That being said, designing around this UI was a challenge, mostly I envisioned:

  • unified cells being readable line length
  • conflicted cells being 2 (cur + inc) or 3 (base + cur + inc) columns
  • resolved cells being what we collapse those 2 or 3 columns down to; of readable line length.
    • Implementing this was quite a challenge, mostly because I didn't have a good picture in my mind of how I wanted it to save, show warnings, undo + show conflicts again, etc.

Summary by CodeRabbit

  • New Features

    • Inline edit mode for resolved conflicts with explicit Edit/Save and Undo controls plus a confirmation step when discarding edits
  • Bug Fixes

    • Autosave-on-blur to prevent edit loss and safer undo/redo/accept-all flows while editing
    • More reliable resolved-state detection and timing to avoid flakiness
  • Style

    • Refreshed resolved-row visuals, new accent color and “just saved” highlight
  • Tests

    • Added/updated end-to-end tests for edit/blur, per-cell resolution, undo/redo, and resolution flows

Avni2000 added 20 commits April 4, 2026 22:24
- readable line length
- unresolved conflicts appear clearly as empty red-hued and red-dashed-bordered cards
- selection inter resolved vs. unresolved (unified, conflicted) rows is messed up
- minor style issues
- fixes weird border for resolved rows
- looks like the edits don't actually save after we click off.
- respects point clicked
- respects selection intra code mirror resolved cell and inter cells of UI
- adds header bar with undo resolution button
- different style for deletion of cell
- still a bit buggy on newlines
- edit button is ugly :)
- prefers simpler button to harder-to-maintain DOM work
…ells

- Resolver store only stores total edit, not line by line or word by word edits; we abstract that away to code mirror
- Save when "save edit" is called, show a warning nonce when user tries to click off w/o saving.
- While cell is being edited, guard against any other global undo actions
Update helpers and all affected specs to match the new UI where resolved
cells start in a read-only static view and require an explicit Edit ->
save-edits round-trip.
- now, when a resolved cell is edited, the pressing undo gives a modal checking if the user is comfortable overwriting their commits.
the active row only leaves "save edits" available.

- extend editWarningOnBlur test that asserts other row actions are disabled until save.
- small cleanups on <pre> paths, unnecessary styles, etc.
…ompt on destructive actions

- guarantees:
  - linear history
  - no conflicts when trying to edit multiple cells
  - cm undo/redo vs global undo/redo still work just fine
    - focus => cm undo/redo
    - unfocus => global undo/redo
- modal on destructive actions (eg. "Apply resolution" or "Undo Selection")

reverts the last few commits creating the edit mode + modal when clicking off.
@coderabbitai

coderabbitai Bot commented Apr 12, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Implements inline resolved-cell editing with draft autosave/unmount-commit, tracks editing rows in store, gates destructive actions (undo/accept-all/history) behind a discard-confirmation modal that can queue the intended action, and updates tests/helpers to use .resolved-cell and new edit-mode utilities. (50 words)

Changes

Cohort / File(s) Summary
Core UI
packages/web/client/src/components/ConflictResolver.tsx, packages/web/client/src/components/MergeRow.tsx
Adds edit-mode lifecycle (props: isEditing, onStartEditing, onStopEditing, optional onClearChoice), draft autosave and unmount-commit, inline CodeMirror editor with line-wrapping, refactors resolve flow into applyResolutionNow + guarded handleResolve, and adds destructive-action confirmation modal with queued callbacks.
State / Store
packages/web/client/src/store/resolverStore.ts
Adds editingConflicts: Set<number> and actions startEditing, stopEditing, clearChoice; updates select/commit/acceptAll/undo/redo/jump/rematch/unmatch flows to clear/manage edit state and consistently record history.
Styling
packages/web/client/src/styles.ts
Introduces --accent-forest, .resolved-row-chrome wrapper with saved/delete variants and pulse animation, .resolved-cell / .resolved-content-static styles, CodeMirror selector fixes, scrolling/line-wrapping, and layout wrappers for readable/resolved rows.
Test helpers / integration utils
test-fixtures/shared/integrationUtils.ts
Extends ConflictChoiceInfo with optional cellData; adds getResolvedContentValue, enterResolvedEditMode, saveResolvedEdits, accept-all/history helpers, destructive-warning confirm helper, and resolved-side/type inference using .resolved-cell/.resolved-base strong.
E2E / Integration tests
packages/web/tests/*.spec.ts, apps/vscode-extension/tests/e2eResolution.test.ts
Updates tests to capture per-cell cellData before non-delete resolutions, switch selectors from .resolved-content-input to .resolved-cell, use new helpers (enterResolvedEditMode, saveResolvedEdits, getResolvedContentValue), and add assertions for edit-warning/undo-warning modals and autosave-on-blur behavior.

Sequence Diagram

sequenceDiagram
    actor User
    participant UI as ConflictResolver (UI)
    participant Row as MergeRow (Row)
    participant Store as ResolverStore
    participant Modal as WarningModal

    User->>Row: Click "Use ..." / Apply choice
    Row->>Store: selectChoice(index, choice, content)
    Store->>Store: remove index from editingConflicts
    Row->>Row: render static .resolved-cell

    User->>Row: Click "Edit"
    Row->>Store: startEditing(index)
    Store->>Store: add index to editingConflicts
    Row->>Row: show CodeMirror editor (draft)

    User->>Row: Type (draft)
    Row->>Row: update draft refs

    User->>Row: Click outside (blur)
    Row->>Row: autosave draft
    Row->>Store: commitContent(index, resolvedContent)
    Store->>Store: update choices, push history, clear takeAllChoice
    Row->>Store: stopEditing(index)
    Store->>Store: remove index from editingConflicts
    Row->>Row: show static .resolved-cell

    alt Destructive action while edits exist
        User->>UI: Click Undo / Accept All / Jump
        UI->>Modal: show "Discard edited resolutions?" (queue action)
        alt Keep edits
            User->>Modal: "Keep my edits"
            Modal->>UI: dismiss queued action
        else Discard edits
            User->>Modal: "Discard edits"
            Modal->>UI: invoke queued action
            UI->>Store: perform queued undo/acceptAll/jump
            Store->>Store: clear editingConflicts
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 I nibble at the merge with care,

Drafts tucked safe when blurs declare,
A modal pauses — "Keep or discard?"
Queued hops wait, nothing is marred,
Hoppity merge, neat and fair. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 65.52% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the primary changes: readable line lengths and inline resolved cell edit functionality, which are core themes throughout the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch readable-line-length

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 and usage tips.

@Avni2000
Avni2000 changed the base branch from MergeNB-playground-on-docusaurus-website to main April 13, 2026 00:03

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test-fixtures/shared/integrationUtils.ts (1)

150-196: ⚠️ Potential issue | 🟠 Major

verifyAllConflictsMatchSide() stopped verifying the resolved text itself.

This now treats a row as valid when the header says the right side and any resolved-content node exists. If the collapsed preview renders stale or wrong text for that side, the helper still reports success, so UI-only regressions in the resolved view go undetected. Preserve the chosen side’s source before resolving, or have callers pass the expected text so this helper can compare the rendered resolved content as well as the label.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/web/client/src/components/ConflictResolver.tsx`:
- Around line 106-134: The destructive handlers (undo, redo, jumpToHistory,
acceptAll, handleClearChoice and any other global actions) bypass
guardEditedResolutions and thus can commit/lose edited resolutions via
MergeRow's blur handler; update each place that currently calls the store
directly to instead call guardEditedResolutions(() => originalAction()) or,
where appropriate, early-disable the control when editingConflicts.size > 0;
ensure pendingDestructiveActionRef and setDestructiveActionWarning are used
consistently so the confirmation flow is shared, and add the same guard call for
any other handlers in the file (and the referenced ranges 549-699, 788-795) that
perform destructive/global state changes.

In `@packages/web/client/src/components/MergeRow.tsx`:
- Around line 81-83: The component MergeRow is rendering stale
draftResolvedContent when the editor switches out of edit mode; update the
effects that set draftResolvedContent (the useEffect at the shown block and the
similar blocks at the other noted ranges) to only copy
resolutionState.resolvedContent into draftResolvedContent when the row is
currently being edited (e.g., when isEditing/editingConflicts for this row is
true) or when resolutionState.resolvedContent actually changes while not
editing; otherwise, reset draftResolvedContent to the committed
resolutionState.resolvedContent so read-only mode always shows the committed
content. Reference the MergeRow component and the draftResolvedContent state and
the useEffect callbacks that currently depend on
resolutionState?.choice/resolvedContent and conflictIndex to make this
conditional update.
- Around line 79-80: The blur-suppression flag suppressBlurEditGuardRef.current
is being set in handleSaveEdits() and other handlers but never cleared, so it
incorrectly suppresses the first blur of the next edit session; change
handleSaveEdits() (and the other places that set
suppressBlurEditGuardRef.current, e.g., the other save/cancel handlers around
the referenced blocks) to clear the flag immediately after performing the save
(or schedule clearing on the next tick using setTimeout(...,0)) so
suppressBlurEditGuardRef.current is true only for the brief period needed to
ignore the current blur, and ensure the onBlur guard (the
relatedTarget?.closest('[data-editing-allow="true"]') check) continues to work
as intended.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c4597800-eb5a-4293-9179-b8a1bf8df972

📥 Commits

Reviewing files that changed from the base of the PR and between 57c46dc and a310314.

📒 Files selected for processing (12)
  • apps/vscode-extension/tests/e2eResolution.test.ts
  • packages/web/client/src/components/ConflictResolver.tsx
  • packages/web/client/src/components/MergeRow.tsx
  • packages/web/client/src/store/resolverStore.ts
  • packages/web/client/src/styles.ts
  • packages/web/tests/editWarningOnBlur.spec.ts
  • packages/web/tests/perCellResolution.spec.ts
  • packages/web/tests/settingsMatrix.spec.ts
  • packages/web/tests/syntaxHighlighting.spec.ts
  • packages/web/tests/takeAllButtons.spec.ts
  • packages/web/tests/undoRedoActions.spec.ts
  • test-fixtures/shared/integrationUtils.ts

- they all suffer from the same issue:
  - editing state => click (WLOG) undo => save current => actually (WLOG) undo
  - instead, what we want is to throw the warning modal for destructive actions like that while undoing.
    - if "keep editing," scroll to currently editing spot (mindful of virtualization)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/web/client/src/components/ConflictResolver.tsx (1)

636-648: 🧹 Nitpick | 🔵 Trivial

Simplify the redundant block in onKeyDown.

The extra braces around the handleJumpToHistory call are unnecessary and inconsistent with the rest of the file's style.

♻️ Suggested simplification
                                                onKeyDown={event => {
                                                    if (event.key === 'Enter' || event.key === ' ') {
                                                        event.preventDefault();
-                                                        {
-                                                            handleJumpToHistory(index);
-                                                            setHistoryOpen(false);
-                                                        }
+                                                        handleJumpToHistory(index);
+                                                        setHistoryOpen(false);
                                                    }
                                                }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/client/src/components/ConflictResolver.tsx` around lines 636 -
648, The onKeyDown handler contains an unnecessary extra block; remove the
redundant braces so the handler directly calls handleJumpToHistory(index) and
setHistoryOpen(false) when event.key is 'Enter' or ' ' to match the style used
in the onClick handler and elsewhere; update the onKeyDown for the same element
that references handleJumpToHistory and setHistoryOpen to simply
preventDefault() then call those two functions without the extra { } wrapper.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/web/client/src/components/MergeRow.tsx`:
- Around line 78-80: The blur-suppression ref suppressBlurEditGuardRef is left
true when handleSaveEdits sets it then calls onStopEditing, causing the editor
to unmount before onBlur fires and the flag persists into the next edit session;
modify handleSaveEdits (and the other save paths referenced around lines with
suppressBlurEditGuardRef usage) to clear suppressBlurEditGuardRef.current after
calling onStopEditing by scheduling the clear on a microtask (e.g.,
Promise.resolve().then(() => suppressBlurEditGuardRef.current = false)) or
remove the flag entirely and rely on the existing
relatedTarget?.closest('[data-editing-allow="true"]') guard in the onBlur
handler to handle blur-to-save-button cases; update the same pattern where
suppressBlurEditGuardRef is set (including other save handlers) so the flag does
not persist across unmounts.
- Around line 81-83: The read-only view shows stale draft because
draftResolvedContent (managed by setDraftResolvedContent in the useEffect inside
MergeRow) isn't cleared when isEditing becomes false; update the rendering so
that the read-only <pre> uses resolutionState?.resolvedContent directly instead
of draftResolvedContent when not editing, and apply the same change for the
other occurrence mentioned (the block around the symbols at lines ~372-375).
Locate the useEffect that sets draftResolvedContent and the JSX that renders
draftResolvedContent, and conditionally render resolutionState?.resolvedContent
whenever isEditing is false (or editingConflicts was cleared) to avoid showing
uncommitted drafts.

---

Outside diff comments:
In `@packages/web/client/src/components/ConflictResolver.tsx`:
- Around line 636-648: The onKeyDown handler contains an unnecessary extra
block; remove the redundant braces so the handler directly calls
handleJumpToHistory(index) and setHistoryOpen(false) when event.key is 'Enter'
or ' ' to match the style used in the onClick handler and elsewhere; update the
onKeyDown for the same element that references handleJumpToHistory and
setHistoryOpen to simply preventDefault() then call those two functions without
the extra { } wrapper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ff2e0c2c-cef4-4b8a-aefe-347cd891ff90

📥 Commits

Reviewing files that changed from the base of the PR and between a310314 and bb462bf.

📒 Files selected for processing (5)
  • packages/web/client/src/components/ConflictResolver.tsx
  • packages/web/client/src/components/MergeRow.tsx
  • packages/web/tests/takeAllButtons.spec.ts
  • packages/web/tests/undoRedoActions.spec.ts
  • test-fixtures/shared/integrationUtils.ts

When a user clicked the Save button while editing a resolved cell, a race
condition caused the `suppressBlurEditGuardRef` flag to persist into the next
edit session, requiring two blur events to exit edit mode instead of one.

Verify the fix by:
1. Enter edit mode on a resolved cell
2. Make some changes
3. Click the Save button
4. Enter edit mode again
5. Click outside the editor (blur)
6. Should exit edit mode on the first blur

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
packages/web/client/src/components/ConflictResolver.tsx (1)

145-159: ⚠️ Potential issue | 🟠 Major

Undo/redo/history/take-all still tear down edit mode before the guard opens.

These actions are only guarded in onClick, unlike Apply Resolution at Line 719. If a resolved CodeMirror is focused, clicking one of these controls lets MergeRow blur/autosave and call onStopEditing before the warning modal appears. Choosing “Keep my edits” then preserves the content, but the edit session is already gone. Give these controls the same pre-blur interception as handleResolveMouseDown, or disable them while editingConflicts.size > 0.

Also applies to: 574-699, 719-720

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/client/src/components/ConflictResolver.tsx` around lines 145 -
159, The undo/redo/history/take-all handlers (handleUndo, handleRedo,
handleAcceptAll, handleJumpToHistory) call guardEditedResolutions only on click,
allowing focused editors to blur/autosave before the guard opens; change these
controls to either (a) perform the guard on mouse-down like
handleResolveMouseDown (invoke guardEditedResolutions from the onMouseDown
handler so blur is prevented until the modal is resolved) or (b) disable the
controls while editingConflicts.size > 0 (check editingConflicts.size and set
disabled state) so they cannot trigger blur; update the UI event wiring
accordingly for those four handlers to ensure pre-blur interception.
packages/web/client/src/components/MergeRow.tsx (1)

166-170: ⚠️ Potential issue | 🟠 Major

Manual save leaves the blur-suppression flag armed for the next edit session.

The blur-to-save-button path is already skipped by the relatedTarget?.closest('[data-editing-allow="true"]') check at Lines 363-364. After that, handleSaveEdits() sets suppressBlurEditGuardRef.current = true and immediately unmounts the editor via onStopEditing, so nothing clears the flag. The next real blur is then swallowed and won't autosave/exit edit mode. Remove the flag from the save path or clear it asynchronously right after onStopEditing.

Also applies to: 358-365

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/client/src/components/MergeRow.tsx` around lines 166 - 170,
handleSaveEdits currently sets suppressBlurEditGuardRef.current = true and then
calls onStopEditing, leaving the suppression flag armed for the next edit
session; update handleSaveEdits (and the duplicate path around the other save
call) to either not set the flag at all or clear it asynchronously after
unmounting the editor — e.g., call onStopEditing(conflictIndex) then schedule
suppressBlurEditGuardRef.current = false on the next tick (setTimeout(..., 0) or
queueMicrotask) so the immediate manual-save flow still prevents the blur-guard
but subsequent blurs behave normally.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/web/client/src/components/MergeRow.tsx`:
- Around line 91-98: The current useEffect cleanup captures stale values and
runs on dependency changes causing duplicate callbacks; change to an
unmount-only effect by replacing the current useEffect([...]) with useEffect(()
=> { return () => { ... } }, []) and read current values from refs instead of
the closed-over variables: maintain and update refs for isEditing (e.g.,
isEditingRef.current) and for the latest resolved content (e.g.,
latestResolvedContentRef.current) whenever isEditing or
resolutionState?.resolvedContent change, then in the unmount cleanup compare
draftResolvedContentRef.current to latestResolvedContentRef.current and
conditionally call onCommitContent(conflictIndex,
draftResolvedContentRef.current) and onStopEditing(conflictIndex); keep
references to onCommitContent/onStopEditing/conflictIndex stable or read them
from refs if they can change.

---

Duplicate comments:
In `@packages/web/client/src/components/ConflictResolver.tsx`:
- Around line 145-159: The undo/redo/history/take-all handlers (handleUndo,
handleRedo, handleAcceptAll, handleJumpToHistory) call guardEditedResolutions
only on click, allowing focused editors to blur/autosave before the guard opens;
change these controls to either (a) perform the guard on mouse-down like
handleResolveMouseDown (invoke guardEditedResolutions from the onMouseDown
handler so blur is prevented until the modal is resolved) or (b) disable the
controls while editingConflicts.size > 0 (check editingConflicts.size and set
disabled state) so they cannot trigger blur; update the UI event wiring
accordingly for those four handlers to ensure pre-blur interception.

In `@packages/web/client/src/components/MergeRow.tsx`:
- Around line 166-170: handleSaveEdits currently sets
suppressBlurEditGuardRef.current = true and then calls onStopEditing, leaving
the suppression flag armed for the next edit session; update handleSaveEdits
(and the duplicate path around the other save call) to either not set the flag
at all or clear it asynchronously after unmounting the editor — e.g., call
onStopEditing(conflictIndex) then schedule suppressBlurEditGuardRef.current =
false on the next tick (setTimeout(..., 0) or queueMicrotask) so the immediate
manual-save flow still prevents the blur-guard but subsequent blurs behave
normally.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6d1bdd33-d8a4-421a-8814-1508d0d183e8

📥 Commits

Reviewing files that changed from the base of the PR and between bb462bf and b5a2dd4.

📒 Files selected for processing (2)
  • packages/web/client/src/components/ConflictResolver.tsx
  • packages/web/client/src/components/MergeRow.tsx

…blur, then clicks button.

- each affected control now intercepts onMouseDown, so if a cell is being edited, it'll bring up a warning modal.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/web/client/src/components/ConflictResolver.tsx`:
- Around line 138-143: confirmDestructiveActionWarning currently calls the raw
store actions (undo, redo, acceptAll, jumpToHistory) directly, bypassing
guardEditedResolutions; change it to invoke the existing safe wrapper handlers
(the onMouseDown-safe wrappers already defined around those actions) so that
after confirmation the guarded handlers run instead of raw actions—locate
confirmDestructiveActionWarning and replace the direct action invocations with
calls to the corresponding safe wrapper functions that call
guardEditedResolutions before dispatching the store actions.
- Around line 301-304: In ConflictResolver.tsx the drag-selection hit test uses
target?.closest(...) and currently checks for '.resolved-content-input' but the
read-only resolved view renders '.resolved-content-static', so starting a
selection there doesn't set isDraggingRef; update the selector used in the
target?.closest call (the one guarding isDraggingRef / drag start logic) to
include '.resolved-content-static' alongside '.resolved-content-input' so the
read-only view is treated the same as the editable one during drag selection.
- Around line 165-176: The modal's action buttons are missing the allow-list
attribute so the CodeMirror blur handler (which early-returns when
relatedTarget.closest('[data-editing-allow="true"]')) still commits via
onCommitContent() before dismissDestructiveActionWarning() or
confirmDestructiveActionWarning() run; update the destructiveActionModal and any
other modal/button elements referenced in handleResolveMouseDown and
mouseDownGuardActiveEditing to include data-editing-allow="true" on both the
"Keep my edits"/dismiss and "Proceed anyway"/confirm buttons so focus
transitions to those buttons bypass the commit in the blur handler.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 10e634a9-e5d8-4bd1-ac0a-61b31d345852

📥 Commits

Reviewing files that changed from the base of the PR and between b5a2dd4 and fda1d16.

📒 Files selected for processing (2)
  • packages/web/client/src/components/ConflictResolver.tsx
  • packages/web/client/src/components/MergeRow.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/web/client/src/components/MergeRow.tsx`:
- Around line 198-215: The modal opens outside the editor and its focus shift
triggers the editor's blur autosave; to fix, ensure the modal root rendered by
renderViewportModal when showUndoWarning is true includes the editing-allow
marker so the editor ignores the focus move (add data-editing-allow="true" to
the outermost <div> passed into renderViewportModal for the undo warning modal),
and do the same for the other modal usages mentioned (the other
renderViewportModal instances around the same code paths). This ensures clicking
the Cancel/Confirm buttons (handlers cancelUndoResolution and
confirmUndoResolution) won't cause the editor blur autosave to run before those
handlers execute.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 061f43ab-1e9d-4f5b-831b-ef57a281027f

📥 Commits

Reviewing files that changed from the base of the PR and between fda1d16 and b14a10b.

📒 Files selected for processing (1)
  • packages/web/client/src/components/MergeRow.tsx

- Include `.resolved-content-static` in drag-selection detection.
- Mark the destructive-action warning modal as edit-safe via `data-editing-allow`.
- Route mousedown-guarded actions (undo/redo/history jump/take-all) through the guarded handlers so confirmations still respect edited-resolution checks.
@Avni2000 Avni2000 changed the title Readable line lengths and enhanced resolved cell edit functionality Readable line lengths and inline resolved cell edit functionality Apr 13, 2026
@Avni2000
Avni2000 merged commit 2048f0f into main Apr 13, 2026
5 checks passed
@Avni2000
Avni2000 deleted the readable-line-length branch April 13, 2026 03:52
@Avni2000
Avni2000 restored the readable-line-length branch April 13, 2026 03:56
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