Skip to content

Commit 104be99

Browse files
authored
Add thumbs up quick label button to annotation toolbar (#588)
* Add thumbs-up quick annotation button to annotation toolbar A one-click "👍 Looks good" button joins the existing quick-label system so users can approve a selection, code block, or diff hunk without opening the picker. Covers plan, annotate, and plan-diff modes (all share the same AnnotationToolbar). * Move thumbs-up button to the right of the zap quick-label button For provenance purposes, this commit was AI assisted.
1 parent 84aa1d7 commit 104be99

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/ui/components/AnnotationToolbar.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ import { FloatingQuickLabelPicker } from "./FloatingQuickLabelPicker";
77

88
type PositionMode = 'center-above' | 'top-right';
99

10+
const THUMBS_UP_LABEL: QuickLabel = {
11+
id: 'thumbs-up',
12+
emoji: '👍',
13+
text: 'Looks good',
14+
color: 'green',
15+
};
16+
1017
const isEditableElement = (node: EventTarget | Element | null): boolean => {
1118
if (!(node instanceof Element)) return false;
1219
if (node.matches('input, textarea, select, [role="textbox"]')) return true;
@@ -217,6 +224,12 @@ export const AnnotationToolbar: React.FC<AnnotationToolbarProps> = ({
217224
label="Quick label"
218225
className={showQuickLabels ? "text-amber-500 bg-amber-500/10" : "text-amber-500 hover:bg-amber-500/10"}
219226
/>
227+
<ToolbarButton
228+
onClick={() => onQuickLabel(THUMBS_UP_LABEL)}
229+
icon={<span className="block w-4 h-4 text-sm leading-4 text-center">👍</span>}
230+
label="Looks good"
231+
className="hover:bg-green-500/10"
232+
/>
220233
{showQuickLabels && zapButtonRef.current && (
221234
<FloatingQuickLabelPicker
222235
anchorEl={zapButtonRef.current}

0 commit comments

Comments
 (0)