Files
backnotprop__plannotator/packages/editor/components/HtmlSurfaceActions.tsx
Michael Ramos 44611e5300 feat(ui): publish the HTML annotation seams hosts were hand-rolling (#1395)
Parity seams for hosts of @plannotator/ui, requested by Workspaces after the HTML annotation handoff: projectHostThreads and buildPersistedHtmlAnchor in @plannotator/core; HtmlViewer onUnanchoredChange completed over the annotations prop with a restore-keyed report so hosts can drop their mark-applied listeners; published useHtmlRefresh with a fetchSnapshot adapter; published HtmlSurfaceControls (eye, refresh, pen) with label overrides; AnnotationPanel unanchoredIds chip (wired for Plannotator too); HtmlViewer maxAdditionalTargets and scrollBehavior carried on the bridge; shortcuts and utils/inputMethod blessed as consumer exports. Plannotator's behavior is unchanged apart from the new Unanchored chip, verified by a real-browser A/B including the orphan and re-anchor cycle and by a combined cross-surface verification with #1394.

AI-assisted (Claude) under maintainer direction.
2026-08-27 07:35:22 -07:00

39 lines
1.1 KiB
TypeScript

import { HtmlSurfaceControls } from '@plannotator/ui/components/HtmlSurfaceControls';
interface HtmlSurfaceActionsProps {
canRefresh: boolean;
isRefreshing: boolean;
toolsHidden: boolean;
onRefresh: () => void;
onToggleTools: () => void;
}
/** Plannotator's refresh strings for the published control: the document
* is a file on disk, so the refresh says so. Shared with AppHeader. */
export const PLANNOTATOR_HTML_REFRESH_LABELS = {
refreshTitle: 'Refresh HTML from disk',
refreshingTitle: 'Refreshing HTML from disk',
} as const;
/** Eye + refresh, without the pen: the published HtmlSurfaceControls with
* Plannotator's refresh strings. Kept as the local name the header used. */
export function HtmlSurfaceActions({
canRefresh,
isRefreshing,
toolsHidden,
onRefresh,
onToggleTools,
}: HtmlSurfaceActionsProps) {
return (
<HtmlSurfaceControls
armed={false}
toolsHidden={toolsHidden}
onToggleTools={onToggleTools}
canRefresh={canRefresh}
onRefresh={onRefresh}
isRefreshing={isRefreshing}
labels={PLANNOTATOR_HTML_REFRESH_LABELS}
/>
);
}