feat(web/claw): restyle the interface after Rhema Together
android / debug (push) Successful in 2m16s
android / release (push) Successful in 2m9s
ci / checks (push) Successful in 3m39s
ci / test (push) Successful in 2m5s
ci / docker (push) Successful in 1m52s
ci / web (push) Successful in 13s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 1m56s
ci / chart (push) Successful in 6s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 20s
ci / publish-edge-chart (push) Successful in 4s
android / debug (push) Successful in 2m16s
android / release (push) Successful in 2m9s
ci / checks (push) Successful in 3m39s
ci / test (push) Successful in 2m5s
ci / docker (push) Successful in 1m52s
ci / web (push) Successful in 13s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 1m56s
ci / chart (push) Successful in 6s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 20s
ci / publish-edge-chart (push) Successful in 4s
The web client kept its own dark shell: an icon rail, neon jade accents, and rows that reported state with colored dots and pills. Rhema Together had since settled on a warmer, quieter language, and the two surfaces no longer looked like one product. The shell is now one 232px sidebar plus a view. Chat lists sessions in the sidebar and renders the transcript in a 760px column; settings moves its searchable nav into the same sidebar and its pages onto an 880px column. The palette, type scale, controls, cards, and markdown come from Together's light theme, with its dark values following the OS. FiraCode Nerd Font Mono sets code, and the product mark, logo, and lucide icons replace the glyph characters. Status is a word now: running, waiting, held, connected, live, snapshot. The rail, its dots, the duplicate consent deny action, and the session key tag are gone. The model backend moved into the chat topbar beside the stream state. The mobile shell keeps the composer fixed in chat and lets settings scroll as a document. README and component docs follow the new layout. nuxt typecheck and build pass; checked light and dark at 1280x800 and 390x844 against mock API data.
This commit is contained in:
1 parent
acda9cc537
commit
d17d8e2973
33 files changed
+1858
-1383
No files matched your search
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
// The agent's face at one size. Two voices: `initials` (the chat, the
|
||||
// sidebar, the rail's bottom — the avatar image when there is one, the
|
||||
// initials when not) and `mark` (the rail's brand slot — the avatar
|
||||
// image when there is one, the mark or emoji, ῥ by default). The
|
||||
// precedence lives here and nowhere else.
|
||||
// The agent's face at one size. Two voices: `initials` (the chat rows
|
||||
// and the sidebar's account row: the avatar image when there is one,
|
||||
// the initials when not) and `mark` (the logo slot: the avatar image
|
||||
// when there is one, the mark or emoji, ῥ by default). The precedence
|
||||
// lives here and nowhere else.
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
variant?: 'initials' | 'mark'
|
||||
@@ -52,7 +52,7 @@ const glyph = computed(() =>
|
||||
display: grid;
|
||||
place-items: center;
|
||||
flex: none;
|
||||
border-radius: 25%;
|
||||
border-radius: var(--r-avatar);
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
// The pill: one small status or tag word. Machine spellings (session
|
||||
// One small tag: a status word or a machine spelling. Machine spellings (session
|
||||
// keys, model ids) stay mono via the global `.badge` voice.
|
||||
defineProps<{
|
||||
variant?: 'dim' | 'accent' | 'ok' | 'warn' | 'error'
|
||||
|
||||
@@ -1,32 +1,37 @@
|
||||
<script setup lang="ts">
|
||||
// The inline callout: a bordered note with a tone — the "restart
|
||||
// required"/"changes not applied" voice from the designs. One per
|
||||
// The inline callout: a bordered note with a tone, the "restart
|
||||
// required" or "changes not applied" voice from the pages. One per
|
||||
// situation, inside the page flow, dismissible by the caller.
|
||||
defineProps<{
|
||||
import { AlertTriangle, CheckCircle2, Info, RotateCcw, X } from 'lucide-vue-next'
|
||||
|
||||
withDefaults(defineProps<{
|
||||
variant: 'info' | 'ok' | 'warn' | 'error'
|
||||
title?: string
|
||||
dismissible?: boolean
|
||||
}>()
|
||||
}>(), {
|
||||
title: undefined,
|
||||
dismissible: false,
|
||||
})
|
||||
|
||||
defineEmits<{ dismiss: [] }>()
|
||||
|
||||
const marks: Record<string, string> = {
|
||||
info: 'i',
|
||||
ok: '✓',
|
||||
warn: '↺',
|
||||
error: '✗',
|
||||
}
|
||||
const ICONS = {
|
||||
info: Info,
|
||||
ok: CheckCircle2,
|
||||
warn: RotateCcw,
|
||||
error: AlertTriangle,
|
||||
} as const
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="callout" :class="variant" role="status">
|
||||
<span class="mark" aria-hidden="true">{{ marks[variant] }}</span>
|
||||
<component :is="ICONS[variant]" :size="16" class="mark" aria-hidden="true" />
|
||||
<div class="body">
|
||||
<strong v-if="title" class="title">{{ title }}</strong>
|
||||
<div class="text"><slot /></div>
|
||||
</div>
|
||||
<button v-if="dismissible" class="ghost dismiss" title="dismiss" @click="$emit('dismiss')">
|
||||
×
|
||||
<button v-if="dismissible" class="icon-btn" title="Dismiss" aria-label="Dismiss" @click="$emit('dismiss')">
|
||||
<X :size="14" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -35,34 +40,29 @@ const marks: Record<string, string> = {
|
||||
.callout {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
padding: 11px 14px;
|
||||
gap: var(--sp-3);
|
||||
padding: var(--sp-3);
|
||||
border: 1px solid var(--border);
|
||||
border-left: 3px solid var(--info);
|
||||
border-radius: 8px;
|
||||
background: color-mix(in srgb, var(--info) 7%, var(--surface));
|
||||
border-radius: var(--r-control);
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.callout.ok {
|
||||
border-left-color: var(--ok);
|
||||
background: color-mix(in srgb, var(--ok) 7%, var(--surface));
|
||||
}
|
||||
|
||||
.callout.warn {
|
||||
border-left-color: var(--warn);
|
||||
background: color-mix(in srgb, var(--warn) 7%, var(--surface));
|
||||
}
|
||||
|
||||
.callout.error {
|
||||
border-left-color: var(--error);
|
||||
background: color-mix(in srgb, var(--error) 7%, var(--surface));
|
||||
border-left-color: var(--danger);
|
||||
}
|
||||
|
||||
.mark {
|
||||
flex: none;
|
||||
width: 18px;
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
margin-top: 2px;
|
||||
color: var(--info);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ const marks: Record<string, string> = {
|
||||
}
|
||||
|
||||
.error .mark {
|
||||
color: var(--error);
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.body {
|
||||
@@ -85,16 +85,20 @@ const marks: Record<string, string> = {
|
||||
|
||||
.title {
|
||||
display: block;
|
||||
margin-bottom: var(--sp-1);
|
||||
color: var(--text);
|
||||
font-size: var(--fs-ui);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: var(--text2);
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-meta);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.dismiss {
|
||||
padding: 0 6px;
|
||||
font-size: 14px;
|
||||
.callout .icon-btn {
|
||||
width: 24px;
|
||||
min-height: 24px;
|
||||
}
|
||||
</style>
|
||||
@@ -3,6 +3,7 @@
|
||||
// backdrop click close it; the panel stops the click from beneath. The
|
||||
// caller owns open state and what the actions do.
|
||||
import { onUnmounted, watch } from 'vue'
|
||||
import { X } from 'lucide-vue-next'
|
||||
|
||||
const props = defineProps<{
|
||||
open: boolean
|
||||
@@ -36,7 +37,9 @@ onUnmounted(() => {
|
||||
<div class="panel" role="dialog" aria-modal="true" :aria-label="title">
|
||||
<header class="head">
|
||||
<strong class="title">{{ title }}</strong>
|
||||
<button class="ghost dismiss" title="close" @click="emit('close')">×</button>
|
||||
<button class="icon-btn" title="Close" aria-label="Close" @click="emit('close')">
|
||||
<X :size="16" aria-hidden="true" />
|
||||
</button>
|
||||
</header>
|
||||
<div class="body">
|
||||
<slot />
|
||||
@@ -56,50 +59,46 @@ onUnmounted(() => {
|
||||
z-index: 50;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 24px;
|
||||
background: color-mix(in srgb, var(--sunken) 70%, transparent);
|
||||
padding: var(--sp-6);
|
||||
background: var(--overlay);
|
||||
}
|
||||
|
||||
.panel {
|
||||
width: 100%;
|
||||
max-width: 520px;
|
||||
max-height: calc(100vh - 48px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--surface);
|
||||
width: 100%;
|
||||
max-width: 520px;
|
||||
max-height: calc(100vh - var(--sp-12));
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 18px 48px color-mix(in srgb, var(--sunken) 80%, transparent);
|
||||
border-radius: var(--r-card);
|
||||
background: var(--surface);
|
||||
box-shadow: 0 18px 48px color-mix(in srgb, var(--text) 18%, transparent);
|
||||
}
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 14px 16px;
|
||||
gap: var(--sp-3);
|
||||
padding: var(--sp-3) var(--sp-4);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.dismiss {
|
||||
padding: 0 6px;
|
||||
font-size: 15px;
|
||||
font-size: var(--fs-ui);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.body {
|
||||
padding: 16px;
|
||||
padding: var(--sp-4);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
padding: 12px 16px;
|
||||
gap: var(--sp-2);
|
||||
padding: var(--sp-3) var(--sp-4);
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
</style>
|
||||
@@ -1,137 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
// The icon rail: the leftmost strip every view shares — the brand mark,
|
||||
// one button per view, and the claw's pulse at the bottom. The active
|
||||
// view is highlighted; navigation intent flows up, the shell decides.
|
||||
defineProps<{
|
||||
view: 'chat' | 'settings'
|
||||
/** null while /healthz has not answered yet. */
|
||||
clawUp: boolean | null
|
||||
identity?: { mark: string | null; initials: string | null; name: string | null } | null
|
||||
avatarUrl?: string | null
|
||||
}>()
|
||||
|
||||
defineEmits<{ navigate: [view: 'chat' | 'settings'] }>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<nav class="rail">
|
||||
<AgentAvatar
|
||||
variant="mark"
|
||||
:avatar-url="avatarUrl"
|
||||
:mark="identity?.mark"
|
||||
:size="36"
|
||||
class="mark"
|
||||
title="rhema, the spoken word"
|
||||
/>
|
||||
|
||||
<button
|
||||
class="rail-btn"
|
||||
:class="{ active: view === 'chat' }"
|
||||
title="Chat"
|
||||
aria-label="Chat"
|
||||
@click="$emit('navigate', 'chat')"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M21 11.5a7.5 7.5 0 0 1-7.5 7.5H8l-4.5 3V11.5a7.5 7.5 0 0 1 7.5-7.5h2.5a7.5 7.5 0 0 1 7.5 7.5Z" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="rail-btn"
|
||||
:class="{ active: view === 'settings' }"
|
||||
title="Settings"
|
||||
aria-label="Settings"
|
||||
@click="$emit('navigate', 'settings')"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<div class="spacer" />
|
||||
|
||||
<span
|
||||
class="pulse"
|
||||
:title="clawUp === null ? 'health unknown' : clawUp ? '/healthz ok' : '/healthz failing'"
|
||||
>
|
||||
<span class="dot" :class="{ up: clawUp === true, down: clawUp === false }" aria-hidden="true" />
|
||||
</span>
|
||||
<AgentAvatar
|
||||
:avatar-url="avatarUrl"
|
||||
:initials="identity?.initials ?? identity?.name?.slice(0, 1)"
|
||||
:size="30"
|
||||
class="avatar"
|
||||
title="rhema"
|
||||
/>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.rail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
width: 56px;
|
||||
flex: none;
|
||||
padding: 12px 0;
|
||||
background: var(--sunken);
|
||||
border-right: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.mark {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.rail-btn {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
padding: 0;
|
||||
border-radius: 9px;
|
||||
border-color: transparent;
|
||||
background: none;
|
||||
color: var(--text3);
|
||||
}
|
||||
|
||||
.rail-btn svg {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
}
|
||||
|
||||
.rail-btn:hover:not(:disabled) {
|
||||
background: var(--elevated);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.rail-btn.active {
|
||||
background: color-mix(in srgb, var(--accent) 16%, transparent);
|
||||
color: var(--accent-text);
|
||||
}
|
||||
|
||||
.spacer {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.dot {
|
||||
display: block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--text3);
|
||||
}
|
||||
|
||||
.dot.up {
|
||||
background: var(--ok);
|
||||
}
|
||||
|
||||
.dot.down {
|
||||
background: var(--error);
|
||||
}
|
||||
|
||||
.avatar {
|
||||
margin-top: 8px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,50 +1,48 @@
|
||||
<script setup lang="ts">
|
||||
// The one banner surface: claw down, auth required, stream drops. An
|
||||
// inline band, dismissible when the caller allows it.
|
||||
defineProps<{
|
||||
import { AlertCircle, AlertTriangle, Info, X } from 'lucide-vue-next'
|
||||
|
||||
withDefaults(defineProps<{
|
||||
variant: 'error' | 'warn' | 'info'
|
||||
dismissible?: boolean
|
||||
}>()
|
||||
}>(), {
|
||||
dismissible: false,
|
||||
})
|
||||
|
||||
defineEmits<{ dismiss: [] }>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="banner" :class="variant" role="status">
|
||||
<span class="banner-mark" aria-hidden="true">{{
|
||||
variant === 'error' ? '✗' : variant === 'warn' ? '△' : '·'
|
||||
}}</span>
|
||||
<AlertCircle v-if="variant === 'error'" :size="15" class="banner-mark" aria-hidden="true" />
|
||||
<AlertTriangle v-else-if="variant === 'warn'" :size="15" class="banner-mark" aria-hidden="true" />
|
||||
<Info v-else :size="15" class="banner-mark" aria-hidden="true" />
|
||||
<span class="banner-text"><slot /></span>
|
||||
<slot name="actions" />
|
||||
<button v-if="dismissible" class="banner-dismiss" title="dismiss" @click="$emit('dismiss')">
|
||||
×
|
||||
<button v-if="dismissible" class="icon-btn" title="Dismiss" aria-label="Dismiss" @click="$emit('dismiss')">
|
||||
<X :size="14" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.banner-mark {
|
||||
color: inherit;
|
||||
flex: none;
|
||||
color: var(--info);
|
||||
}
|
||||
|
||||
.banner.error .banner-mark {
|
||||
color: var(--error);
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.banner.warn .banner-mark {
|
||||
color: var(--warn);
|
||||
}
|
||||
|
||||
.banner.info .banner-mark {
|
||||
color: var(--info);
|
||||
}
|
||||
|
||||
.banner-dismiss {
|
||||
padding: 0 8px;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--text3);
|
||||
font-size: 14px;
|
||||
.banner .icon-btn {
|
||||
width: 24px;
|
||||
min-height: 24px;
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
// The one page header: title, an optional subtitle line, and the page's
|
||||
// actions (Save/Discard-style buttons) on the right.
|
||||
// actions (Save/Discard-style buttons) on the right. It sits on the same
|
||||
// 880px column as the page body, so the title and the first card share
|
||||
// a left edge.
|
||||
defineProps<{
|
||||
title: string
|
||||
subtitle?: string
|
||||
@@ -24,25 +26,35 @@ defineProps<{
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding: 18px 24px 14px;
|
||||
gap: var(--sp-5);
|
||||
width: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
padding: var(--sp-8) var(--sp-8) var(--sp-4);
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 19px;
|
||||
font-weight: 700;
|
||||
font-size: var(--fs-title);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.text p {
|
||||
margin: 2px 0 0;
|
||||
color: var(--text3);
|
||||
margin-top: var(--sp-1);
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-meta);
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: var(--sp-2);
|
||||
flex: none;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.page-head {
|
||||
flex-direction: column;
|
||||
gap: var(--sp-3);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
// The session inventory: the dispatch keys a human converses with,
|
||||
// interactive first. Clicking selects the session the chat mirrors.
|
||||
// Displayed names drop the `interactive:` prefix — the full key stays
|
||||
// Displayed names drop the `interactive:` prefix, the full key stays
|
||||
// in the tooltip. Creating and deleting are intent only: the name (or
|
||||
// the key) flows up, the shell answers, and the form closes when the
|
||||
// new key lands in the inventory. The delete button asks nothing itself
|
||||
// — the confirmation, which names the transcript that goes with the
|
||||
// new key lands in the inventory. The delete button asks nothing itself:
|
||||
// the confirmation, which names the transcript that goes with the
|
||||
// session, is the shell's.
|
||||
//
|
||||
// The non-interactive keys fold under *others*: folded (the default),
|
||||
@@ -16,10 +16,11 @@
|
||||
// history route serves. The controls beside it act on its dispatch from
|
||||
// either view.
|
||||
//
|
||||
// The controls sit beside the delete button, on hover, one word each:
|
||||
// hold/run pauses and resumes the key's dispatch, stop aborts — cuts a
|
||||
// live turn, or drops the key's queued work when none runs. Nothing
|
||||
// here is destructive beyond the delete, which keeps its own dialog.
|
||||
// State is a word, not a dot: running, waiting, held, and the queued
|
||||
// count. The controls appear on hover. Hold and run pause and resume the
|
||||
// key's dispatch. Stop aborts: it cuts a live turn, or drops the key's
|
||||
// queued work when none runs.
|
||||
import { Pause, Play, Plus, RefreshCw, Settings, Square, Trash2 } from 'lucide-vue-next'
|
||||
import { SESSION_NAME_PATTERN, isResidentKey } from '~/composables/useClaw'
|
||||
import type { ClawSession } from '~/composables/useClaw'
|
||||
|
||||
@@ -27,11 +28,13 @@ const props = defineProps<{
|
||||
sessions: ClawSession[]
|
||||
activeKey: string
|
||||
loading: boolean
|
||||
clawUp: boolean | null
|
||||
identity?: { name: string | null; tagline: string | null; mark: string | null; initials: string | null } | null
|
||||
avatarUrl?: string | null
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
home: []
|
||||
select: [key: string]
|
||||
refresh: []
|
||||
create: [name: string]
|
||||
@@ -39,6 +42,7 @@ const emit = defineEmits<{
|
||||
pause: [key: string]
|
||||
resume: [key: string]
|
||||
abort: [key: string]
|
||||
navigateSettings: []
|
||||
}>()
|
||||
|
||||
interface Group {
|
||||
@@ -61,8 +65,8 @@ const groups = computed<Group[]>(() => {
|
||||
const byKey = (a: ClawSession, b: ClawSession) => a.key.localeCompare(b.key)
|
||||
// The resident prefixes are the chat sessions: `interactive:` is the
|
||||
// live chat surface, `task:` a scheduled task's own turn, `phone:` the
|
||||
// phone client's, `calendar:` a reminder's. The rest of the inventory —
|
||||
// `job:<instance>#<id>`, a forge thread — holds no turn record: its
|
||||
// phone client's, `calendar:` a reminder's. The rest of the inventory ,
|
||||
// `job:<instance>#<id>`, a forge thread, holds no turn record: its
|
||||
// handler never streams. Its history route serves the session stash
|
||||
// instead, so the row still opens, read-only.
|
||||
const interactive = props.sessions
|
||||
@@ -82,14 +86,14 @@ const groups = computed<Group[]>(() => {
|
||||
const groups: Group[] = []
|
||||
if (interactive.length > 0)
|
||||
groups.push({
|
||||
label: 'interactive',
|
||||
label: 'Interactive',
|
||||
rows: interactive.map(row),
|
||||
working: working(interactive),
|
||||
collapsible: false,
|
||||
})
|
||||
if (others.length > 0)
|
||||
groups.push({
|
||||
label: 'others',
|
||||
label: 'Other keys',
|
||||
rows: others.map(row),
|
||||
working: working(others),
|
||||
collapsible: true,
|
||||
@@ -98,7 +102,7 @@ const groups = computed<Group[]>(() => {
|
||||
})
|
||||
|
||||
/** Whether the others group is folded out; it starts folded, and opens
|
||||
* when the chat opens a row that lives in it — otherwise the selection
|
||||
* when the chat opens a row that lives in it, otherwise the selection
|
||||
* would be invisible. */
|
||||
const othersOpen = ref(false)
|
||||
|
||||
@@ -114,11 +118,13 @@ const shownCount = computed(() =>
|
||||
groups.value.reduce((total, group) => total + group.rows.length, 0),
|
||||
)
|
||||
|
||||
function stateTone(state: string): 'ok' | 'warn' | 'idle' {
|
||||
if (state === 'leased') return 'ok'
|
||||
if (state === 'reacquire') return 'warn'
|
||||
return 'idle'
|
||||
}
|
||||
const healthLabel = computed(() =>
|
||||
props.clawUp === null ? 'checking' : props.clawUp ? 'connected' : 'unreachable',
|
||||
)
|
||||
|
||||
const healthTone = computed(() =>
|
||||
props.clawUp === null ? 'idle' : props.clawUp ? 'ok' : 'error',
|
||||
)
|
||||
|
||||
// --- new sessions -----------------------------------------------------
|
||||
const creating = ref(false)
|
||||
@@ -164,122 +170,151 @@ watch(
|
||||
|
||||
<template>
|
||||
<aside class="sidebar">
|
||||
<header class="agent">
|
||||
<AgentAvatar
|
||||
:avatar-url="avatarUrl"
|
||||
:initials="identity?.initials ?? identity?.name?.slice(0, 1)"
|
||||
:size="34"
|
||||
/>
|
||||
<div class="agent-text">
|
||||
<strong>{{ identity?.name?.trim() || 'rhema' }}</strong>
|
||||
<span>{{ identity?.tagline?.trim() || 'the spoken word' }}</span>
|
||||
</div>
|
||||
</header>
|
||||
<header class="head">
|
||||
<span class="label">Sessions</span>
|
||||
<div class="sidebar-top">
|
||||
<SidebarBrand @home="$emit('home')" />
|
||||
</div>
|
||||
|
||||
<div class="sidebar-label">
|
||||
<span class="sidebar-label-text">Sessions</span>
|
||||
<span class="count">{{ shownCount }}</span>
|
||||
<button class="ghost" title="new session" :disabled="creating" @click="creating ? closeCreate() : openCreate()">
|
||||
+
|
||||
<button
|
||||
class="icon-btn"
|
||||
title="Refresh sessions"
|
||||
aria-label="Refresh sessions"
|
||||
:disabled="loading"
|
||||
@click="$emit('refresh')"
|
||||
>
|
||||
<RefreshCw :size="14" aria-hidden="true" />
|
||||
</button>
|
||||
<button class="ghost" title="refresh sessions" :disabled="loading" @click="$emit('refresh')">
|
||||
↻
|
||||
<button
|
||||
class="icon-btn"
|
||||
:title="creating ? 'Cancel new session' : 'New session'"
|
||||
:aria-label="creating ? 'Cancel new session' : 'New session'"
|
||||
@click="creating ? closeCreate() : openCreate()"
|
||||
>
|
||||
<Plus :size="16" aria-hidden="true" />
|
||||
</button>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<form v-if="creating" class="new-session" @submit.prevent="submitCreate">
|
||||
<input
|
||||
ref="nameInput"
|
||||
v-model="nameDraft"
|
||||
type="text"
|
||||
class="mono"
|
||||
placeholder="session name"
|
||||
placeholder="Session name"
|
||||
autocomplete="off"
|
||||
maxlength="64"
|
||||
/>
|
||||
>
|
||||
<div class="new-actions">
|
||||
<button type="button" class="ghost" @click="closeCreate">cancel</button>
|
||||
<button type="submit" class="primary" :disabled="!nameValid">create</button>
|
||||
<button type="button" class="btn btn-sm btn-quiet" @click="closeCreate">Cancel</button>
|
||||
<button type="submit" class="btn btn-sm btn-primary" :disabled="!nameValid">Create</button>
|
||||
</div>
|
||||
<p v-if="nameDraft !== '' && !nameValid" class="new-note">
|
||||
letters, digits, dots, dashes, underscores — up to 64.
|
||||
Letters, digits, dots, dashes, underscores, up to 64.
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<p v-if="shownCount === 0" class="empty">
|
||||
{{ loading ? 'loading…' : 'no sessions yet; send the first message' }}
|
||||
{{ loading ? 'Loading sessions.' : 'No sessions yet. Use + to create one.' }}
|
||||
</p>
|
||||
|
||||
<div v-for="group in groups" :key="group.label" class="group">
|
||||
<div class="group-head">
|
||||
<span class="label">{{ group.label }}</span>
|
||||
<span v-if="group.collapsible" class="working" :class="{ live: group.working > 0 }">
|
||||
{{ group.working }} working
|
||||
</span>
|
||||
<button
|
||||
v-if="group.collapsible"
|
||||
class="ghost toggle"
|
||||
:title="othersOpen ? 'fold the other keys away' : 'show every other key'"
|
||||
@click="othersOpen = !othersOpen"
|
||||
>
|
||||
{{ othersOpen ? 'less' : 'more' }}
|
||||
</button>
|
||||
</div>
|
||||
<template v-if="!group.collapsible || othersOpen">
|
||||
<div
|
||||
v-for="row in group.rows"
|
||||
:key="row.key"
|
||||
class="row"
|
||||
:class="{ active: row.key === activeKey }"
|
||||
:title="row.key"
|
||||
>
|
||||
<button class="entry" @click="$emit('select', row.key)">
|
||||
<StatusDot :tone="stateTone(row.session.state)" />
|
||||
<span class="name">{{ row.name }}</span>
|
||||
<span
|
||||
v-if="row.session.paused"
|
||||
class="held"
|
||||
title="dispatch held: nothing runs until resume"
|
||||
>
|
||||
held
|
||||
</span>
|
||||
<span v-if="row.session.inbox_depth > 0" class="depth" title="inbox depth">
|
||||
{{ row.session.inbox_depth }}
|
||||
</span>
|
||||
</button>
|
||||
<nav class="sidebar-sessions" aria-label="Sessions">
|
||||
<div v-for="group in groups" :key="group.label" class="group">
|
||||
<div class="sidebar-label group-head">
|
||||
<span class="sidebar-label-text">{{ group.label }}</span>
|
||||
<span v-if="group.collapsible && group.working > 0" class="working">
|
||||
{{ group.working }} running
|
||||
</span>
|
||||
<button
|
||||
v-if="row.session.paused"
|
||||
class="ghost act"
|
||||
:title="`resume ${row.key}`"
|
||||
@click.stop="$emit('resume', row.key)"
|
||||
v-if="group.collapsible"
|
||||
class="btn btn-sm btn-quiet toggle"
|
||||
:title="othersOpen ? 'Fold the other keys away' : 'Show every other key'"
|
||||
@click="othersOpen = !othersOpen"
|
||||
>
|
||||
run
|
||||
</button>
|
||||
<button
|
||||
v-else
|
||||
class="ghost act"
|
||||
:title="`pause ${row.key}`"
|
||||
@click.stop="$emit('pause', row.key)"
|
||||
>
|
||||
hold
|
||||
</button>
|
||||
<button
|
||||
class="ghost act stop"
|
||||
:disabled="!row.abortable"
|
||||
:title="`abort ${row.key}`"
|
||||
@click.stop="$emit('abort', row.key)"
|
||||
>
|
||||
stop
|
||||
</button>
|
||||
<button
|
||||
class="ghost remove"
|
||||
aria-label="delete session"
|
||||
:title="`delete ${row.key}`"
|
||||
@click.stop="$emit('delete', row.key)"
|
||||
>
|
||||
×
|
||||
{{ othersOpen ? 'Less' : 'More' }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="!group.collapsible || othersOpen">
|
||||
<div
|
||||
v-for="row in group.rows"
|
||||
:key="row.key"
|
||||
class="session"
|
||||
:class="{ active: row.key === activeKey }"
|
||||
:title="row.key"
|
||||
>
|
||||
<button class="session-entry" @click="$emit('select', row.key)">
|
||||
<span class="session-name">{{ row.name }}</span>
|
||||
<span class="session-meta">
|
||||
<span v-if="row.session.paused" class="state warn">held</span>
|
||||
<span v-else-if="row.session.state === 'leased'" class="state ok">running</span>
|
||||
<span v-else-if="row.session.state === 'reacquire'" class="state warn">waiting</span>
|
||||
<span v-if="row.session.inbox_depth > 0" class="state idle">
|
||||
{{ row.session.inbox_depth }} queued
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<div class="session-actions">
|
||||
<button
|
||||
v-if="row.session.paused"
|
||||
class="icon-btn"
|
||||
:title="`Resume ${row.key}`"
|
||||
:aria-label="`Resume ${row.key}`"
|
||||
@click.stop="$emit('resume', row.key)"
|
||||
>
|
||||
<Play :size="14" aria-hidden="true" />
|
||||
</button>
|
||||
<button
|
||||
v-else
|
||||
class="icon-btn"
|
||||
:title="`Hold ${row.key}`"
|
||||
:aria-label="`Hold ${row.key}`"
|
||||
@click.stop="$emit('pause', row.key)"
|
||||
>
|
||||
<Pause :size="14" aria-hidden="true" />
|
||||
</button>
|
||||
<button
|
||||
class="icon-btn"
|
||||
:disabled="!row.abortable"
|
||||
:title="`Abort ${row.key}`"
|
||||
:aria-label="`Abort ${row.key}`"
|
||||
@click.stop="$emit('abort', row.key)"
|
||||
>
|
||||
<Square :size="12" aria-hidden="true" />
|
||||
</button>
|
||||
<button
|
||||
class="icon-btn"
|
||||
:title="`Delete ${row.key}`"
|
||||
:aria-label="`Delete ${row.key}`"
|
||||
@click.stop="$emit('delete', row.key)"
|
||||
>
|
||||
<Trash2 :size="14" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="sidebar-bottom">
|
||||
<button class="sidebar-link" @click="$emit('navigateSettings')">
|
||||
<Settings :size="16" aria-hidden="true" />
|
||||
<span>Settings</span>
|
||||
</button>
|
||||
<div class="sidebar-account">
|
||||
<AgentAvatar
|
||||
:avatar-url="avatarUrl"
|
||||
:initials="identity?.initials ?? identity?.name?.slice(0, 1)"
|
||||
:size="26"
|
||||
/>
|
||||
<div class="account-text">
|
||||
<span class="account-name" :title="identity?.tagline ?? undefined">
|
||||
{{ identity?.name?.trim() || 'rhema' }}
|
||||
</span>
|
||||
<span class="account-state" :class="healthTone">{{ healthLabel }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</template>
|
||||
@@ -288,230 +323,290 @@ watch(
|
||||
.sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
width: 240px;
|
||||
flex: none;
|
||||
padding: 14px 10px;
|
||||
width: var(--sidebar-w);
|
||||
flex: 0 0 var(--sidebar-w);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
height: 100vh;
|
||||
border-right: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.agent {
|
||||
.sidebar-top {
|
||||
padding: var(--sp-4) var(--sp-3) var(--sp-1);
|
||||
}
|
||||
|
||||
.sidebar-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 0 8px 12px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
margin-bottom: 10px;
|
||||
gap: var(--sp-2);
|
||||
padding: var(--sp-3) var(--sp-2) var(--sp-1);
|
||||
color: var(--faint);
|
||||
font-size: var(--fs-small);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.agent-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.sidebar-label-text {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.agent-text strong {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.agent-text span {
|
||||
color: var(--text3);
|
||||
font-size: 11.5px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 0 8px 10px;
|
||||
}
|
||||
|
||||
.count {
|
||||
flex: 1;
|
||||
color: var(--text3);
|
||||
font-size: 12px;
|
||||
color: var(--faint);
|
||||
font-size: var(--fs-small);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.head .ghost {
|
||||
padding: 0 6px;
|
||||
.sidebar-label .icon-btn {
|
||||
width: 24px;
|
||||
min-height: 24px;
|
||||
margin-left: calc(var(--sp-1) * -1);
|
||||
}
|
||||
|
||||
.new-session {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding: 0 8px 10px;
|
||||
gap: var(--sp-2);
|
||||
padding: var(--sp-1) var(--sp-2) var(--sp-2);
|
||||
}
|
||||
|
||||
.new-session input {
|
||||
width: 100%;
|
||||
font-size: 12.5px;
|
||||
min-height: 32px;
|
||||
padding: var(--sp-1) var(--sp-2);
|
||||
font-size: var(--fs-meta);
|
||||
}
|
||||
|
||||
.new-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.new-actions button {
|
||||
padding: 3px 10px;
|
||||
font-size: 12px;
|
||||
gap: var(--sp-1);
|
||||
}
|
||||
|
||||
.new-note {
|
||||
margin: 0;
|
||||
color: var(--text3);
|
||||
font-size: 11.5px;
|
||||
color: var(--faint);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin: 4px 8px;
|
||||
color: var(--text3);
|
||||
margin: 0;
|
||||
padding: var(--sp-3) var(--sp-2);
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-meta);
|
||||
}
|
||||
|
||||
.sidebar-sessions {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
padding: 0 var(--sp-2);
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
.group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
margin-bottom: 14px;
|
||||
gap: 1px;
|
||||
margin-bottom: var(--sp-4);
|
||||
}
|
||||
|
||||
.group-head {
|
||||
padding: var(--sp-2) var(--sp-2) var(--sp-1);
|
||||
}
|
||||
|
||||
.working {
|
||||
color: var(--accent);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.toggle {
|
||||
height: 22px;
|
||||
padding: 0 var(--sp-1);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.session {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 0 8px 4px;
|
||||
}
|
||||
|
||||
.group-head .working {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
text-align: right;
|
||||
font-family: var(--mono);
|
||||
font-size: 11px;
|
||||
color: var(--text3);
|
||||
}
|
||||
|
||||
.group-head .working.live {
|
||||
color: var(--ok);
|
||||
}
|
||||
|
||||
.group-head .toggle {
|
||||
flex: none;
|
||||
padding: 0 6px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
/* The row owns the hover and active surface: the select button fills it
|
||||
and the delete button sits beside it, so neither has to nest in the
|
||||
other. */
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
border-radius: 7px;
|
||||
padding-right: 4px;
|
||||
color: var(--text2);
|
||||
}
|
||||
|
||||
.row:hover {
|
||||
background: var(--elevated);
|
||||
gap: 0;
|
||||
border-radius: var(--r-control);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.row.active {
|
||||
background: color-mix(in srgb, var(--accent) 17%, transparent);
|
||||
color: var(--accent-text);
|
||||
.session:hover,
|
||||
.session:focus-within {
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.session.active {
|
||||
background: var(--accent-soft);
|
||||
}
|
||||
|
||||
.session-entry {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
justify-content: center;
|
||||
gap: 1px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
padding: var(--sp-1) var(--sp-2);
|
||||
border: 0;
|
||||
border-radius: var(--r-control);
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.session-entry:hover:not(:disabled) {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.session-name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: var(--fs-meta);
|
||||
line-height: var(--lh-body);
|
||||
}
|
||||
|
||||
.session.active .session-name {
|
||||
color: var(--accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.entry {
|
||||
.session-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
text-align: left;
|
||||
background: none;
|
||||
border: none;
|
||||
border-radius: 7px;
|
||||
padding: 7px 10px;
|
||||
color: inherit;
|
||||
font-weight: inherit;
|
||||
gap: var(--sp-2);
|
||||
min-height: 14px;
|
||||
color: var(--faint);
|
||||
font-size: var(--fs-small);
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.row .act {
|
||||
.state {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.state.ok {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.state.warn {
|
||||
color: var(--warn);
|
||||
}
|
||||
|
||||
.state.idle {
|
||||
color: var(--faint);
|
||||
}
|
||||
|
||||
.session-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1px;
|
||||
flex: none;
|
||||
padding: 0 4px;
|
||||
font-size: 11px;
|
||||
font-family: var(--mono);
|
||||
padding-right: var(--sp-1);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.row .act.stop {
|
||||
color: var(--error);
|
||||
}
|
||||
|
||||
.row .act:disabled {
|
||||
color: var(--text3);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.entry:disabled {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.row .remove {
|
||||
flex: none;
|
||||
padding: 0 5px;
|
||||
font-size: 13px;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.row:hover .act,
|
||||
.row:hover .remove,
|
||||
.row:focus-within .act,
|
||||
.row:focus-within .remove,
|
||||
.row.active .act,
|
||||
.row.active .remove {
|
||||
.session:hover .session-actions,
|
||||
.session:focus-within .session-actions {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.held {
|
||||
flex: none;
|
||||
font-size: 10px;
|
||||
font-family: var(--mono);
|
||||
color: var(--warn);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 999px;
|
||||
padding: 0 5px;
|
||||
.session-actions .icon-btn {
|
||||
width: 22px;
|
||||
min-height: 22px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.name {
|
||||
flex: 1;
|
||||
.session-actions .icon-btn:hover:not(:disabled) {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.sidebar-bottom {
|
||||
padding: var(--sp-2);
|
||||
border-top: 1px solid var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--sp-1);
|
||||
}
|
||||
|
||||
.sidebar-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: var(--sp-2);
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
padding: var(--sp-2);
|
||||
border: 0;
|
||||
border-radius: var(--r-control);
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-meta);
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.sidebar-link:hover:not(:disabled) {
|
||||
background: var(--surface-2);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.sidebar-account {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--sp-2);
|
||||
min-width: 0;
|
||||
padding: var(--sp-2);
|
||||
}
|
||||
|
||||
.account-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.account-name {
|
||||
overflow: hidden;
|
||||
color: var(--text);
|
||||
font-size: var(--fs-meta);
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.depth {
|
||||
flex: none;
|
||||
min-width: 18px;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-family: var(--mono);
|
||||
color: var(--info);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 999px;
|
||||
padding: 0 5px;
|
||||
.account-state {
|
||||
color: var(--faint);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.account-state.ok {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.account-state.error {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
@media (max-width: 860px) {
|
||||
.sidebar {
|
||||
position: static;
|
||||
width: 100%;
|
||||
flex: none;
|
||||
height: auto;
|
||||
max-height: 42vh;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -26,8 +26,8 @@ defineProps<{
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
padding: 13px 16px;
|
||||
gap: var(--sp-6);
|
||||
padding: var(--sp-3) var(--sp-4);
|
||||
}
|
||||
|
||||
.row.top {
|
||||
@@ -39,31 +39,32 @@ defineProps<{
|
||||
}
|
||||
|
||||
.text {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.name {
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
font-size: var(--fs-ui);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.description {
|
||||
color: var(--text3);
|
||||
font-size: 12.5px;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-meta);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.control {
|
||||
flex: none;
|
||||
max-width: 55%;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex: none;
|
||||
gap: var(--sp-2);
|
||||
max-width: 55%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.control :deep(select),
|
||||
@@ -76,7 +77,7 @@ defineProps<{
|
||||
.row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 8px;
|
||||
gap: var(--sp-2);
|
||||
}
|
||||
|
||||
.control,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
// The settings nav: searchable sections of pages, the design's left
|
||||
// column. The search is a client-side filter over these entries — it
|
||||
// hides nothing the claw cannot serve.
|
||||
// The settings nav: searchable sections of pages, in the same sidebar
|
||||
// slot as the session list. The search is a client-side filter over
|
||||
// these entries; it hides nothing the claw cannot serve.
|
||||
import { MessageSquare, Search } from 'lucide-vue-next'
|
||||
|
||||
export interface SettingsEntry {
|
||||
id: string
|
||||
label: string
|
||||
@@ -19,7 +21,7 @@ const props = defineProps<{
|
||||
clawUp: boolean | null
|
||||
}>()
|
||||
|
||||
defineEmits<{ select: [id: string] }>()
|
||||
defineEmits<{ home: []; select: [id: string]; navigateChat: [] }>()
|
||||
|
||||
const query = ref('')
|
||||
|
||||
@@ -35,125 +37,207 @@ const filtered = computed<SettingsSection[]>(() => {
|
||||
}))
|
||||
.filter((section) => section.entries.length > 0)
|
||||
})
|
||||
|
||||
const healthLabel = computed(() =>
|
||||
props.clawUp === null ? 'Checking the claw' : props.clawUp ? 'Claw connected' : 'Claw unreachable',
|
||||
)
|
||||
|
||||
const healthTone = computed(() =>
|
||||
props.clawUp === null ? 'idle' : props.clawUp ? 'ok' : 'error',
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<aside class="nav">
|
||||
<aside class="sidebar">
|
||||
<div class="sidebar-top">
|
||||
<SidebarBrand @home="$emit('home')" />
|
||||
</div>
|
||||
|
||||
<div class="search">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true">
|
||||
<circle cx="11" cy="11" r="6.5" />
|
||||
<path d="m20 20-3.8-3.8" />
|
||||
</svg>
|
||||
<input v-model="query" type="text" placeholder="Search settings" />
|
||||
<Search :size="14" class="search-icon" aria-hidden="true" />
|
||||
<input v-model="query" type="search" placeholder="Search settings" aria-label="Search settings">
|
||||
</div>
|
||||
|
||||
<p v-if="filtered.length === 0" class="empty">no settings match</p>
|
||||
<p v-if="filtered.length === 0" class="empty">No settings match.</p>
|
||||
|
||||
<div v-for="section in filtered" :key="section.label" class="section">
|
||||
<span class="label">{{ section.label }}</span>
|
||||
<button
|
||||
v-for="entry in section.entries"
|
||||
:key="entry.id"
|
||||
class="entry"
|
||||
:class="{ active: entry.id === active }"
|
||||
@click="$emit('select', entry.id)"
|
||||
>
|
||||
{{ entry.label }}
|
||||
<nav class="sections" aria-label="Settings">
|
||||
<div v-for="section in filtered" :key="section.label" class="section">
|
||||
<span class="sidebar-label">{{ section.label }}</span>
|
||||
<button
|
||||
v-for="entry in section.entries"
|
||||
:key="entry.id"
|
||||
class="entry"
|
||||
:class="{ active: entry.id === active }"
|
||||
@click="$emit('select', entry.id)"
|
||||
>
|
||||
{{ entry.label }}
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="sidebar-bottom">
|
||||
<button class="sidebar-link" @click="$emit('navigateChat')">
|
||||
<MessageSquare :size="16" aria-hidden="true" />
|
||||
<span>Chat</span>
|
||||
</button>
|
||||
<p class="health" :class="healthTone">{{ healthLabel }}</p>
|
||||
</div>
|
||||
|
||||
<div class="spacer" />
|
||||
|
||||
<footer class="foot">
|
||||
<StatusDot :tone="clawUp === null ? 'idle' : clawUp ? 'ok' : 'error'" />
|
||||
<span>{{ clawUp === null ? 'checking claw' : clawUp ? 'claw connected' : 'claw unreachable' }}</span>
|
||||
</footer>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.nav {
|
||||
.sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
width: 232px;
|
||||
flex: none;
|
||||
min-height: 0;
|
||||
padding: 14px 10px 10px;
|
||||
width: var(--sidebar-w);
|
||||
flex: 0 0 var(--sidebar-w);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
height: 100vh;
|
||||
border-right: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.sidebar-top {
|
||||
padding: var(--sp-4) var(--sp-3) var(--sp-2);
|
||||
}
|
||||
|
||||
.search {
|
||||
position: relative;
|
||||
margin-bottom: 12px;
|
||||
padding: 0 var(--sp-3) var(--sp-2);
|
||||
}
|
||||
|
||||
.search svg {
|
||||
.search-icon {
|
||||
position: absolute;
|
||||
left: 9px;
|
||||
left: calc(var(--sp-3) + var(--sp-2));
|
||||
top: 50%;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
transform: translateY(-50%);
|
||||
color: var(--text3);
|
||||
transform: translateY(-60%);
|
||||
color: var(--faint);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.search input {
|
||||
width: 100%;
|
||||
padding: 6px 10px 6px 28px;
|
||||
font-size: 13px;
|
||||
min-height: 32px;
|
||||
padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-8);
|
||||
background: var(--surface);
|
||||
font-size: var(--fs-meta);
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin: 4px 6px;
|
||||
color: var(--text3);
|
||||
.sections {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
padding: 0 var(--sp-2) var(--sp-4);
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
margin-bottom: 14px;
|
||||
gap: 1px;
|
||||
margin-bottom: var(--sp-4);
|
||||
}
|
||||
|
||||
.section .label {
|
||||
padding: 0 10px 4px;
|
||||
.sidebar-label {
|
||||
display: block;
|
||||
padding: 0 var(--sp-2) var(--sp-1);
|
||||
color: var(--faint);
|
||||
font-size: var(--fs-small);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.entry {
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
padding: var(--sp-2);
|
||||
border: 0;
|
||||
border-radius: var(--r-control);
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
font-size: var(--fs-meta);
|
||||
font-weight: 400;
|
||||
line-height: var(--lh-body);
|
||||
text-align: left;
|
||||
background: none;
|
||||
border: none;
|
||||
border-radius: 7px;
|
||||
padding: 6px 10px;
|
||||
color: var(--text2);
|
||||
}
|
||||
|
||||
.entry:hover:not(:disabled) {
|
||||
background: var(--elevated);
|
||||
color: var(--text);
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.entry.active {
|
||||
background: color-mix(in srgb, var(--accent) 17%, transparent);
|
||||
color: var(--accent-text);
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
flex: 1;
|
||||
.empty {
|
||||
margin: 0;
|
||||
padding: var(--sp-3) var(--sp-2);
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-meta);
|
||||
}
|
||||
|
||||
.foot {
|
||||
.sidebar-bottom {
|
||||
padding: var(--sp-2);
|
||||
border-top: 1px solid var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--sp-1);
|
||||
}
|
||||
|
||||
.sidebar-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px;
|
||||
border-top: 1px solid var(--border);
|
||||
color: var(--text3);
|
||||
font-size: 12px;
|
||||
justify-content: flex-start;
|
||||
gap: var(--sp-2);
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
padding: var(--sp-2);
|
||||
border: 0;
|
||||
border-radius: var(--r-control);
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-meta);
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.sidebar-link:hover:not(:disabled) {
|
||||
background: var(--surface-2);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.health {
|
||||
padding: 0 var(--sp-2) var(--sp-1);
|
||||
color: var(--faint);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.health.ok {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.health.error {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
@media (max-width: 860px) {
|
||||
.sidebar {
|
||||
position: static;
|
||||
width: 100%;
|
||||
flex: none;
|
||||
height: auto;
|
||||
max-height: none;
|
||||
min-height: 0;
|
||||
overflow: visible;
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.sections {
|
||||
min-height: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
// The product mark at the top of every sidebar, the same slot Rhema
|
||||
// Together uses. It returns to the chat view from anywhere.
|
||||
defineEmits<{ home: [] }>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button class="sidebar-brand" title="Rhema Claw" aria-label="Rhema Claw" @click="$emit('home')">
|
||||
<img src="/rhema-logo.png" class="sidebar-brand-mark" alt="">
|
||||
<span>Rhema Claw</span>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.sidebar-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: var(--sp-2);
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
padding: 0 var(--sp-2);
|
||||
border: 0;
|
||||
background: none;
|
||||
color: var(--text);
|
||||
font-size: var(--fs-ui);
|
||||
font-weight: 600;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.sidebar-brand:hover:not(:disabled) {
|
||||
background: none;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.sidebar-brand-mark {
|
||||
display: block;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
flex: none;
|
||||
object-fit: contain;
|
||||
}
|
||||
</style>
|
||||
@@ -1,34 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
// One small round state dot with an honest tone: ok, warn, error, or
|
||||
// idle gray. The only place status color lives at a glance.
|
||||
defineProps<{
|
||||
tone: 'ok' | 'warn' | 'error' | 'idle'
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span class="dot" :class="tone" aria-hidden="true" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.dot {
|
||||
display: inline-block;
|
||||
flex: none;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--text3);
|
||||
}
|
||||
|
||||
.dot.ok {
|
||||
background: var(--ok);
|
||||
}
|
||||
|
||||
.dot.warn {
|
||||
background: var(--warn);
|
||||
}
|
||||
|
||||
.dot.error {
|
||||
background: var(--error);
|
||||
}
|
||||
</style>
|
||||
@@ -4,6 +4,7 @@
|
||||
// stream. Every card downloads, images included: a picture the browser
|
||||
// cannot paint, an SVG, or bytes that failed to fetch must still come
|
||||
// out of the store.
|
||||
import { Download, FileCode, FileText, Image } from 'lucide-vue-next'
|
||||
import type { AttachmentCard } from '~/composables/useTranscript'
|
||||
|
||||
defineProps<{ attachment: AttachmentCard }>()
|
||||
@@ -12,13 +13,13 @@ const emit = defineEmits<{
|
||||
download: [id: string, name: string]
|
||||
}>()
|
||||
|
||||
const MEDIA_GLYPHS: Record<AttachmentCard['media'], string> = {
|
||||
image: '▣',
|
||||
code: '⌗',
|
||||
file: '▤',
|
||||
}
|
||||
const MEDIA_ICONS = {
|
||||
image: Image,
|
||||
code: FileCode,
|
||||
file: FileText,
|
||||
} as const
|
||||
|
||||
/** B / KB / MB, one decimal past 1 KB — a card label, not precision. */
|
||||
/** B / KB / MB, one decimal past 1 KB, a card label, not precision. */
|
||||
function formatBytes(size: number): string {
|
||||
if (size < 1024) return `${size} B`
|
||||
if (size < 1024 * 1024) return `${(size / 1024).toFixed(1)} KB`
|
||||
@@ -27,85 +28,90 @@ function formatBytes(size: number): string {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="attachment-card">
|
||||
<div class="attachment">
|
||||
<div class="attachment-head">
|
||||
<span
|
||||
class="attachment-glyph"
|
||||
<component
|
||||
:is="MEDIA_ICONS[attachment.media]"
|
||||
:size="16"
|
||||
class="attachment-icon"
|
||||
aria-hidden="true"
|
||||
:title="`${attachment.media} attachment`"
|
||||
>{{ MEDIA_GLYPHS[attachment.media] }}</span>
|
||||
<span class="attachment-name mono">{{ attachment.name }}</span>
|
||||
<span class="attachment-size mono">{{ formatBytes(attachment.size) }}</span>
|
||||
/>
|
||||
<span class="attachment-name">{{ attachment.name }}</span>
|
||||
<span class="attachment-size">{{ formatBytes(attachment.size) }}</span>
|
||||
<button
|
||||
class="ghost"
|
||||
:title="`download ${attachment.name}`"
|
||||
class="btn btn-sm btn-quiet"
|
||||
:title="`Download ${attachment.name}`"
|
||||
:aria-label="`Download ${attachment.name}`"
|
||||
@click="emit('download', attachment.id, attachment.name)"
|
||||
>
|
||||
↓ download
|
||||
<Download :size="14" aria-hidden="true" />
|
||||
Download
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<img
|
||||
v-if="attachment.media === 'image' && attachment.url"
|
||||
:src="attachment.url"
|
||||
:alt="attachment.caption ?? attachment.name"
|
||||
class="attachment-image"
|
||||
/>
|
||||
<p v-if="attachment.caption" class="attachment-caption">
|
||||
{{ attachment.caption }}
|
||||
</p>
|
||||
>
|
||||
<p v-if="attachment.caption" class="attachment-caption">{{ attachment.caption }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.attachment-card {
|
||||
.attachment {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
gap: var(--sp-2);
|
||||
max-width: 480px;
|
||||
padding: 10px 12px;
|
||||
background: var(--surface);
|
||||
padding: var(--sp-2) var(--sp-3);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--r-control);
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.attachment-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: var(--sp-2);
|
||||
}
|
||||
|
||||
.attachment-glyph {
|
||||
.attachment-icon {
|
||||
flex: none;
|
||||
color: var(--text3);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.attachment-name {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
color: var(--text);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-small);
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.attachment-size {
|
||||
flex: none;
|
||||
color: var(--text3);
|
||||
font-size: 11px;
|
||||
color: var(--faint);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.attachment-image {
|
||||
align-self: flex-start;
|
||||
max-width: 100%;
|
||||
max-height: 240px;
|
||||
align-self: flex-start;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
border-radius: var(--r-control);
|
||||
}
|
||||
|
||||
.attachment-caption {
|
||||
margin: 0;
|
||||
color: var(--text3);
|
||||
font-size: 12.5px;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-small);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
// The agent asking its human something: a secret to store, permission
|
||||
// to act. Answering is intent only — the shell POSTs, and the card
|
||||
// to act. Answering is intent only, the shell POSTs, and the card
|
||||
// flips on the local echo or the stream's consent_resolved.
|
||||
import { ref } from 'vue'
|
||||
import { Check, X } from 'lucide-vue-next'
|
||||
import type { ConsentCard } from '~/composables/useTranscript'
|
||||
import type { ConsentAnswer } from '~/composables/useClaw'
|
||||
|
||||
@@ -20,6 +21,10 @@ function tone(consent: ConsentCard): 'pending' | 'ok' | 'denied' {
|
||||
return consent.granted ? 'ok' : 'denied'
|
||||
}
|
||||
|
||||
const kindLabel = computed(() =>
|
||||
props.consent.kind === 'secret' ? 'Secret' : 'Phone control',
|
||||
)
|
||||
|
||||
function answerSecret(): void {
|
||||
const secret = draft.value.trim()
|
||||
if (secret === '') return
|
||||
@@ -29,99 +34,105 @@ function answerSecret(): void {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="consent-card" :class="tone(consent)">
|
||||
<div class="consent" :class="tone(consent)">
|
||||
<div class="consent-head">
|
||||
<span class="badge">{{ consent.kind }}</span>
|
||||
<strong class="consent-summary">{{ consent.summary }}</strong>
|
||||
<span v-if="consent.granted !== null" class="consent-state mono">
|
||||
{{ consent.granted ? 'granted' : 'denied' }}
|
||||
<span class="consent-kind">{{ kindLabel }}</span>
|
||||
<span class="consent-summary">{{ consent.summary }}</span>
|
||||
<span v-if="consent.granted !== null" class="consent-state">
|
||||
{{ consent.granted ? 'Granted' : 'Denied' }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<p v-if="consent.detail" class="consent-detail">{{ consent.detail }}</p>
|
||||
|
||||
<div v-if="consent.granted === null" class="consent-actions">
|
||||
<template v-if="consent.kind === 'secret'">
|
||||
<input
|
||||
v-model="draft"
|
||||
type="password"
|
||||
placeholder="the secret, never shown again"
|
||||
class="consent-input"
|
||||
placeholder="The secret, never shown again"
|
||||
autocomplete="off"
|
||||
@keydown.enter="answerSecret"
|
||||
/>
|
||||
<button
|
||||
class="primary"
|
||||
:disabled="draft.trim() === ''"
|
||||
@click="answerSecret"
|
||||
>
|
||||
submit
|
||||
<button class="btn btn-sm btn-primary" :disabled="draft.trim() === ''" @click="answerSecret">
|
||||
Submit
|
||||
</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<button class="primary" @click="emit('answer', consent.id, { grant: true })">
|
||||
<button class="btn btn-sm btn-primary" @click="emit('answer', consent.id, { grant: true })">
|
||||
<Check :size="14" aria-hidden="true" />
|
||||
Approve
|
||||
</button>
|
||||
<button @click="emit('answer', consent.id, { grant: false })">
|
||||
<button class="btn btn-sm" @click="emit('answer', consent.id, { grant: false })">
|
||||
<X :size="14" aria-hidden="true" />
|
||||
Deny
|
||||
</button>
|
||||
</template>
|
||||
<button class="ghost" title="cancel without answering" @click="emit('deny', consent.id)">
|
||||
deny
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.consent-card {
|
||||
.consent {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 10px 12px;
|
||||
background: var(--surface);
|
||||
gap: var(--sp-2);
|
||||
padding: var(--sp-3);
|
||||
border: 1px solid var(--border);
|
||||
border-left: 3px solid var(--warn);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--r-control);
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.consent-card.ok {
|
||||
.consent.ok {
|
||||
border-left-color: var(--ok);
|
||||
}
|
||||
|
||||
.consent-card.denied {
|
||||
border-left-color: var(--error);
|
||||
.consent.denied {
|
||||
border-left-color: var(--danger);
|
||||
}
|
||||
|
||||
.consent-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
align-items: baseline;
|
||||
gap: var(--sp-2);
|
||||
}
|
||||
|
||||
.consent-kind {
|
||||
flex: none;
|
||||
color: var(--faint);
|
||||
font-size: var(--fs-small);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.consent-summary {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-ui);
|
||||
font-weight: 600;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.denied .consent-summary {
|
||||
color: var(--text3);
|
||||
color: var(--muted);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.consent-state {
|
||||
flex: none;
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ok);
|
||||
color: var(--accent);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.denied .consent-state {
|
||||
color: var(--error);
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.consent-detail {
|
||||
margin: 0;
|
||||
color: var(--text2);
|
||||
font-size: 12.5px;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-meta);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
@@ -129,11 +140,14 @@ function answerSecret(): void {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
gap: var(--sp-2);
|
||||
}
|
||||
|
||||
.consent-actions input {
|
||||
.consent-input {
|
||||
flex: 1;
|
||||
min-width: 160px;
|
||||
min-width: 180px;
|
||||
min-height: 32px;
|
||||
padding: var(--sp-1) var(--sp-2);
|
||||
font-size: var(--fs-meta);
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
// The About page: what this client and the daemon behind it are, and
|
||||
// which public routes the client speaks. Static facts — the claw's own
|
||||
// which public routes the client speaks. Static facts, the claw's own
|
||||
// version is not on the wire, so none is claimed.
|
||||
defineProps<{
|
||||
/** null while /healthz has not answered yet. */
|
||||
@@ -65,9 +65,9 @@ const routes = [
|
||||
<span class="mono">rhema-claw-web 0.1.0</span>
|
||||
</SettingRow>
|
||||
<SettingRow title="Claw status" description="What /healthz last answered.">
|
||||
<AppBadge :variant="clawUp === null ? undefined : clawUp ? 'ok' : 'error'">
|
||||
<span class="status" :class="clawUp === null ? 'idle' : clawUp ? 'ok' : 'error'">
|
||||
{{ clawUp === null ? 'checking' : clawUp ? 'up' : 'down' }}
|
||||
</AppBadge>
|
||||
</span>
|
||||
</SettingRow>
|
||||
</SettingCard>
|
||||
|
||||
@@ -83,6 +83,19 @@ const routes = [
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.status {
|
||||
color: var(--faint);
|
||||
font-size: var(--fs-meta);
|
||||
}
|
||||
|
||||
.status.ok {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.status.error {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -94,18 +107,20 @@ const routes = [
|
||||
.scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 24px 24px;
|
||||
padding: 0 var(--sp-8) var(--sp-10);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
gap: var(--sp-4);
|
||||
width: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.identity {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 4px 2px;
|
||||
gap: var(--sp-4);
|
||||
padding: var(--sp-1);
|
||||
}
|
||||
|
||||
.avatar {
|
||||
@@ -113,41 +128,41 @@ const routes = [
|
||||
place-items: center;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: 14px;
|
||||
border-radius: var(--r-card);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-size: 26px;
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.identity h2 {
|
||||
margin: 0;
|
||||
font-size: 22px;
|
||||
font-size: var(--fs-title);
|
||||
}
|
||||
|
||||
.identity p {
|
||||
margin: 2px 0 0;
|
||||
color: var(--text3);
|
||||
margin: var(--sp-1) 0 0;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.route {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 12px;
|
||||
padding: 9px 16px;
|
||||
gap: var(--sp-3);
|
||||
padding: var(--sp-2) var(--sp-4);
|
||||
}
|
||||
|
||||
.method {
|
||||
flex: none;
|
||||
width: 44px;
|
||||
color: var(--accent-text);
|
||||
font-size: 12px;
|
||||
color: var(--accent);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.path {
|
||||
color: var(--text);
|
||||
font-size: 12.5px;
|
||||
font-size: var(--fs-meta);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@@ -156,8 +171,8 @@ const routes = [
|
||||
.note {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
color: var(--text3);
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-small);
|
||||
min-width: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -96,7 +96,7 @@ function meta(account: ClawAccount): string {
|
||||
</PageHeader>
|
||||
<div class="scroll">
|
||||
<SettingCard v-if="adding" title="New account" meta="the secret is stored, never shown again">
|
||||
<SettingRow title="Label" description="A name for the roster, e.g. “acme releases”.">
|
||||
<SettingRow title="Label" description="A name for the roster, e.g. 'acme releases'.">
|
||||
<input
|
||||
v-model="draft.label"
|
||||
type="text"
|
||||
@@ -108,7 +108,7 @@ function meta(account: ClawAccount): string {
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
title="Service"
|
||||
description="Lowercase: github, gitlab, or gitea — or any name for a service the agent only stores."
|
||||
description="Lowercase: github, gitlab, or gitea, or any name for a service the agent only stores."
|
||||
>
|
||||
<input
|
||||
v-model="draft.service"
|
||||
@@ -136,7 +136,7 @@ function meta(account: ClawAccount): string {
|
||||
:disabled="mutating"
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow title="Secret" description="An API token — or a password, which the agent stores but can never use.">
|
||||
<SettingRow title="Secret" description="An API token, or a password, which the agent stores but can never use.">
|
||||
<input
|
||||
v-model="draft.secret"
|
||||
type="password"
|
||||
@@ -172,10 +172,10 @@ function meta(account: ClawAccount): string {
|
||||
<p v-if="loading" class="dim">loading…</p>
|
||||
<p v-else-if="!accounts?.length" class="dim">
|
||||
No agent accounts yet. An account is a login the agent holds on
|
||||
an external service — a GitHub identity it answers issues as,
|
||||
an email it sends from — distinct from the model providers
|
||||
an external service: a GitHub identity it answers issues as,
|
||||
an email it sends from. Accounts are distinct from the model providers
|
||||
(what it thinks with) and the forge watches (what it looks at).
|
||||
For a forge identity, “follow notifications” turns the account
|
||||
For a forge identity, "follow notifications" turns the account
|
||||
into watches automatically: review requests, assignments, and
|
||||
feedback become agent work, mentions surface to you.
|
||||
</p>
|
||||
@@ -194,7 +194,7 @@ function meta(account: ClawAccount): string {
|
||||
>
|
||||
{{
|
||||
confirming === account.id
|
||||
? 'Forget — also drops its watches?'
|
||||
? 'Forget, also dropping its watches?'
|
||||
: 'Forget…'
|
||||
}}
|
||||
</button>
|
||||
@@ -217,11 +217,13 @@ function meta(account: ClawAccount): string {
|
||||
.scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 24px 24px;
|
||||
padding: 0 var(--sp-8) var(--sp-10);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
gap: var(--sp-4);
|
||||
width: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.actions {
|
||||
|
||||
@@ -113,7 +113,7 @@ const CAPS: Record<keyof IdentityTexts, number> = {
|
||||
<div class="page">
|
||||
<PageHeader
|
||||
title="General"
|
||||
subtitle="The agent's identity — how every surface names and shows it"
|
||||
subtitle="How every surface names and shows the agent"
|
||||
>
|
||||
<template #actions>
|
||||
<button :disabled="!dirty || saving" @click="discard">Discard</button>
|
||||
@@ -139,8 +139,8 @@ const CAPS: Record<keyof IdentityTexts, number> = {
|
||||
</div>
|
||||
|
||||
<AppCallout variant="info" title="This is the agent's identity, not the engine's">
|
||||
Everything in the interface uses the name, mark, and images here —
|
||||
the rail, the chat, the window title, the notifications. The
|
||||
Everything in the interface uses the name, mark, and images here:
|
||||
the sidebar, the chat, the window title, the notifications. The
|
||||
engine's own name appears only where it is a component.
|
||||
</AppCallout>
|
||||
|
||||
@@ -173,7 +173,7 @@ const CAPS: Record<keyof IdentityTexts, number> = {
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
title="Mark"
|
||||
description="The glyph or emoji in the rail and the empty states. Defaults to ῥ."
|
||||
description="The glyph or emoji in the sidebar and the empty states. Defaults to ῥ."
|
||||
>
|
||||
<input
|
||||
v-model="draft.mark"
|
||||
@@ -225,11 +225,11 @@ const CAPS: Record<keyof IdentityTexts, number> = {
|
||||
<SettingCard
|
||||
v-if="identity"
|
||||
title="Avatar & logo"
|
||||
meta="png, jpeg, or webp, up to 2 MiB — uploads apply immediately"
|
||||
meta="png, jpeg, or webp, up to 2 MiB. Uploads apply immediately."
|
||||
>
|
||||
<SettingRow
|
||||
title="Avatar"
|
||||
description="The square face in the chat and the rail."
|
||||
description="The square face in the chat and the sidebar."
|
||||
>
|
||||
<div class="image-control">
|
||||
<AgentAvatar :avatar-url="avatarUrl" :mark="identity.mark" :initials="identity.initials ?? identity.name?.slice(0, 1)" :size="40" variant="initials" />
|
||||
@@ -280,11 +280,13 @@ const CAPS: Record<keyof IdentityTexts, number> = {
|
||||
.scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 24px 24px;
|
||||
padding: 0 var(--sp-8) var(--sp-10);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
gap: var(--sp-4);
|
||||
width: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.identity {
|
||||
|
||||
@@ -69,7 +69,7 @@ function size(file: BootstrapFile): number {
|
||||
<template v-else>
|
||||
<AppCallout variant="info" title="These files enter every request">
|
||||
SOUL.md is who the agent is; USER.md is who you are. Keep both
|
||||
small — they are read on every turn. ENVIRONMENT.md is written
|
||||
small. They are read on every turn. ENVIRONMENT.md is written
|
||||
from the machine at boot.
|
||||
</AppCallout>
|
||||
|
||||
@@ -142,11 +142,13 @@ function size(file: BootstrapFile): number {
|
||||
.scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 24px 24px;
|
||||
padding: 0 var(--sp-8) var(--sp-10);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 900px;
|
||||
gap: var(--sp-4);
|
||||
width: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.muted {
|
||||
|
||||
@@ -98,11 +98,13 @@ const TRANSPORTS: Record<string, string> = {
|
||||
.scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 24px 24px;
|
||||
padding: 0 var(--sp-8) var(--sp-10);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
gap: var(--sp-4);
|
||||
width: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.muted {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
// model listing comes from the provider itself; a backend without one
|
||||
// still switches — its default model applies.
|
||||
// Presentational: data flows in as props, intent flows up as events.
|
||||
import { X } from 'lucide-vue-next'
|
||||
import type { ModelCard, ProviderCredentials, ProvidersState } from '~/composables/useClaw'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -231,8 +232,8 @@ watch(
|
||||
* bare "no vision" when it knows it does not, nothing when the key is
|
||||
* absent — unknown is no verdict at all, never a `false`. */
|
||||
function visionLabel(model: ModelCard): string {
|
||||
if (model.supports_vision === true) return ' ◉ vision'
|
||||
if (model.supports_vision === false) return ' no vision'
|
||||
if (model.supports_vision === true) return ' (vision)'
|
||||
if (model.supports_vision === false) return ' (no vision)'
|
||||
return ''
|
||||
}
|
||||
</script>
|
||||
@@ -314,12 +315,13 @@ function visionLabel(model: ModelCard): string {
|
||||
<AppBadge v-if="p.id === state.active.provider" variant="accent">active</AppBadge>
|
||||
<AppBadge v-else-if="p.id === draftProvider && dirty">staged</AppBadge>
|
||||
<button
|
||||
class="ghost remove"
|
||||
:title="`remove ${p.id}`"
|
||||
class="icon-btn remove"
|
||||
:title="`Remove ${p.id}`"
|
||||
:aria-label="`Remove ${p.id}`"
|
||||
:disabled="mutating || state.providers.length <= 1"
|
||||
@click.stop="emit('remove', p.id)"
|
||||
>
|
||||
×
|
||||
<X :size="14" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</SettingCard>
|
||||
@@ -406,11 +408,13 @@ function visionLabel(model: ModelCard): string {
|
||||
.scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 24px 24px;
|
||||
padding: 0 var(--sp-8) var(--sp-10);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
gap: var(--sp-4);
|
||||
width: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.muted {
|
||||
@@ -452,8 +456,8 @@ function visionLabel(model: ModelCard): string {
|
||||
|
||||
.backend .remove {
|
||||
flex: none;
|
||||
padding: 0 6px;
|
||||
font-size: 14px;
|
||||
width: 24px;
|
||||
min-height: 24px;
|
||||
}
|
||||
|
||||
.add-form {
|
||||
|
||||
@@ -305,11 +305,13 @@ const workspacePath = computed(() => {
|
||||
.scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 24px 24px;
|
||||
padding: 0 var(--sp-8) var(--sp-10);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
gap: var(--sp-4);
|
||||
width: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.muted {
|
||||
|
||||
@@ -101,11 +101,13 @@ const TIERS: Record<ClawSkill['tier'], string> = {
|
||||
.scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 24px 24px;
|
||||
padding: 0 var(--sp-8) var(--sp-10);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
gap: var(--sp-4);
|
||||
width: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.muted {
|
||||
|
||||
Reference in new issue
Block a user