Skip to content

Add the browser Note panel for tester notes and bugs - #2

Open
RoderickGrc wants to merge 7 commits into
mainfrom
feat/browser-composer
Open

RoderickGrc wants to merge 7 commits into
mainfrom
feat/browser-composer

Conversation

@RoderickGrc

Copy link
Copy Markdown
Owner

Summary

Adds the Note panel: in any browser Terrific records, holding Alt and right-clicking opens a small panel where the tester writes a note or a bug without leaving the page. Elements, screenshots and snapshots go into the text as chips, and the result is stored as a normal note or bug event with author: 'tester'.

  • Point picks an element on the page (↑/↓ change level, Enter or click to add, Esc cancels). It serializes as a <pointed-section> block, ported from the Point to section output of terrific-markdown-extension, captured at pick time and without the page URL that navigation events already record.
  • Screenshot and Snapshot capture the page into the session as their own events and add a chip that serializes as @ss_<id>.png or @snapshot:<event id>. The panel fades out before a screenshot and is hidden outright, so it never lands in the image.
  • Drafts survive reloads, navigation and new tabs. The unsent draft lives in the recording's memory for the whole session (one per session, shared by tabs) and is discarded when the session stops. Nothing is written to disk until it is sent. Sending clears it atomically, so a reload during the save cannot bring it back.
  • Copy and paste put the same text form on the clipboard plus the full chip data. Pasting into the panel restores identical chips, and valid references pasted from elsewhere become chips again.
  • Saving confirms in place (the button turns into "Saved") instead of a toast; transitions respect reduced motion.

Implementation

  • src/recorder/composer-script.ts: the page script, serialized like page-script.ts. Built without innerHTML or inline style markup (constructable stylesheet, DOM APIs only) so it works on CSP and Trusted Types pages. Top frame only.
  • src/recorder/composer-bridge.ts: payload validation and dispatch for the __terrificCompose binding (screenshot, snapshot, submit, loadDraft, saveDraft). Drafts are validated strictly, including screenshot paths (screenshots/ss_*.png only) and size limits.
  • src/recorder/recording.ts: exposes the binding and injects the panel in every recorded browser, even when action recording is off. New optional appendEvent option returns stored event ids, wired in src/daemon/session-service.ts.
  • src/recorder/page-script.ts: the action recorder ignores events that come from the panel.
  • Docs: README, CHANGELOG, and the agent skill (references/events.md) explain how to read <pointed-section>, @ss_ and @snapshot: references.

Testing

  • npm run check passes: lint, typecheck, 271 tests (0 skipped), build, dist smoke test, publint and pack.
  • New real-browser tests in test/recorder.test.ts cover the gesture, Point, captures, notes with action recording off, empty bugs, draft restore after reload and navigation, label continuity, inserting after a selection, and copy and paste.
  • Dogfooded with Terrific itself in three live sessions on a local page: notes and bugs arrived with resolvable references, drafts survived four reloads, and panel interactions produced no action events.

Known limitations

  • Iframes and closed shadow roots cannot be pointed into from the top frame.
  • Screenshot previews can be blocked by a page's image CSP; the chip and the capture still work.
  • Reloading while a capture is in flight keeps the capture in the session, but its chip does not reach the draft.

🤖 Generated with Claude Code

RoderickGrc and others added 7 commits November 7, 2026 20:58
Page-injectable composer opened with Alt+right-click. Point adds element chips, Screenshot and Snapshot add capture chips, and the draft is sent as a note or a bug through the __terrificCompose binding. Built without innerHTML or inline styles so it works on CSP and Trusted Types pages. Not wired into the recorder yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every recorded browser now gets the composer and a __terrificCompose binding, even when action recording is off. Notes and bugs are stored as tester marks, and the Screenshot and Snapshot tools append real capture events whose ids go back to the page for the chips. The action recorder ignores events from the composer UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Explain the Alt+right-click composer in the README and changelog, and teach the agent skill how to resolve the element, screenshot and snapshot references inside composer notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The recording now holds one in-memory draft per session with loadDraft and saveDraft bridge operations, so the page can restore unsent text and chips after a reload or navigation. Drafts are validated strictly, never written to disk, and cleared atomically when a note or bug is saved. Screenshot and snapshot labels are numbered session-wide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion

The note panel saves its draft to the session as the tester types and when the page hides, and restores it on every new page. An open panel reappears at the same position without taking focus. Element chips whose selector is missing on the current page are shown as unavailable but still serialize. Screenshot and snapshot labels come from the session so numbering continues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The note panel fades in and out quickly, including around screenshots, where it is hidden outright once faded so it never lands in the image. Saving now confirms in place by turning the button into Saved before the panel fades out, with a screen-reader status instead of the corner toast. Reduced motion skips the transitions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pointed elements now serialize as the <pointed-section> block from the markdown extension's Point to section, captured at pick time, without the page URL that navigation events already record. Screenshots serialize as @ss_<id>.png and snapshots as @snapshot:<event id>. Copying from the note panel puts that text on the clipboard together with the full chip data, and pasting turns valid references back into chips. Inserting a capture or a pointed element no longer replaces selected text, and restoring a draft no longer adds a space after every chip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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