Skip to content

FE-665: Show per-patch diffs in the staged-changes overlay#108

Open
kostandinang wants to merge 4 commits into
ka/fe-665-staged-edit-diffsfrom
ka/fe-665-overlay-diff-details
Open

FE-665: Show per-patch diffs in the staged-changes overlay#108
kostandinang wants to merge 4 commits into
ka/fe-665-staged-edit-diffsfrom
ka/fe-665-overlay-diff-details

Conversation

@kostandinang
Copy link
Copy Markdown
Contributor

@kostandinang kostandinang commented May 7, 2026

What

Drops <ContentDiff> into PatchListOverlay so the diff is visible even when the side-chat panel is closed.

Stacked on #107. Second FE-665 slice.

Linear: FE-665.

How

  • EditPatch gains optional currentContent?: string so the overlay can render diffs without re-querying.
  • Overlay's N pending changes label becomes click-to-expand. Expanded state renders a per-patch list with summary + word-level diff. Auto-collapses when staged count returns to 0.
╭ N pending changes · Undo · Apply ╮     ← collapsed
              ↓ click
╭ ▾ N pending changes · Undo · Apply ╮
│ • Edit C1 — soften wording          │
│   Use ⎯⎯SQLite⎯⎯ Postgres for…    │   ← diff inline
│ • Annotate C2 — clarify exclusion   │

Out of scope

Per-patch actions (Discard, Apply-one) in the overlay; new mutation paths.

Test plan

  • Close the side-chat with staged edits; click N pending changes in the overlay; see diffs inline

@kostandinang kostandinang self-assigned this May 7, 2026
@kostandinang kostandinang force-pushed the ka/fe-665-overlay-diff-details branch from 6e427ef to 5ffdee6 Compare May 7, 2026 20:54
@kostandinang kostandinang marked this pull request as ready for review May 8, 2026 13:00
@cursor
Copy link
Copy Markdown

cursor Bot commented May 8, 2026

PR Summary

Medium Risk
Medium risk because it changes the core staged-changes overlay UI/state behavior and extends the staged patch data shape (EditPatch.currentContent, anchorReferenceCode), which could affect patch staging/rendering across surfaces.

Overview
Adds an expand-to-detail mode to PatchListOverlay: the N pending changes label becomes an aria-expanded toggle that reveals a per-patch list under the sticky bar and auto-collapses when the staged count returns to 0.

Expanded rows render a kind-tinted reference badge (anchorReferenceCode), an ImpactChip, and—for edit patches only—a word-level ContentDiff when currentContent is available and differs from newContent (otherwise summary-only).

Extends patch staging to capture more snapshot data: EditPatch gains optional currentContent, and side-chat-host now stages patches with anchorReferenceCode and currentContent so the overlay can render diffs without extra store lookups. Includes a shared ImpactChip component (moved out of side-chat-popover) and adds comprehensive RTL coverage for the new overlay toggle/diff behavior.

Reviewed by Cursor Bugbot for commit 7a9823e. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5ffdee6. Configure here.

Comment thread src/client/routes/specification/$id/route.tsx
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 8, 2026

🤖 Augment PR Summary

Summary: Expands the staged-change overlay into an expandable, per-patch detail list so users can inspect diffs even with the side-chat panel closed.

Changes:

  • Adds optional `anchorReferenceCode` + `currentContent` snapshots to staged patches to avoid re-querying the entity store in overlay consumers.
  • Updates `SideChatHost` staging paths to populate these snapshots for edit/annotate/edge/drill-down patches.
  • Extracts a shared `ImpactChip` component and reuses it in both the side-chat popover and overlay.
  • Makes the “N pending changes” label a toggle button (`aria-expanded`) that reveals a per-patch `
      ` detail view.
    • Renders a word-level `` inline for edit patches when `currentContent` + `newContent` are both present and differ; otherwise summary-only.
    • Auto-collapses the expanded list when staged count returns to 0 after apply/undo.
    • Moves `PatchListOverlay` mounting into the structured-list scroll area to keep the sticky behavior scoped to the workspace scroller.
    • Adds RTL coverage for expand/collapse behavior, multi-patch rendering, diff spans, reference badge, and impact chip.

    Technical Notes: Non-edit patches (and edit patches without currentContent) intentionally render summary-only to keep overlay rendering deterministic without additional data fetches.

    🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

kostandinang and others added 4 commits May 11, 2026 11:43
Bugbot: the overlay lived only under the graph structured list, so interview and export routes lost pending changes, apply/undo, and deferred messaging. Render a single overlay from the /specification/$id layout and drop the graph-only duplicate.
Co-authored-by: Cursor <cursoragent@cursor.com>
@kostandinang kostandinang force-pushed the ka/fe-665-staged-edit-diffs branch from 958ea5b to e2cbbab Compare May 11, 2026 09:47
@kostandinang kostandinang force-pushed the ka/fe-665-overlay-diff-details branch from 764c29b to 7a9823e Compare May 11, 2026 09:47
@kostandinang kostandinang changed the title FE-665: Expand staged-change overlay into per-patch diff list FE-665: Show per-patch diffs in the staged-changes overlay May 11, 2026
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