Skip to content

FE-657: Direct in-place editing on the structured-list view#109

Open
kostandinang wants to merge 3 commits into
ka/fe-665-overlay-diff-detailsfrom
ka/fe-657-direct-edits
Open

FE-657: Direct in-place editing on the structured-list view#109
kostandinang wants to merge 3 commits into
ka/fe-665-overlay-diff-detailsfrom
ka/fe-657-direct-edits

Conversation

@kostandinang
Copy link
Copy Markdown
Contributor

@kostandinang kostandinang commented May 7, 2026

What

Adds direct in-place editing on the structured-list view, reusing the side-chat V2 staging pipeline.

Stacked on #108. Linear: FE-657.

How

  • Per-row pencil affordance opens an autosizing inline textarea seeded with the current content.
  • Cmd/Ctrl+Enter or Save stages an edit patch on the existing PatchListProvider.
  • Esc / Cancel / clicking away exits without staging — staging is explicit.

Why

Same patch shape as propose_edit, so this reuses the V2 pipeline (staging, apply, impact classification, undo, hard-impact cascade) with no new server work.

Test plan

  • Pencil opens textarea seeded with current content
  • Cmd/Ctrl+Enter stages; same impact chip + Apply / Undo as side-chat edits
  • Esc / Cancel exits cleanly

@cursor
Copy link
Copy Markdown

cursor Bot commented May 8, 2026

PR Summary

Medium Risk
Adds new inline editing interactions that stage edit patches into the shared patch-list pipeline; risk is mostly around UI state/keyboard+blur handling and potential conflicts with existing selection/patch staging behavior.

Overview
Adds direct inline editing for knowledge item rows in the structured list view via a per-row pencil action that swaps the static content for an autosizing textarea.

Edits can be saved with Cmd/Ctrl+Enter or an inline Save button (disabled for empty/no-op changes) to stage a kind: 'edit' patch (including currentContent, newContent, and anchorReferenceCode) through the existing PatchListProvider; Escape, Cancel, or blurring the editor exits without staging.

Extends structured-list-view tests to cover entering/exiting edit mode, patch staging visibility via the patch overlay, validation/disable states, and the Edit button being disabled when no patch list provider is present.

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

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 8, 2026

🤖 Augment PR Summary

Summary: Adds inline “direct edit” support to the specification structured-list view so users can quickly tweak an item’s content without going through a side-chat flow.

Changes:

  • Adds an Edit (pencil) action per row and an inline autosizing textarea editor with Save/Cancel controls.
  • Supports keyboard affordances: Esc to cancel and Cmd/Ctrl+Enter to save.
  • Restricts inline editing to one row at a time and disables other rows’ edit buttons while a row is in edit mode.
  • Stages edits as kind: 'edit' patches via the existing PatchListProvider pipeline (apply/undo/impact-tier/cascade).
  • Includes anchorReferenceCode, currentContent, and newContent on staged patches to preserve overlay diff rendering.
  • Updates the row layout to swap the static <p data-annotatable> for the editor while editing.
  • Adds a dedicated test suite covering edit-button rendering, staging via Cmd+Enter and Save, and cancellation paths.

Technical Notes: Inline editing is tracked by an editingItemKey state in StructuredListView and is intentionally decoupled from server changes by reusing the existing patch staging + overlay apply flow.

🤖 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. 1 suggestion posted.

Fix All in Augment

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

Comment thread src/client/routes/specification/$id/-structured-list-view.tsx
Comment thread src/client/routes/specification/$id/-structured-list-view.tsx Outdated
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 389579a. Configure here.

Comment thread src/client/routes/specification/$id/-structured-list-view.tsx
@kostandinang kostandinang force-pushed the ka/fe-657-direct-edits branch from 389579a to c71b58a Compare May 11, 2026 09:19
@kostandinang kostandinang force-pushed the ka/fe-665-overlay-diff-details branch from 222ba01 to 764c29b Compare May 11, 2026 09:19
kostandinang and others added 3 commits May 11, 2026 11:43
Per-row pencil button enters inline-edit mode that swaps the static
content paragraph for an autosizing textarea seeded with the current
content. Saving (blur or Cmd/Ctrl+Enter) stages a kind: 'edit' patch on
the existing PatchListProvider — same staging surface, apply path,
impact-tier routing, and undo handling that side-chat tool-call edits
already use. Escape cancels without staging.

Only one row may be in edit mode at a time; the Edit affordance is
disabled on other rows while editing, and disabled entirely when no
PatchListProvider is mounted (e.g. legacy preview routes).

Patch payload includes anchorReferenceCode and currentContent so the
PatchListOverlay renders the kind-tinted reference badge and word-level
ContentDiff without re-querying the entity store.

Co-authored-by: Amp <amp@ampcode.com>
Replace blur-to-save behavior with explicit Save and Cancel buttons
beneath the textarea, plus a keyboard hint (⌘↵ save · esc cancel).
Save uses the same blue gradient + ring as the patch-list-overlay Apply
button so users see one consistent primary-action style across the
staging surface; Cancel is a ghost button.

Save is disabled when the trimmed value is empty or unchanged from the
original, so the editor never stages a no-op edit. Container-level blur
falls back to cancel only when focus leaves the editor entirely
(clicking the inline buttons keeps focus inside and runs their own
handlers).

Hide the row's hover action rail and toggle while editing so the
top-bar reads only as the editor (badge + textarea + Save/Cancel
controls), and align the badge to the textarea's top edge with
items-start so multi-line edits don't drift the alignment.

Adds two tests covering Save click (with disabled-state transitions for
unchanged / whitespace-only content) and Cancel click.

Co-authored-by: Amp <amp@ampcode.com>
Compare trimmed user input against trimmed initial content so leading or
trailing whitespace in the original value doesn't make canSave true on
edit-mode entry, which would otherwise enable Save and stage a no-op
whitespace-only edit patch.
@kostandinang kostandinang force-pushed the ka/fe-665-overlay-diff-details branch from 764c29b to 7a9823e Compare May 11, 2026 09:47
@kostandinang kostandinang force-pushed the ka/fe-657-direct-edits branch from c71b58a to 4ae654f Compare May 11, 2026 09:47
@kostandinang kostandinang requested a review from lunelson May 11, 2026 09:54
@kostandinang kostandinang changed the title FE-657: Direct edits of spec FE-657: Direct in-place editing on the structured-list view 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