Skip to content

feat: add file-scoped comments to /plannotator-review#303

Merged
backnotprop merged 2 commits intobacknotprop:mainfrom
sercantor:feat/review-file-scoped-comments
Mar 15, 2026
Merged

feat: add file-scoped comments to /plannotator-review#303
backnotprop merged 2 commits intobacknotprop:mainfrom
sercantor:feat/review-file-scoped-comments

Conversation

@sercantor
Copy link
Copy Markdown
Contributor

Summary

  • Add a file-scoped comment flow to /plannotator-review via a File Comment composer in each file header.
  • Keep line-scoped comments unchanged and include file-scoped comments in Review Panel and exported feedback (### File Comment).
  • Small cleanup: extract Review Panel sort helpers for readability while preserving behavior.

Closes #302

Test plan

  • bun run build:review
  • Manual end-to-end smoke test through /plannotator-review (feedback payload included ### File Comment).

@backnotprop
Copy link
Copy Markdown
Owner

Ah, nice work. I was just giving this a shot! Alright, I'll get it in review.

@sercantor
Copy link
Copy Markdown
Contributor Author

feel free to dismiss if you have some other implementation in mind

@backnotprop
Copy link
Copy Markdown
Owner

No, all good. We can make this work.

Replace the custom popover implementation in FileHeader (~88 lines of
hand-rolled state, click-outside, and escape handling) with the existing
CommentPopover component from packages/ui. This gives us expand-to-dialog
mode, image attachments, scroll-aware positioning, and keyboard shortcuts
for free, while saving ~62 net lines.

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

Nice work on this — the scope field approach and ReviewPanel badge are great.

I pushed a small refactor (cf77b73) to swap the custom popover in FileHeader for the existing CommentPopover component from packages/ui/components/CommentPopover.tsx. This is the same popover used for global comments in the plan editor.

What changed:

  • FileHeader now just has a button that passes its DOM element up via onFileComment(anchorEl)
  • DiffViewer renders <CommentPopover> anchored to that element
  • ~62 net lines removed

What you get for free by reusing it:

  • Click-outside dismiss
  • Escape key handling
  • Expand-to-dialog mode (for longer comments)
  • Image attachment support
  • Scroll-aware anchor positioning
  • Keyboard shortcut hints

Everything else from your PR (scope field, export format, ReviewPanel sorting) is kept as-is.

@backnotprop backnotprop merged commit 6cde395 into backnotprop:main Mar 15, 2026
5 checks 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.

[FEAT] File-scoped comments on /plannonator-review

2 participants