Skip to content

Improve the comment and question feedback flow in visual-docs - #6

Merged
patrickdappollonio merged 6 commits into
mainfrom
visual-docs-feedback
Jul 9, 2026
Merged

Improve the comment and question feedback flow in visual-docs#6
patrickdappollonio merged 6 commits into
mainfrom
visual-docs-feedback

Conversation

@patrickdappollonio

@patrickdappollonio patrickdappollonio commented Jul 8, 2026

Copy link
Copy Markdown
Owner

This PR rounds out the review feedback loop based on hands-on usage. Submitting a comment now clears the "commenting on" bar once the save succeeds (it stays put on failure so you can retry), so the next comment doesn't accidentally inherit a stale target. Comments the agent hasn't acknowledged yet can be edited in place — double-click one in the drawer, change the text, and save; edited comments carry an editedAt timestamp and an "(edited)" marker, the new POST /api/comments/edit endpoint refuses (409) once a comment is acknowledged or resolved, and the original anchor is preserved so quote highlighting and path:line resolution keep working.

The gutter comment button now targets individual list items instead of only whole lists: hovering an <li> — including nested ones, where the deepest item under the pointer wins — offers "Comment on this list item" anchored to that item's own text (excluding its sub-list), so the stored quote and resolved source line point at exactly the bullet you meant. Headings, components, code blocks, tables, and the text-selection affordance behave as before.

Interactive question fences got the UX polish they needed: clicking a selected radio deselects it, so changing your mind is possible; the free-text field's label adapts live — it reads as your custom answer when no option is picked and as an optional accompanying comment when one is — and submissions store all three intents cleanly (Option A, custom text alone, or Option A — your note). Answers still post as ordinary component-anchored comments, so the agent digest, re-hydration on reload, and even editing your answer afterwards all work unchanged. The plugin version is bumped to 1.2.0 so installed copies pick up the release.

…ield

Radios in single-select question fences could not be unselected once
picked, and typing in the free-text box after picking an option silently
joined them into one answer with no indication. Now:

- Clicking an already-selected radio clears it (checkboxes keep native
  toggle behavior).
- The free-text field's label/placeholder switch live between "write
  your own answer" (nothing picked) and "add an optional comment to your
  answer" (an option is picked), so the field's role is always visible.
- Submit semantics: option only -> option; text only -> text; option +
  text -> "<option> — <text>" (joined options for multi-select). Nothing
  picked and no text is still a no-op.

Verified headless: radio deselect, live label switch, stored comment
text for option+note/custom-only/multi+note, and answers rehydrating
correctly on reload, with no console errors.
Hovering an <li> (top-level or nested) now targets that item specifically
instead of the whole list — the deepest li under the pointer wins, and the
whole-list target stays reachable by hovering where no li is hit. A list
item's own text excludes any nested sub-list, so a two-level item's quote
doesn't swallow its children's text.
…cknowledged comments

The "commenting on ..." context bar stuck around after a successful submit,
making the next comment look anchored to stale text. Clear the drawer target
once the POST succeeds (failures still keep it so the user can retry).

Also let users double-click a comment the agent hasn't acknowledged yet to fix
a typo or add detail before the agent starts on it, via a new
POST /api/comments/edit endpoint (409s once a comment is acknowledged).
@patrickdappollonio
patrickdappollonio merged commit 2335c2b into main Jul 9, 2026
1 check passed
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