Vanilla Breeze

note-wc

Private note action for selection-menu. One-click highlight + annotate with localStorage persistence.

Overview

The <note-wc> component provides a one-click "highlight + annotate" action inside <selection-menu>. It creates a highlight on the selected text (if not already highlighted) and immediately opens a private note panel.

Notes are the reader's private marginalia — stored in localStorage, not shared with others. For collaborative comments, use <comment-wc> with <review-surface>.

Usage

Place inside a <selection-menu> alongside other action components.

How It Works

  1. User selects text and clicks the sticky-note icon in the toolbar.
  2. If the selection isn't already highlighted, note-wc creates a yellow highlight.
  3. The highlights-init note panel opens with a textarea for the private note.
  4. Notes persist in localStorage alongside the highlight data.
  5. Notes appear as margin annotations ("* You highlighted") beside the text.

Annotation Layers

ComponentActorPersistencePurpose
<note-wc>ReaderlocalStoragePrivate marginalia
<comment-wc>CollaboratorBackend (via review-surface)Shared threaded comments
<foot-note>AuthorStatic HTMLStructural footnotes

Accessibility

  • Button has aria-label="Add private note"
  • Note panel has role="dialog"
  • Ctrl+Enter saves the note, Escape cancels

Related