Files
Alessandro Frau 82699018aa Dismiss the Annotate tooltip on activation
Hide the Bootstrap tooltip when toggling annotation mode so it clears even if the button retains focus. Keep the tooltip available on hover and keyboard focus.
2026-11-22 22:08:18 +01:00

1047 lines
37 KiB
HTML

<html class="browser-modal">
<head>
<title>Browser</title>
<script type="module">
import { store } from "/plugins/_browser/webui/browser-store.js";
</script>
</head>
<body class="browser-modal-body">
<div x-data>
<template x-if="$store.browserPage">
<div class="browser-panel surface-workspace" x-create="$store.browserPage.onOpen($el, xAttrs($el) || {})" x-destroy="$store.browserPage.cleanup()"
x-effect="$store.browserPage.handleSelectedContextChange($store.chats?.selected)"
@keydown.window="$store.browserPage.handleKeydown($event)">
<div class="browser-toolbar surface-toolbar">
<div class="browser-windows" role="tablist" aria-label="Chromium windows">
<template x-for="(win, index) in $store.browserPage.browserWindows()" :key="win.tab.window_id">
<button type="button" role="tab" class="browser-window"
:title="'Window ' + (index + 1) + ' · ' + $store.browserPage.browserTabTitle(win.tab) + ' (' + win.count + ')'"
:aria-selected="($store.browserPage.frameState?.window_id === win.tab.window_id).toString()"
@click="$store.browserPage.selectBrowser(win.tab.id, $store.browserPage.contextId)">
<x-icon name="web_asset" aria-hidden="true"></x-icon>
<span class="browser-window-title" x-text="$store.browserPage.browserTabTitle(win.tab)"></span>
<span class="browser-window-count" x-text="'(' + win.count + ')'"></span>
</button>
</template>
</div>
<button type="button" class="btn btn-icon-action surface-control" title="New window" aria-label="New window"
:disabled="$store.browserPage.isBusy()" @click="$store.browserPage.command('open', { new_window: true })">
<x-icon name="add"></x-icon>
</button>
<div class="browser-session-controls surface-toolbar-group">
<button type="button" class="btn btn-icon-action surface-control" title="Annotate" aria-label="Annotate"
:aria-pressed="$store.browserPage.annotating.toString()"
:disabled="!$store.browserPage.canAnnotate() && !$store.browserPage.annotating"
@click="window.bootstrap?.Tooltip?.getInstance($el)?.hide(); $store.browserPage.toggleAnnotationMode()">
<x-icon aria-hidden="true"
:name="$store.browserPage.annotating ? 'rate_review' : 'edit_note'"></x-icon>
</button>
<div class="browser-volume" x-data="{ open: false }"
@click.outside="open = false" @focusout="if (!$el.contains($event.relatedTarget)) open = false"
@keydown="if (open || $event.key !== 'Escape') $event.stopPropagation()"
@keydown.escape="if (open) { open = false; $refs.toggle.focus() }">
<button type="button" class="btn btn-icon-action surface-control" x-ref="toggle"
aria-label="Browser volume" aria-haspopup="dialog" :aria-expanded="open.toString()"
:title="$store.browserPage.volumeError || ('Browser volume: ' + $store.browserPage.volume + '%')"
:disabled="!$store.browserPage.usesInteractiveTransport()"
@click="$store.browserPage.closeExtensionsMenu(); open = !open; if (open) $nextTick(() => $refs.slider.focus())">
<x-icon :name="$store.browserPage.volume === 0 ? 'volume_off' : $store.browserPage.volume <= 50 ? 'volume_down' : 'volume_up'"></x-icon>
</button>
<div class="browser-volume-popover" role="dialog" aria-label="Browser volume"
x-show="open && $store.browserPage.usesInteractiveTransport()" style="display: none;">
<input type="range" min="0" max="100" x-ref="slider" aria-label="Playback volume" aria-orientation="vertical"
:value="$store.browserPage.volume" :aria-valuetext="$store.browserPage.volume + '%'"
@input="$store.browserPage.setVolume($event.target.valueAsNumber)">
<button type="button" class="btn btn-icon-action surface-control"
:aria-label="$store.browserPage.volume ? 'Mute browser audio' : 'Unmute browser audio'"
:title="$store.browserPage.volume ? 'Mute browser audio' : 'Unmute browser audio'"
:aria-pressed="($store.browserPage.volume === 0).toString()"
@click="$store.browserPage.setVolume($store.browserPage.volume ? 0 : $store.browserPage.lastVolume)">
<x-icon name="volume_off"></x-icon>
</button>
</div>
</div>
<div class="browser-extension-menu" @click.outside="$store.browserPage.closeExtensionsMenu()"
@keydown.escape.window="$store.browserPage.closeExtensionsMenu()">
<button type="button" class="btn btn-icon-action browser-extensions surface-control" title="Browser settings"
aria-label="Browser settings" @click.stop="$store.browserPage.toggleExtensionsMenu()"
:aria-expanded="$store.browserPage.extensionMenuOpen.toString()"
:class="{ 'is-active': $store.browserPage.status?.extensions?.active }">
<x-icon name="tune"></x-icon>
</button>
<div class="browser-extension-dropdown" x-show="$store.browserPage.extensionMenuOpen" x-transition
style="display: none;">
<div class="browser-extension-preset">
<label for="browser-model-preset">Browser LLM Preset</label>
<select id="browser-model-preset" x-model="$store.browserPage.modelPreset"
@change="$store.browserPage.setBrowserModelPreset($event.target.value)"
:disabled="$store.browserPage.modelPresetSaving">
<option value="">Default Main Model</option>
<template x-for="preset in $store.browserPage.modelPresetOptions" :key="preset.name">
<option :value="preset.name" x-text="preset.label"></option>
</template>
</select>
<div class="browser-extension-preset-summary" x-text="$store.browserPage.modelPresetSummary()">
</div>
</div>
<div class="browser-quick-location">
<div class="browser-quick-row">
<span>Browser</span>
<div class="browser-location-toggle" role="group" aria-label="Browser used by the agent">
<button type="button" :aria-pressed="($store.browserPage.runtimeBackend === 'host_required').toString()"
:disabled="$store.browserPage.runtimeBackendSaving"
@click="$store.browserPage.setRuntimeBackend('host_required')">Host</button>
<button type="button" :aria-pressed="($store.browserPage.runtimeBackend === 'container').toString()"
:disabled="$store.browserPage.runtimeBackendSaving"
@click="$store.browserPage.setRuntimeBackend('container')">Container</button>
</div>
</div>
<button type="button" class="browser-configure-host"
x-show="$store.browserPage.runtimeBackend === 'host_required'"
@click="$store.browserPage.openExtensionsSettings()">Configure host browser</button>
</div>
<button type="button" class="dropdown-item" @click="$store.browserPage.openExtensionsSettings()">
<x-icon name="tune"></x-icon>
<span>More settings</span>
</button>
</div>
</div>
</div>
</div>
<div class="browser-stage" tabindex="0" @click="$el.focus()"
:class="{ 'is-annotating': $store.browserPage.annotating }"
@wheel.prevent="$store.browserPage.handleStageWheel($event)">
<template x-if="$store.browserPage.isInteractiveSurface($el.parentElement)">
<iframe class="browser-interactive-frame"
:src="$store.browserPage.interactiveViewUrl" :data-volume="$store.browserPage.volume"
aria-label="Browser viewport"
allow="clipboard-write; autoplay"
@browser-audio-error="$store.browserPage.volumeError = $event.detail"
@load="$store.browserPage.onInteractiveViewLoad()"></iframe>
</template>
<canvas class="browser-frame browser-frame-canvas"
x-show="!$store.browserPage.usesInteractiveTransport() && $store.browserPage.frameCanvasReady"
x-init="$store.browserPage.attachFrameCanvas($el)"
@click="$store.browserPage.sendMouse('click', $event)"
@mousemove.throttle.250ms="$store.browserPage.sendMouse('move', $event)"></canvas>
<template x-if="!$store.browserPage.usesInteractiveTransport() && $store.browserPage.frameSrc">
<img class="browser-frame browser-frame-image" :src="$store.browserPage.frameSrc"
@click="$store.browserPage.sendMouse('click', $event)"
@mousemove.throttle.250ms="$store.browserPage.sendMouse('move', $event)" draggable="false" />
</template>
<template x-if="$store.browserPage.annotating && $store.browserPage.hasFrame()">
<div class="browser-annotation-layer" :style="$store.browserPage.annotationLayerStyle()"
:class="{ 'is-busy': $store.browserPage.annotationBusy }"
@pointerdown.stop.prevent="$store.browserPage.startAnnotationSelection($event)"
@pointermove.stop.prevent="$store.browserPage.moveAnnotationSelection($event)"
@pointerup.stop.prevent="$store.browserPage.finishAnnotationSelection($event)"
@pointercancel.stop.prevent="$store.browserPage.cancelAnnotationSelection($event)"
@pointerleave="$store.browserPage.clearAnnotationHover()">
<template x-if="$store.browserPage.annotationHover && !$store.browserPage.annotationDraft && !$store.browserPage.annotationDragRect">
<div class="browser-annotation-box is-hover"
:style="$store.browserPage.annotationBoxStyle($store.browserPage.annotationHover.rect)">
<span class="browser-annotation-hover-label"
x-text="$store.browserPage.annotationHoverLabel()"></span>
</div>
</template>
<template x-for="annotation in $store.browserPage.visibleAnnotations()" :key="annotation.id">
<div class="browser-annotation-box is-saved"
:style="$store.browserPage.annotationBoxStyle(annotation.rect)">
<span class="browser-annotation-number" x-text="annotation.index"></span>
</div>
</template>
<template x-if="$store.browserPage.annotationDragRect">
<div class="browser-annotation-box is-draft"
:style="$store.browserPage.annotationBoxStyle($store.browserPage.annotationDragRect)">
</div>
</template>
</div>
</template>
<template x-if="$store.browserPage.annotationDraft">
<div class="browser-annotation-popover"
:style="$store.browserPage.annotationPopoverStyle()"
@click.stop @pointerdown.stop @keydown.stop>
<div class="browser-annotation-popover-title">
<span class="browser-annotation-popover-heading">
<span class="browser-annotation-number" x-text="$store.browserPage.nextAnnotationIndex()"></span>
<span x-text="$store.browserPage.annotationDraftTitle()"></span>
</span>
<button type="button" class="browser-annotation-popover-close"
title="Cancel annotation" aria-label="Cancel annotation"
@click="$store.browserPage.cancelAnnotationDraft()">
<x-icon name="close"></x-icon>
</button>
</div>
<textarea x-model="$store.browserPage.annotationDraftText" placeholder="Comment"
maxlength="1200" x-init="$nextTick(() => $el.focus())"></textarea>
<div class="browser-annotation-actions">
<button type="button" class="browser-annotation-mic mic-inactive"
data-whisper-microphone title="Record annotation comment"
aria-label="Record annotation comment"
x-init="$nextTick(() => $store.browserPage.syncAnnotationMicrophoneUI())"
@click="$store.browserPage.startAnnotationVoice(true)">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 18" fill="currentColor" aria-hidden="true">
<path d="m8,12c1.66,0,3-1.34,3-3V3c0-1.66-1.34-3-3-3s-3,1.34-3,3v6c0,1.66,1.34,3,3,3Zm-1,1.9c-2.7-.4-4.8-2.6-5-5.4H0c.2,3.8,3.1,6.9,7,7.5v2h2v-2c3.9-.6,6.8-3.7,7-7.5h-2c-.2,2.8-2.3,5-5,5.4h-2Z" />
</svg>
</button>
<button type="button" class="browser-annotation-send"
title="Add annotation" aria-label="Add annotation"
:disabled="!String($store.browserPage.annotationDraftText || '').trim()"
@click="$store.browserPage.addAnnotationComment()">
<x-icon name="arrow_forward"></x-icon>
</button>
</div>
</div>
</template>
<div class="browser-annotation-tray"
x-show="$store.browserPage.pendingAnnotations().length"
:class="{ 'is-floating': $store.browserPage.annotationTrayPosition, 'is-dragging': $store.browserPage.annotationTrayDragging }"
:style="$store.browserPage.annotationTrayStyle()"
x-transition style="display: none;"
@click.stop @pointerdown.stop @keydown.stop
@pointermove.window="$store.browserPage.moveAnnotationTrayDrag($event)"
@pointerup.window="$store.browserPage.finishAnnotationTrayDrag($event)"
@pointercancel.window="$store.browserPage.finishAnnotationTrayDrag($event)">
<div class="browser-annotation-tray-header"
@pointerdown.stop="$store.browserPage.startAnnotationTrayDrag($event)">
<span x-text="$store.browserPage.annotationBatchLabel()"></span>
<button type="button" class="browser-annotation-clear" title="Clear annotations"
aria-label="Clear annotations" @click="$store.browserPage.clearPendingAnnotations()">
<x-icon name="delete"></x-icon>
</button>
</div>
<div class="browser-annotation-chips">
<template x-for="annotation in $store.browserPage.pendingAnnotations()" :key="annotation.id">
<div class="browser-annotation-chip" :title="annotation.title + ' — ' + annotation.url">
<span class="browser-annotation-number" x-text="annotation.index"></span>
<span class="browser-annotation-chip-text" x-text="annotation.comment"></span>
<button type="button" title="Remove annotation" aria-label="Remove annotation"
@click="$store.browserPage.removeAnnotationComment(annotation.id)">
<x-icon name="close"></x-icon>
</button>
</div>
</template>
</div>
<div class="browser-annotation-tray-actions">
<button type="button" class="browser-annotation-mic mic-inactive"
data-whisper-microphone title="Record annotation instruction"
aria-label="Record annotation instruction"
x-init="$nextTick(() => $store.browserPage.syncAnnotationMicrophoneUI())"
@click="$store.browserPage.startAnnotationVoice()">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 18" fill="currentColor" aria-hidden="true">
<path d="m8,12c1.66,0,3-1.34,3-3V3c0-1.66-1.34-3-3-3s-3,1.34-3,3v6c0,1.66,1.34,3,3,3Zm-1,1.9c-2.7-.4-4.8-2.6-5-5.4H0c.2,3.8,3.1,6.9,7,7.5v2h2v-2c3.9-.6,6.8-3.7,7-7.5h-2c-.2,2.8-2.3,5-5,5.4h-2Z" />
</svg>
</button>
<button type="button" class="browser-annotation-send"
title="Send annotations" aria-label="Send annotations"
@click="$store.browserPage.sendAnnotationsToChat()">
<x-icon name="arrow_forward"></x-icon>
</button>
</div>
</div>
<template x-if="!$store.browserPage.hasFrame() && !$store.browserPage.isBusy()">
<div class="browser-empty">
<x-icon name="captive_portal"></x-icon>
<button class="btn btn-field" @click="$store.browserPage.command('open')">Open
Browser</button>
</div>
</template>
<template x-if="!$store.browserPage.hasFrame() && $store.browserPage.isBusy()">
<div class="browser-empty browser-starting" role="status" aria-live="polite">
<x-icon class="spinning" name="progress_activity"></x-icon>
<span x-text="$store.browserPage.browserLoadingLabel()"></span>
<small aria-live="off" x-show="$store.browserPage.browserStartupDetail()" x-text="$store.browserPage.browserStartupDetail()"></small>
</div>
</template>
</div>
<template x-if="$store.browserPage.error">
<div class="browser-bottom-status has-error">
<div class="browser-error" x-text="$store.browserPage.error" :title="$store.browserPage.error"></div>
</div>
</template>
</div>
</template>
</div>
<style>
.modal-inner.browser-modal {
box-sizing: border-box;
container-type: inline-size;
width: min(78vw, 1120px);
height: min(88vh, 900px);
min-width: min(320px, calc(100vw - 16px));
min-height: min(480px, calc(100vh - 16px));
max-width: calc(100vw - 16px);
max-height: calc(100vh - 16px);
resize: both;
border: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
border-radius: 7px;
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
background: color-mix(in srgb, var(--color-background) 94%, #000 6%);
}
.modal-inner.browser-modal.is-focus-mode {
resize: none;
border-radius: 6px;
}
.modal-inner.browser-modal.is-focus-mode .browser-modal-focus-button {
color: var(--color-text);
border-color: color-mix(in srgb, var(--color-primary) 42%, var(--color-border));
background: color-mix(in srgb, var(--color-primary) 16%, var(--color-background));
}
.modal.modal-floating {
pointer-events: none;
}
.modal.modal-floating .modal-inner {
pointer-events: auto;
}
.modal-inner.browser-modal .modal-header {
cursor: move;
user-select: none;
background: color-mix(in srgb, var(--color-background) 92%, #000 8%);
border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
}
.modal-inner.browser-modal .modal-close {
font-size: 1.35rem;
line-height: 1;
}
.modal-inner.browser-modal .modal-scroll {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
padding: 0;
}
.modal-inner.browser-modal .modal-bd.browser-modal-body {
box-sizing: border-box;
display: flex;
flex-direction: column;
height: 100%;
padding: 0;
min-height: 0;
}
.modal-inner.browser-modal .modal-bd.browser-modal-body>x-component,
.modal-inner.browser-modal .modal-bd.browser-modal-body>x-component>div,
.modal-inner.browser-modal .modal-bd.browser-modal-body>div {
display: flex;
flex: 1 1 auto;
width: 100%;
height: 100%;
min-width: 0;
min-height: 0;
}
.modal-inner.browser-modal .browser-panel {
height: 100%;
max-height: 100%;
overflow: hidden;
}
.browser-panel {
--browser-chrome-surface: var(--surface-chrome);
--browser-chrome-border: color-mix(in srgb, var(--color-border) 58%, transparent);
--browser-tab-hover-border: color-mix(in srgb, var(--color-border) 78%, transparent);
--browser-control-size: 32px;
--browser-address-height: 34px;
--browser-tab-height: 36px;
--browser-tab-close-size: 32px;
--browser-control-radius: 0.55rem;
box-sizing: border-box;
container-type: inline-size;
display: flex;
flex: 1 1 auto;
flex-direction: column;
gap: 0;
height: 100%;
min-height: 0;
position: relative;
}
.browser-toolbar {
display: flex;
align-items: center;
gap: 6px;
}
.browser-windows {
display: flex;
align-items: center;
gap: 4px;
min-width: 0;
overflow-x: auto;
}
.browser-window {
display: inline-flex;
flex: none;
align-items: center;
gap: 6px;
border: 0;
border-radius: 6px;
padding: 6px 9px;
max-width: 13rem;
min-width: 44px;
background: transparent;
color: var(--color-text-secondary);
cursor: pointer;
}
.browser-window[aria-selected="true"], .browser-window:hover {
background: var(--color-background-hover);
color: var(--color-text);
}
.browser-window-count { flex: none; }
.browser-window-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-window x-icon { font-size: 16px; }
.browser-panel .btn-icon-action {
width: var(--browser-control-size);
min-width: var(--browser-control-size);
height: var(--browser-control-size);
min-height: var(--browser-control-size);
border-radius: var(--browser-control-radius);
}
.browser-panel .btn-icon-action {
color: color-mix(in srgb, var(--color-text) 72%, var(--color-primary) 28%);
background: color-mix(in srgb, var(--color-background) 26%, transparent);
border-color: var(--browser-chrome-border);
}
.browser-panel .btn-icon-action:hover:not(:disabled) {
color: var(--color-text);
border-color: color-mix(in srgb, var(--color-primary) 34%, var(--browser-chrome-border));
background: color-mix(in srgb, var(--color-background-hover) 62%, transparent);
box-shadow: none;
}
.browser-panel .btn-icon-action .material-symbols-outlined {
font-size: 1.12rem;
}
.browser-session-controls {
display: flex;
flex: none;
align-items: center;
gap: 6px;
margin-inline-start: auto;
}
.browser-session-controls .browser-extensions.is-active {
color: #2e7d32;
}
.browser-volume,
.browser-extension-menu {
position: relative;
display: flex;
flex: 0 0 auto;
}
.browser-volume-popover,
.browser-extension-dropdown {
position: absolute;
top: calc(100% + 6px);
right: 0;
z-index: 40;
display: flex;
flex-direction: column;
gap: 7px;
border: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent);
border-radius: 7px;
background: var(--color-background);
box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}
.browser-volume-popover {
align-items: center;
right: 50%;
transform: translateX(50%);
padding: 10px 4px 4px;
}
.browser-volume-popover input[type="range"] {
writing-mode: vertical-lr;
direction: rtl;
appearance: auto;
width: 28px;
height: 100px;
padding: 0;
margin: 0;
background: transparent;
accent-color: var(--color-primary);
}
.browser-volume-popover input:focus-visible {
outline: 1px solid var(--color-text-secondary);
outline-offset: 1px;
}
.browser-extension-dropdown {
width: min(320px, calc(100cqw - 24px));
max-height: min(72vh, 560px);
overflow-y: auto;
padding: 10px;
}
.browser-extension-dropdown .dropdown-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
min-height: 34px;
padding: 7px 9px;
border: 0;
border-radius: 6px;
background: transparent;
color: var(--color-text);
font-weight: 600;
text-align: left;
cursor: pointer;
}
.browser-extension-dropdown .dropdown-item:hover {
background: color-mix(in srgb, var(--color-panel) 82%, transparent);
}
.browser-quick-location {
padding: 9px 2px;
border-top: 1px solid var(--color-border);
}
.browser-quick-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.browser-location-toggle {
display: inline-flex;
align-items: center;
overflow: hidden;
border: 1px solid var(--color-border);
border-radius: 8px;
background: var(--color-panel);
}
.browser-location-toggle button {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 30px;
border: 0;
padding: 4px 10px;
background: transparent;
color: var(--color-text-secondary);
font: inherit;
font-size: 0.8rem;
cursor: pointer;
}
.browser-location-toggle button[aria-pressed="true"] {
background: var(--color-background);
color: var(--color-text);
box-shadow: inset 0 0 0 1px var(--color-border);
border-radius: 6px;
}
.browser-configure-host {
display: block;
margin-top: 6px;
padding: 0;
border: 0;
background: transparent;
color: color-mix(in srgb, var(--color-text) 76%, transparent);
font: inherit;
font-size: 0.75rem;
cursor: pointer;
}
.browser-configure-host:hover { color: var(--color-text); text-decoration: underline; }
.browser-location-toggle button:disabled { opacity: 0.4; cursor: default; }
.browser-quick-location button:focus-visible,
.browser-extension-preset {
display: flex;
flex-direction: column;
gap: 7px;
}
.browser-extension-preset label,
.browser-quick-row > span {
font-size: 0.76rem;
font-weight: 650;
color: var(--color-text-secondary);
}
.browser-extension-preset select {
width: 100%;
min-height: 32px;
padding: 5px 8px;
border: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
border-radius: 6px;
background: var(--color-input);
color: var(--color-text);
}
.browser-extension-preset-summary {
color: var(--color-text-secondary);
font-size: 0.75rem;
padding-left: var(--spacing-xxs);
}
.browser-stage {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
position: relative;
contain: size layout paint;
outline: none;
}
.browser-stage.is-annotating {
cursor: crosshair;
}
.browser-frame {
display: block;
position: absolute;
inset: 0;
width: 100%;
height: 100%;
min-width: 0;
min-height: 0;
object-fit: contain;
image-rendering: auto;
user-select: none;
background: #fff;
}
.browser-interactive-frame {
display: block;
position: absolute;
inset: 0;
z-index: 1;
box-sizing: border-box;
width: 100%;
height: 100%;
border: 0;
background: #fff;
}
.browser-annotation-layer {
position: absolute;
inset: 0;
z-index: 12;
cursor: crosshair;
touch-action: none;
background: rgba(37, 99, 235, 0.035);
}
.browser-annotation-layer.is-busy {
cursor: progress;
}
.browser-annotation-box {
position: absolute;
box-sizing: border-box;
min-width: 8px;
min-height: 8px;
border: 2px solid #3399ff;
background: rgba(51, 153, 255, 0.16);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.52), 0 8px 22px rgba(0, 0, 0, 0.18);
pointer-events: none;
}
.browser-annotation-box.is-draft {
border-style: dashed;
background: rgba(51, 153, 255, 0.1);
}
.browser-annotation-box.is-hover {
border-color: #22c55e;
background: rgba(34, 197, 94, 0.12);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.58);
}
.browser-annotation-hover-label {
position: absolute;
top: 2px;
left: 2px;
max-width: min(320px, calc(100vw - 24px));
overflow: hidden;
padding: 2px 5px;
border-radius: 4px;
background: rgba(6, 78, 59, 0.92);
color: #fff;
font-size: 0.7rem;
font-weight: 700;
line-height: 1.3;
text-overflow: ellipsis;
white-space: nowrap;
}
.browser-annotation-number {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
min-width: 22px;
height: 22px;
min-height: 22px;
border-radius: 50%;
background: #3399ff;
color: #fff;
font-size: 0.74rem;
font-weight: 800;
line-height: 1;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.browser-annotation-box .browser-annotation-number {
position: absolute;
top: -12px;
left: -12px;
}
.browser-annotation-popover,
.browser-annotation-tray {
position: absolute;
border: 1px solid color-mix(in srgb, var(--color-border) 76%, transparent);
border-radius: 7px;
background: color-mix(in srgb, var(--color-background) 96%, #000 4%);
color: var(--color-text);
box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}
.browser-annotation-popover {
z-index: 24;
display: flex;
flex-direction: column;
gap: 8px;
padding: 10px;
}
.browser-annotation-popover-title,
.browser-annotation-tray-header {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
font-size: 0.82rem;
font-weight: 750;
}
.browser-annotation-popover-title {
justify-content: space-between;
}
.browser-annotation-popover-heading {
display: inline-flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.browser-annotation-popover textarea {
width: 100%;
min-height: 82px;
max-height: 160px;
resize: vertical;
padding: 8px;
border: 1px solid color-mix(in srgb, var(--color-border) 74%, transparent);
border-radius: 6px;
background: var(--color-input);
color: var(--color-text);
font: inherit;
line-height: 1.35;
}
.browser-annotation-actions,
.browser-annotation-tray-actions {
display: flex;
justify-content: flex-end;
gap: 7px;
}
.browser-annotation-tray-actions .btn {
min-height: 30px;
padding: 0 10px;
white-space: nowrap;
}
.browser-annotation-tray {
z-index: 20;
right: 10px;
bottom: 10px;
display: flex;
flex-direction: column;
gap: 9px;
width: min(360px, calc(100% - 20px));
max-height: min(48%, 310px);
padding: 10px;
}
.browser-annotation-tray.is-dragging {
user-select: none;
}
.browser-annotation-tray-header {
justify-content: space-between;
cursor: grab;
user-select: none;
}
.browser-annotation-tray.is-dragging .browser-annotation-tray-header {
cursor: grabbing;
}
.browser-annotation-popover-close,
.browser-annotation-clear,
.browser-annotation-chip button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
min-width: 24px;
min-height: 24px;
padding: 0;
border: 0;
border-radius: 6px;
background: transparent;
color: color-mix(in srgb, var(--color-text) 64%, transparent);
cursor: pointer;
}
.browser-annotation-popover-close:hover,
.browser-annotation-clear:hover,
.browser-annotation-chip button:hover {
background: color-mix(in srgb, var(--color-panel) 82%, transparent);
color: var(--color-text);
}
.browser-annotation-popover-close .material-symbols-outlined,
.browser-annotation-clear .material-symbols-outlined,
.browser-annotation-chip button .material-symbols-outlined {
font-size: 16px;
}
.browser-annotation-chips {
display: flex;
flex-direction: column;
gap: 6px;
min-height: 0;
overflow: auto;
}
.browser-annotation-chip {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
align-items: center;
gap: 7px;
min-height: 32px;
padding: 5px 6px;
border: 1px solid color-mix(in srgb, var(--color-border) 54%, transparent);
border-radius: 7px;
background: color-mix(in srgb, var(--color-panel) 74%, transparent);
}
.browser-annotation-chip .browser-annotation-number {
width: 20px;
min-width: 20px;
height: 20px;
min-height: 20px;
font-size: 0.68rem;
}
.browser-annotation-chip-text {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.78rem;
line-height: 1.25;
}
.browser-annotation-actions,
.browser-annotation-tray-actions {
align-items: center;
gap: 0.58rem;
}
.browser-annotation-mic,
.browser-annotation-send {
display: inline-flex;
flex: 0 0 3.15rem;
align-items: center;
justify-content: center;
width: 3.15rem;
min-width: 3.15rem;
height: 3.15rem;
margin: 0;
padding: 0;
border: 1px solid transparent;
color: #fff;
cursor: pointer;
transition: background-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
}
.browser-annotation-mic {
border-radius: 12px;
background: transparent;
color: grey;
}
.browser-annotation-mic svg {
transform-origin: center;
transition: color 0.2s ease, transform 0.12s ease-in-out;
}
.browser-annotation-mic.mic-disabled {
color: #5f6368;
cursor: not-allowed;
opacity: 0.58;
}
.browser-annotation-mic.mic-activating,
.browser-annotation-mic.mic-processing {
animation: browser-mic-pulse 0.8s infinite;
}
.browser-annotation-mic.mic-activating { color: silver; }
.browser-annotation-mic.mic-listening { color: red; }
.browser-annotation-mic.mic-recording { color: green; }
.browser-annotation-mic.mic-waiting { color: teal; }
.browser-annotation-mic.mic-processing { color: darkcyan; }
@media (hover: hover) {
.browser-annotation-mic:not(.mic-disabled):hover svg { transform: scale(1.08); }
}
.browser-annotation-mic:not(.mic-disabled):active svg { transform: scale(0.92); }
.browser-annotation-send {
border-radius: 12px;
background: var(--color-highlight);
}
.browser-annotation-send:hover { background: color-mix(in srgb, var(--color-highlight) 80%, black); }
.browser-annotation-send:active { background: color-mix(in srgb, var(--color-highlight) 65%, black); transform: translateY(1px) scale(0.98); }
.browser-annotation-send:disabled {
background: var(--color-highlight);
cursor: not-allowed;
opacity: 0.5;
}
.browser-annotation-mic svg,
.browser-annotation-send .material-symbols-outlined {
width: 1.5rem;
height: 1.5rem;
font-size: 1.78rem;
}
@keyframes browser-mic-pulse {
50% { transform: scale(1.1); }
}
.browser-empty {
display: flex;
align-items: center;
gap: 8px;
min-height: 42px;
font-size: 0.88rem;
}
.browser-bottom-status {
display: flex;
align-items: center;
flex: 0 0 24px;
min-height: 24px;
max-height: 24px;
min-width: 0;
padding: 0 10px;
overflow: hidden;
border-top: 1px solid color-mix(in srgb, var(--color-border) 58%, transparent);
background: color-mix(in srgb, var(--color-background) 95%, #000 5%);
color: color-mix(in srgb, var(--color-text) 74%, transparent);
font-size: 0.76rem;
line-height: 1;
}
.browser-bottom-status.has-error {
color: #fca5a5;
background: color-mix(in srgb, #7f1d1d 22%, var(--color-background));
}
.browser-error {
display: inline-flex;
align-items: center;
gap: 6px;
min-width: 0;
max-width: 100%;
overflow: hidden;
white-space: nowrap;
}
.browser-error {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
.browser-modal .spinning,
.browser-panel .spinning {
display: inline-block;
transform-origin: center;
animation: browser-spin 0.8s linear infinite;
}
@keyframes browser-spin {
to {
transform: rotate(360deg);
}
}
.browser-empty {
display: grid;
flex: 1 1 auto;
width: 100%;
min-height: 0;
justify-items: center;
align-content: center;
text-align: center;
padding: 24px;
color: var(--color-text);
}
.browser-starting .material-symbols-outlined {
font-size: 1.45rem;
}
.browser-starting small {
max-width: 28rem;
margin-top: 0.5rem;
color: var(--color-text-muted);
line-height: 1.5;
}
</style>
</body>
</html>