Skip to content

feat(comments): UAT-friendly long-session QoL — drop 20-item cap, capture page URL#320

Open
AgentEnder wants to merge 2 commits into
aidenybai:mainfrom
AgentEnder:bedecked-damselfly
Open

feat(comments): UAT-friendly long-session QoL — drop 20-item cap, capture page URL#320
AgentEnder wants to merge 2 commits into
aidenybai:mainfrom
AgentEnder:bedecked-damselfly

Conversation

@AgentEnder
Copy link
Copy Markdown

@AgentEnder AgentEnder commented May 1, 2026

Closes #319.

Summary

  • Drop the 20-item count cap on comments. The hard MAX_COMMENT_ITEMS = 20 in constants.ts predates the 2 MB byte-size trim that was later added (in commit d1877670 fix) as the principled sessionStorage-quota safeguard. The count cap silently dropped older comments during longer review sessions; the byte trim already handles real storage pressure (~500–2000 typical comments fit under 2 MB).
  • Capture the page URL on each comment. Multi-page review sessions had no way to tell which page a given comment came from. We now:
    • Store url?: string on CommentItem (captured from window.location.href at creation).
    • Show a third line in the comments dropdown row under the comment text — host is elided when it matches the current page, full URL is shown via title on hover.
    • Append at <url> to the copied content (single + copy-all) on its own indented line, mirroring the existing in <Component> (at <file>) convention from formatStackContext. Both the plain-text and rich-MIME (application/x-react-grab) entries get the decorated content so paste targets stay consistent.

Why

From #319: react-grab is being used for long UAT-style review sessions where reviewers comment across many pages. The 20-item silent drop and missing URL context were the two friction points called out.

Test plan

  • Comment on 25+ different elements in a single session — confirm none silently disappear from the dropdown.
  • Navigate to a second page, comment, open dropdown — confirm the URL line shows the new page's path under the comment.
  • Comment on a cross-host page (e.g. localhost:3000 then localhost:3001) — confirm host appears in the URL label when it differs from the current page.
  • Hover the URL line — confirm the full URL appears in the native tooltip.
  • Use "Copy" on a single comment — confirm pasted content has at <url> on its own line.
  • Use "Copy all" — confirm each entry's snippet ends with its own at <url> line.
  • Verify pnpm --filter react-grab typecheck is clean.
  • Run the existing comments e2e specs (packages/react-grab/e2e/clear-history-prompt.spec.ts and friends) — no regressions.

Notes

  • The byte-budget trim is now the only cap. If a single user ever does hit the 2 MB ceiling (well past typical review-session sizes), an IndexedDB-backed storage layer is the natural follow-up — left out of scope here.
  • No new e2e coverage for the URL display / 25+ items added in this PR; happy to add it as a follow-up if the maintainers prefer.

Note

Medium Risk
Changes comment persistence and clipboard output: comments are no longer capped by count and copied snippets now include a URL line, which could affect consumers expecting the previous format or increase sessionStorage churn (though still size-trimmed).

Overview
Comments history is now retained beyond the previous 20-item limit by removing the hard count cap and relying solely on the existing sessionStorage byte-size trimming.

Each CommentItem now records url (captured at creation), surfaces a compact URL label in the comments dropdown (with full URL on hover), and appends an at <url> line when copying single comments or using copy-all (including per-entry payloads).

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

AgentEnder added 2 commits May 1, 2026 08:27
The hard MAX_COMMENT_ITEMS=20 cap predates the 2 MB byte-size trim
that was added later as a sessionStorage-quota safeguard. The byte
trim is the principled limit; the count cap was a redundant artifact
that silently dropped comments during long review sessions.

Refs aidenybai#319
Multi-page review sessions had no way to tell which page a comment
came from. Capture window.location.href at comment-creation time,
display it under the comment text in the dropdown (collapsing host
when it matches the current page), and append it to the copied
output as an indented 'at <url>' line — mirroring the existing
'in <Component> (at <file>)' convention.

Refs aidenybai#319
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 1, 2026

@AgentEnder is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

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.

Few QoL changes for using react-grab for longer review sessions, UAT like things

1 participant