Skip to content

feat: broken-anchor indicator for orphaned annotations#352

Open
leotrs wants to merge 5 commits intomainfrom
std-2roe
Open

feat: broken-anchor indicator for orphaned annotations#352
leotrs wants to merge 5 commits intomainfrom
std-2roe

Conversation

@leotrs
Copy link
Copy Markdown
Collaborator

@leotrs leotrs commented Mar 27, 2026

Summary

  • When an annotation's anchor can't be resolved (text deleted, structure changed), the card now shows a visual "Original text no longer found" warning banner with an AlertTriangle icon
  • Orphaned cards get a dashed left border and reduced opacity to distinguish them from anchored annotations
  • DockableAnnotations tracks orphaned IDs during sort and passes orphaned prop to Note component

Test plan

  • Verify orphaned annotations show the warning banner in the sidebar
  • Verify anchored annotations do NOT show the banner
  • Verify delete still works on orphaned annotations
  • Verify collapsing an orphaned card hides the banner (shows collapsed preview)
  • 12 new unit tests covering orphan detection and UI rendering

🤖 Generated with Claude Code

leotrs and others added 4 commits March 27, 2026 20:18
…rk unwrap

Backend: add updated_at column to annotation_messages, set on edit, block
DELETE on shared annotations. Frontend: per-message edit/delete with inline
actions (Proposal C), shared annotation card visual redesign (shadow-based,
tinted quote, no colored borders), fix clearHighlights DOM corruption when
unwrapping nested/overlapping marks by processing innermost-first and
deferring normalize().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DrawerFile: download endpoints changed from GET to POST, update mocks
and assertions. EditorUploadCompile: compile() is debounced, use fake
timers to advance past the 500ms delay.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When an annotation's anchor text can no longer be found in the document,
the card now displays a warning banner ("Original text no longer found")
with an AlertTriangle icon and dashed border styling. Orphaned IDs are
tracked in DockableAnnotations and passed as a prop to Note.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for rsm-studio-site canceled.

Name Link
🔨 Latest commit 67445dd
🔍 Latest deploy log https://app.netlify.com/projects/rsm-studio-site/deploys/69c6dfbb1a9e6f000815a701

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for rsm-studio-frontend ready!

Name Link
🔨 Latest commit 67445dd
🔍 Latest deploy log https://app.netlify.com/projects/rsm-studio-frontend/deploys/69c6dfbbf2cbda00086c0a49
😎 Deploy Preview https://deploy-preview-352--rsm-studio-frontend.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

The shared card redesign intentionally removed the Avatar from the
header. Update the E2E test to match the new design.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@leotrs
Copy link
Copy Markdown
Collaborator Author

leotrs commented Mar 27, 2026

Needs human review

What changed: Orphaned annotations now show a visual "Original text no longer found" warning banner with dashed border and reduced opacity. Per-message edit/delete buttons added to annotation cards. Shared card design overhauled (removed top border, added subtle shadow). Delete blocked on shared annotation messages (new 403). updated_at column added to annotation messages with "edited" indicator.

Review checklist:

  1. Open the deploy preview: https://deploy-preview-352--rsm-studio-frontend.netlify.app
  2. Open a document with annotations, then delete the anchored text for one annotation — verify the orphaned card shows a dashed left border, reduced opacity, and an orange "Original text no longer found" banner
  3. Hover over the orphaned card — verify opacity returns to full
  4. Collapse the orphaned card — verify the banner disappears (only collapsed preview shown)
  5. Click delete on the orphaned card — verify it still works
  6. On a private annotation, activate the card and verify Edit and Delete buttons appear below the note text
  7. Edit a private note — verify the inline textarea appears, Save/Cancel work, and an "edited" tag appears after saving
  8. Delete a private note — verify the two-click confirmation pattern (first click arms, second click deletes)
  9. On a shared annotation thread, activate the card and verify the inline edit pencil icon appears on hover for your own messages
  10. Edit a shared thread message — verify the inline textarea and "edited" tag behavior
  11. Verify there is no delete button on individual shared thread messages
  12. Check that the shared card redesign looks correct: no top colored border, subtle shadow instead of border, italic quoted text with background

What to look for:

  • Orphan banner alignment, icon color (orange), and text readability
  • Dashed border style and opacity transition on orphaned cards
  • Edit/delete buttons only appear for your own messages
  • "edited" tag with middle-dot separator renders correctly in both header (private) and thread message header (shared)
  • Shared card shadow looks clean — no double borders or visual artifacts
  • Avatar size change (16px → 12px) doesn't break layout elsewhere
  • No regressions on non-orphaned annotation cards

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