Files
Itay Grubman 9a23c249b2 feat: add quick label selection mode for one-click annotations (#272)
* feat: add quick annotation labels for one-click preset feedback

Add preset label chips (Needs tests, Security concern, Break this up, etc.)
that allow instant annotation without typing. Includes ⚡ toolbar button,
Alt+1..8 keyboard shortcuts, label customization in Settings, and label
summary in export output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add quick label selection mode for one-click annotations

* feat: redesign quick label picker UX and add label tips

- Redesign FloatingQuickLabelPicker as a vertical context-menu style list
  with cursor-anchored positioning (appears at mouseup point, not selection center)
- Unify label dropdown: toolbar and quick-label mode now share the same
  FloatingQuickLabelPicker component (removed duplicate InlineQuickLabelDropdown)
- Fix above/below flip positioning (follow CommentPopover pattern with
  conditional translateY)
- Add label tips: optional instruction text on QuickLabel that gets injected
  into agent feedback as a blockquote below the label
- Add tip editor in Settings with three visual states (empty/editing/filled)
- Add "Missing overview" default label with a tip for requesting narrative context
- Extend keyboard shortcuts from Alt+1-8 to Alt+1-9
- Suppress input method toggle (Alt) when label picker is open
- Reorder default labels: Clarify this, Needs tests, Consider edge cases,
  Missing overview, Security concern, Break this up, Wrong order, Discuss first,
  Nice approach

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: curate default labels, add cyan/amber colors, bare digit shortcuts

Finalize the 10 default quick labels based on user feedback data:
clarify, overview, verify, example, patterns, alternatives, regression,
out-of-scope, tests, nice-approach. Each label gets a unique color
(added cyan and amber to the palette). Bare digit keys (1-0) now apply
labels when the picker is open, Alt+N still works everywhere. Tip editor
cursor starts at beginning for readability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: prevent duplicate annotation when digit key fires both toolbar and picker handlers

When the quick label picker is open from the toolbar's zap button,
let FloatingQuickLabelPicker own all keyboard input instead of both
components handling the same keypress.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Michael Ramos <mdramos8@gmail.com>
2026-03-11 23:39:46 -07:00

32 lines
772 B
TypeScript

/**
* Editor Mode Settings Utility
*
* Persists the last-used editor mode (selection, comment, redline) so it
* carries over between plan reviews.
*/
import { storage } from './storage';
import type { EditorMode } from '../types';
const STORAGE_KEY = 'plannotator-editor-mode';
const DEFAULT_MODE: EditorMode = 'selection';
/**
* Get the last-used editor mode from storage
*/
export function getEditorMode(): EditorMode {
const stored = storage.getItem(STORAGE_KEY);
if (stored === 'selection' || stored === 'comment' || stored === 'redline' || stored === 'quickLabel') {
return stored;
}
return DEFAULT_MODE;
}
/**
* Save editor mode to storage
*/
export function saveEditorMode(mode: EditorMode): void {
storage.setItem(STORAGE_KEY, mode);
}