Repository navigation
fix(browser): refuse a 21st page annotation with a visible limit instead of dropping the oldest - #35979
Conversation
…age instead of dropping the oldest The store evicted the oldest note once a page held 20, so feedback vanished unseen. It now refuses the add; picking an element on a full page shows a limit toast instead of opening a draft, and the annotate banner states the limit.
…, hook and banner
[Medium impact] The PR appears safe to merge; the latest placeholder change stays consistent across the message and catalogs. SummaryThe PR refuses annotations beyond 20 without removing saved notes. It adds a limit message to the picker and browser banner.
Reviews (3) · Last reviewed commit: "fix(i18n): name the annotation limit pla..." · Reviewed by Greptile |
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a032f1b2-454c-4db5-bbce-b0cb69f9c762
Files selected for processing: 18-
src/renderer/src/components/browser-pane/annotate/use-browser-page-grab-annotations.test.tsxsrc/renderer/src/components/browser-pane/annotate/use-browser-page-grab-annotations.tssrc/renderer/src/components/browser-pane/assemble-chrome/browser-page-chrome-banners.tsxsrc/renderer/src/i18n/locales/de.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/ru.jsonsrc/renderer/src/i18n/locales/tr.jsonsrc/renderer/src/i18n/locales/zh-Hant.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/store/slices/browser-annotation-retention.test.tssrc/renderer/src/store/slices/browser.test.tssrc/renderer/src/store/slices/browser/browser-page-metadata-actions.tssrc/shared/browser-grab-types.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Keep the annotation-limit message readable in narrow panes. · browser-page-chrome-banners.tsx:89
src/renderer/src/components/browser-pane/assemble-chrome/browser-page-chrome-banners.tsx:89
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep the annotation-limit message readable in narrow panes.
When annotation mode has no pending payload and the page is full,
browserAnnotationLimitMessage()is rendered in atruncatespan beside the annotation controls. The message can therefore become visually truncated in a narrow pane. It remains available as ordinary text to assistive technologies, but sighted users have no visible way to reveal the clipped text. Allow the message to wrap or provide a keyboard-accessible way to view it.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
fdcc1a10-3654-41f5-b44a-6070d0a50cae
Files selected for processing: 3-
src/renderer/src/components/browser-pane/annotate/browser-annotation-limit-message.tssrc/renderer/src/components/browser-pane/annotate/use-browser-page-grab-annotations.tssrc/renderer/src/components/browser-pane/assemble-chrome/browser-page-chrome-banners.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
758172df-646e-470e-928a-f2bfdbf4247f
Files selected for processing: 12-
src/renderer/src/components/browser-pane/annotate/browser-annotation-limit-message.tssrc/renderer/src/i18n/locales/de.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/ru.jsonsrc/renderer/src/i18n/locales/tr.jsonsrc/renderer/src/i18n/locales/zh-Hant.jsonsrc/renderer/src/i18n/locales/zh.json
Files skipped from review as they are similar to previous changes: 2-
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/de.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
ELI5
A browser page can hold 20 annotations. When you added a 21st, Orca quietly threw away your first one and still showed "20 annotations". Now Orca stops at 20 and tells you why: picking another element shows "Limit of 20 annotations reached. Send, delete or clear some to add more." Nothing you wrote disappears.
What Changed
addBrowserPageAnnotationappended the new note and then ran.slice(-20), so the oldest note was evicted with no notice. The tray count stayed at 20 and the page markers renumbered.GRAB_BUDGET.annotationsMaxPerPagenotes. Nothing is evicted.isBrowserAnnotationPageFullinsrc/shared/browser-grab-types.tsis the one rule the store, the hook and the banner all call.Both the browser pane and the HTML doc preview add annotations through the same hook (
useBrowserPageGrabAnnotations), so both get the toast.Why
The cap has a reason to exist. Every annotation goes into the agent prompt with up to ~13 KB of context: an HTML snippet of up to 4 KB, a comment of up to 2 KB, selectors, paths and nearby text. Twenty notes are already ~300 KB in the worst case, so raising the cap would only make the prompt bigger. Nothing on the wire or in persistence needs 20: annotations live only in renderer memory, and terminal input is chunked rather than capped.
So I kept 20 and made the limit visible. Alternatives considered:
Refusing in the store fixes the fact at its owner. The check when an element is picked spares the user from typing a note that can't be saved.
Linked Issue
Fixes #26670
Visual Proof
All annotations below were added through the real UI in a hidden dev build, on a local page with 25 boxes. Notes 1–19 were scripted clicks before recording started; the 20th and 21st are on camera.
BEFORE (main): after the 21st note (Box 23) the tray still says 20, Box 1's note is gone, and the markers renumber.
before.mp4
AFTER (this branch): the banner states the limit at 20. Picking Box 23 shows the red limit toast and opens no card, and the tray still starts with Box 1.
after.mp4
Testing
Hidden dev build on macOS, driven over CDP (videos above). On main the BEFORE run drops note Linux support #1 at the 21st add. This branch refuses the add and keeps Linux support #1.
browser.test.ts: the store refuses notes past the cap, and the first 20 survive. Fails on main.use-browser-page-grab-annotations.test.tsx:browser-annotation-retention.test.ts: the eviction tests are gone, because nothing is evicted now. The delete/clear marker-pruning check those tests carried is kept.check:code-quality:changed,check:react-doctor:changedandverify-localization-extractionall pass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Codex and Claude reviewed one round with no P0/P1. Two P2s were accepted and fixed:
From simplify, I skipped having the store return whether it accepted the note. A draft only opens below the cap, and that draft's own Add is the only thing that raises the count, so a refusal can't hit an open draft.
CodeRabbit:
{{limit}}(fixed in e221ceb).To try (worktree
/Users/kelvinamoaba/orca/workspaces/orca/browser-annotation-limit,pnpm dev):Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)