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
+74
-60
@@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
// The one page: the icon rail, then either the chat view (session
|
||||
// inventory + live transcript) or the settings view (nav + pages). A
|
||||
// tiny hash router keeps views deep-linkable without vue-router. All
|
||||
// state is in-memory; only the token and the active session persist.
|
||||
// The one page: a sidebar, then either the chat view (session list and
|
||||
// live transcript) or the settings view (nav and pages). A tiny hash
|
||||
// router keeps views deep-linkable without vue-router. All state is
|
||||
// in-memory; only the token and the active session persist.
|
||||
// The claw owns the conversation and the config, so this page is a
|
||||
// mirror, not a store.
|
||||
import { ClawError, clawHealth, isInteractive, isResidentKey, useClaw } from '~/composables/useClaw'
|
||||
@@ -130,13 +130,13 @@ const olderAvailable = ref(true)
|
||||
// The cards this page already tried to fetch. Keyed by the card object
|
||||
// rather than the attachment id: a page read, a mirror reset, or a live
|
||||
// turn folding into a record builds new cards, and a new card deserves
|
||||
// its fetch — the useClaw cache answers a repeat with the blob it
|
||||
// its fetch, the useClaw cache answers a repeat with the blob it
|
||||
// already holds, so a retry costs no request.
|
||||
let attemptedAttachments = new WeakSet<object>()
|
||||
|
||||
// Image cards need their bytes before they can render: fetched as the
|
||||
// card appears, not on any timer. code/file fetch on download instead.
|
||||
// A replayed question's images fetch the same way — the stream carries
|
||||
// A replayed question's images fetch the same way, the stream carries
|
||||
// their attachment ids, never the bytes; locally sent rows hold their
|
||||
// own object URLs.
|
||||
//
|
||||
@@ -259,7 +259,7 @@ async function clearIdentityImage(kind: AgentImageKind): Promise<void> {
|
||||
}
|
||||
|
||||
// The window title answers to the identity and the view, as the design
|
||||
// shows it: "Kosmos — Settings · Model providers".
|
||||
// shows it: "Kosmos, Settings · Model providers".
|
||||
const viewTitle = computed(() => {
|
||||
const current = route.value
|
||||
if (current.view === 'chat') return 'Chat'
|
||||
@@ -272,7 +272,7 @@ watch(
|
||||
[identity, viewTitle],
|
||||
() => {
|
||||
const name = identity.value?.name?.trim()
|
||||
document.title = name ? `${name} — ${viewTitle.value}` : `rhema claw — ${viewTitle.value}`
|
||||
document.title = name ? `${name} · ${viewTitle.value}` : `rhema claw · ${viewTitle.value}`
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
@@ -339,7 +339,7 @@ async function refreshSessions(): Promise<void> {
|
||||
apiError.value = null
|
||||
// A read-only thread has no stream to tell it a dispatch ran; the
|
||||
// inventory's revision does. Reload the snapshot when it moved, and
|
||||
// only then — a reload drops the pages the reader walked back to.
|
||||
// only then, a reload drops the pages the reader walked back to.
|
||||
if (activeKey.value !== '' && !isResidentKey(activeKey.value) && !threadLoading) {
|
||||
const revision = sessions.value.find((s) => s.key === activeKey.value)?.revision ?? null
|
||||
if (revision !== threadRevision) void loadThread()
|
||||
@@ -379,7 +379,7 @@ function closeDeleteSession(): void {
|
||||
}
|
||||
|
||||
/** The session to show once `gone` is deleted: the first interactive one
|
||||
* the inventory still has, else the first of any kind, else none — an
|
||||
* the inventory still has, else the first of any kind, else none, an
|
||||
* empty key opens no stream (see `resubscribe`). */
|
||||
function nextActiveKey(gone: string): string {
|
||||
const remaining = sessions.value.filter((session) => session.key !== gone)
|
||||
@@ -502,9 +502,9 @@ async function addAccount(account: NewAccount): Promise<void> {
|
||||
pushNotice(
|
||||
saved.watchable_forge
|
||||
? saved.watched
|
||||
? `account ${saved.label} saved — following ${saved.service} notifications`
|
||||
? `account ${saved.label} saved, following ${saved.service} notifications`
|
||||
: `account ${saved.label} saved (already watched)`
|
||||
: `account ${saved.label} saved — ${saved.service} is not a watchable forge`,
|
||||
: `account ${saved.label} saved. ${saved.service} is not a watchable forge`,
|
||||
)
|
||||
await refreshAccounts()
|
||||
} catch (err) {
|
||||
@@ -520,7 +520,7 @@ async function removeAccount(account: ClawAccount): Promise<void> {
|
||||
const forgot = await claw.removeAccount(account.id)
|
||||
pushNotice(
|
||||
forgot.forgot
|
||||
? `account ${account.label} forgotten${forgot.watches_removed ? ` — ${forgot.watches_removed} watch(es) removed` : ''}`
|
||||
? `account ${account.label} forgotten${forgot.watches_removed ? `, ${forgot.watches_removed} watch(es) removed` : ''}`
|
||||
: `account ${account.label} was already gone`,
|
||||
)
|
||||
await refreshAccounts()
|
||||
@@ -680,8 +680,8 @@ async function saveSandbox(choice: SandboxSelection): Promise<void> {
|
||||
|
||||
async function send(message: { text: string; pastes: string[]; images: StagedImage[] }): Promise<void> {
|
||||
// The optimistic row renders the staged previews and the composed
|
||||
// chip record — the same plain text and spans the fold records on
|
||||
// the other side — so the stream's user_message echo, which
|
||||
// chip record, the same plain text and spans the fold records on
|
||||
// the other side, so the stream's user_message echo, which
|
||||
// carries the stored ids beside that record, dedupes against it.
|
||||
const composed = composeChips(message.text, message.pastes)
|
||||
const rowId = transcript.addSent(
|
||||
@@ -761,7 +761,7 @@ function saveToken(): void {
|
||||
authRequired.value = false
|
||||
apiError.value = null
|
||||
// The stream's retry loop reads the token fresh each attempt, so it
|
||||
// recovers on its own; everything the 401 froze reloads now — the
|
||||
// recovers on its own; everything the 401 froze reloads now, the
|
||||
// polls confirm the token works, and the identity and accounts pages
|
||||
// were left empty by the failed fetches that raised the banner.
|
||||
void checkHealth()
|
||||
@@ -823,7 +823,7 @@ function resubscribe(): void {
|
||||
streamStatus.value = status
|
||||
// A retry resumes from the last seq this mirror holds, so the
|
||||
// claw sends the gap and nothing else: the mirror stays as it
|
||||
// is. Only the attachment set is cleared — a fetch that failed
|
||||
// is. Only the attachment set is cleared, a fetch that failed
|
||||
// during the outage should retry against the recovered stream.
|
||||
if (status === 'reconnecting') {
|
||||
attemptedAttachments = new WeakSet<object>()
|
||||
@@ -837,7 +837,7 @@ function resubscribe(): void {
|
||||
|
||||
/** Loads the newest page of a read-only thread: a snapshot of the
|
||||
* engine's own history, rendered by the same mirror the stream feeds.
|
||||
* Pagination is the walk back, unchanged — a page lands, the scroller
|
||||
* Pagination is the walk back, unchanged, a page lands, the scroller
|
||||
* asks for the next one. */
|
||||
async function loadThread(): Promise<void> {
|
||||
const key = activeKey.value
|
||||
@@ -916,13 +916,33 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="shell">
|
||||
<AppRail
|
||||
:view="route.view"
|
||||
<div class="shell" :class="{ 'shell-settings': route.view === 'settings' }">
|
||||
<SessionsSidebar
|
||||
v-if="route.view === 'chat'"
|
||||
:sessions="sessions"
|
||||
:active-key="activeKey"
|
||||
:loading="sessionsLoading"
|
||||
:claw-up="clawUp"
|
||||
:identity="identity"
|
||||
:avatar-url="identityAvatarUrl"
|
||||
@navigate="go($event === 'chat' ? { view: 'chat' } : { view: 'settings', section: 'providers' })"
|
||||
@home="go({ view: 'chat' })"
|
||||
@navigate-settings="go({ view: 'settings', section: 'providers' })"
|
||||
@select="activeKey = $event"
|
||||
@refresh="refreshSessions"
|
||||
@create="createSession"
|
||||
@delete="askDeleteSession"
|
||||
@pause="pauseSession"
|
||||
@resume="resumeSession"
|
||||
@abort="abortSession"
|
||||
/>
|
||||
<SettingsNav
|
||||
v-else
|
||||
:sections="SETTINGS_SECTIONS"
|
||||
:active="route.section"
|
||||
:claw-up="clawUp"
|
||||
@home="go({ view: 'chat' })"
|
||||
@navigate-chat="go({ view: 'chat' })"
|
||||
@select="go({ view: 'settings', section: $event })"
|
||||
/>
|
||||
|
||||
<div class="body">
|
||||
@@ -937,7 +957,7 @@ onUnmounted(() => {
|
||||
autocomplete="off"
|
||||
@keydown.enter="saveToken"
|
||||
/>
|
||||
<button @click="saveToken">save</button>
|
||||
<button @click="saveToken">Save</button>
|
||||
</template>
|
||||
</ClawBanner>
|
||||
<ClawBanner v-if="clawUp === false" variant="error">
|
||||
@@ -959,22 +979,8 @@ onUnmounted(() => {
|
||||
</div>
|
||||
|
||||
<main class="view">
|
||||
<template v-if="route.view === 'chat'">
|
||||
<SessionsSidebar
|
||||
:sessions="sessions"
|
||||
:active-key="activeKey"
|
||||
:loading="sessionsLoading"
|
||||
:identity="identity"
|
||||
:avatar-url="identityAvatarUrl"
|
||||
@select="activeKey = $event"
|
||||
@refresh="refreshSessions"
|
||||
@create="createSession"
|
||||
@delete="askDeleteSession"
|
||||
@pause="pauseSession"
|
||||
@resume="resumeSession"
|
||||
@abort="abortSession"
|
||||
/>
|
||||
<ChatPanel
|
||||
<ChatPanel
|
||||
v-if="route.view === 'chat'"
|
||||
:items="transcriptItems"
|
||||
:live="liveTurn"
|
||||
:active-key="activeKey"
|
||||
@@ -996,15 +1002,8 @@ onUnmounted(() => {
|
||||
@consent-deny="denyConsent"
|
||||
@download-attachment="downloadAttachment"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<SettingsNav
|
||||
:sections="SETTINGS_SECTIONS"
|
||||
:active="route.section"
|
||||
:claw-up="clawUp"
|
||||
@select="go({ view: 'settings', section: $event })"
|
||||
/>
|
||||
<SettingsAgentGeneralPage
|
||||
v-show="route.section === 'agent/general'"
|
||||
:identity="identity"
|
||||
@@ -1082,11 +1081,11 @@ onUnmounted(() => {
|
||||
created under the same name starts empty.
|
||||
</p>
|
||||
<template #actions>
|
||||
<button class="ghost" :disabled="deleting" @click="closeDeleteSession">
|
||||
cancel
|
||||
<button class="btn-quiet" :disabled="deleting" @click="closeDeleteSession">
|
||||
Cancel
|
||||
</button>
|
||||
<button :disabled="deleting" @click="confirmDeleteSession">
|
||||
{{ deleting ? 'deleting…' : 'delete' }}
|
||||
<button class="btn-danger" :disabled="deleting" @click="confirmDeleteSession">
|
||||
{{ deleting ? 'Deleting…' : 'Delete' }}
|
||||
</button>
|
||||
</template>
|
||||
</AppModal>
|
||||
@@ -1109,13 +1108,14 @@ onUnmounted(() => {
|
||||
.banners {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding: 8px 16px 0;
|
||||
gap: var(--sp-2);
|
||||
padding: var(--sp-2) var(--sp-4) 0;
|
||||
}
|
||||
|
||||
.view {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@@ -1123,19 +1123,33 @@ onUnmounted(() => {
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 980px) {
|
||||
@media (max-width: 860px) {
|
||||
.shell {
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.view {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* Settings is a document on a phone: the nav and the page scroll
|
||||
together instead of squeezing the page into the space left. */
|
||||
.shell-settings {
|
||||
height: auto;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.view {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.view > * {
|
||||
height: 60vh;
|
||||
border-top: 1px solid var(--border);
|
||||
.shell-settings .body,
|
||||
.shell-settings .view {
|
||||
flex: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+399
-142
@@ -1,35 +1,113 @@
|
||||
/*
|
||||
* The Jadeite tokens, dark theme — lifted token for token from
|
||||
* crates/rhema-code/src/palette.rs `DARK` so the web claw reads as the
|
||||
* same tool as the TUI. The ground is deliberately jade-tinted, not
|
||||
* slate; saturated color stays on the accent and the status set.
|
||||
*/
|
||||
:root {
|
||||
--ground: #0f1413;
|
||||
--surface: #171d1b;
|
||||
--elevated: #1f2624;
|
||||
--sunken: #0a0f0e;
|
||||
--border: #28312e;
|
||||
--border-strong: #3d4844;
|
||||
--text: #eef3f1;
|
||||
--text2: #b9c6c1;
|
||||
--text3: #87948f;
|
||||
--accent: #35a882;
|
||||
--accent-text: #64c9a3;
|
||||
--on-accent: #07110d;
|
||||
--running: #64c9a3;
|
||||
--ok: #4fbf94;
|
||||
--warn: #d9a643;
|
||||
--error: #e4687a;
|
||||
--info: #8fa6b8;
|
||||
|
||||
--sans: ui-sans-serif, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue',
|
||||
Arial, sans-serif;
|
||||
--mono: ui-monospace, 'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo,
|
||||
Consolas, monospace;
|
||||
@font-face {
|
||||
font-family: "FiraCode Nerd Font Mono";
|
||||
src: url("../fonts/FiraCodeNerdFontMono-Regular.woff2") format("woff2");
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
* {
|
||||
@font-face {
|
||||
font-family: "FiraCode Nerd Font Mono";
|
||||
src: url("../fonts/FiraCodeNerdFontMono-Bold.woff2") format("woff2");
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
/*
|
||||
* The same palette as Rhema Together: a warm paper ground, white cards,
|
||||
* one jade accent, and status color only where a state needs it. Light
|
||||
* is the default; the dark set follows the operating system.
|
||||
*/
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
|
||||
--bg: #f7f6f3;
|
||||
--surface: #ffffff;
|
||||
--surface-2: #f1efe9;
|
||||
--border: #e4e0d8;
|
||||
--border-strong: #d3cec3;
|
||||
--text: #1f1d1a;
|
||||
--muted: #736d63;
|
||||
--faint: #9a9388;
|
||||
--accent: #2f6f5e;
|
||||
--accent-soft: #e7f1ed;
|
||||
--danger: #a33a2f;
|
||||
--warn: #8a6519;
|
||||
--ok: #2f6f5e;
|
||||
--info: #4f5f8f;
|
||||
--on-accent: #ffffff;
|
||||
--overlay: rgba(31, 29, 26, 0.4);
|
||||
|
||||
--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
--font-mono: "FiraCode Nerd Font Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
|
||||
Consolas, "Liberation Mono", monospace;
|
||||
|
||||
--fs-small: 12px;
|
||||
--fs-meta: 13px;
|
||||
--fs-ui: 14px;
|
||||
--fs-code: 13px;
|
||||
--fs-section: 16px;
|
||||
--fs-title: 20px;
|
||||
|
||||
--lh-body: 1.5;
|
||||
--lh-heading: 1.2;
|
||||
|
||||
--sp-1: 4px;
|
||||
--sp-2: 8px;
|
||||
--sp-3: 12px;
|
||||
--sp-4: 16px;
|
||||
--sp-5: 20px;
|
||||
--sp-6: 24px;
|
||||
--sp-8: 32px;
|
||||
--sp-10: 40px;
|
||||
--sp-12: 48px;
|
||||
|
||||
--r-card: 10px;
|
||||
--r-control: 8px;
|
||||
--r-avatar: 999px;
|
||||
|
||||
--sidebar-w: 232px;
|
||||
--topbar-h: 56px;
|
||||
|
||||
/* Names the components used before the redesign. They resolve to the
|
||||
same palette, so every existing rule keeps its meaning. */
|
||||
--ground: var(--bg);
|
||||
--elevated: var(--surface-2);
|
||||
--sunken: var(--surface-2);
|
||||
--text2: var(--text);
|
||||
--text3: var(--muted);
|
||||
--accent-text: var(--accent);
|
||||
--running: var(--accent);
|
||||
--error: var(--danger);
|
||||
--sans: var(--font-sans);
|
||||
--mono: var(--font-mono);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #12110f;
|
||||
--surface: #1a1917;
|
||||
--surface-2: #22201d;
|
||||
--border: #272521;
|
||||
--border-strong: #3a3733;
|
||||
--text: #f2f0ec;
|
||||
--muted: #a49d92;
|
||||
--faint: #7d766c;
|
||||
--accent: #58a58c;
|
||||
--accent-soft: #1e2f2a;
|
||||
--danger: #d07366;
|
||||
--warn: #c9a45c;
|
||||
--ok: #58a58c;
|
||||
--info: #8b9bd0;
|
||||
--on-accent: #12110f;
|
||||
--overlay: rgba(0, 0, 0, 0.62);
|
||||
}
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -41,52 +119,91 @@ body,
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--ground);
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: var(--sans);
|
||||
font-size: 13.5px;
|
||||
line-height: 1.55;
|
||||
font-family: var(--font-sans);
|
||||
font-size: var(--fs-ui);
|
||||
line-height: var(--lh-body);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-weight: 600;
|
||||
line-height: var(--lh-heading);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: var(--fs-title);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: var(--fs-section);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: var(--fs-ui);
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Values, keys, and anything the claw itself says render mono; the UI
|
||||
chrome around them renders sans. */
|
||||
code,
|
||||
pre,
|
||||
.mono {
|
||||
font-family: var(--mono);
|
||||
font-size: 0.93em;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.94em;
|
||||
font-variant-ligatures: contextual common-ligatures;
|
||||
font-feature-settings: "calt" 1, "liga" 1;
|
||||
}
|
||||
|
||||
/* Section labels: the one repeated typographic voice across panels. */
|
||||
.label {
|
||||
font-family: var(--sans);
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.13em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text3);
|
||||
button,
|
||||
input,
|
||||
textarea,
|
||||
select {
|
||||
font: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
/* --- controls ------------------------------------------------------- */
|
||||
|
||||
button {
|
||||
font: inherit;
|
||||
color: var(--text);
|
||||
background: var(--elevated);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--sp-2);
|
||||
min-height: 32px;
|
||||
padding: 0 var(--sp-3);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 6px;
|
||||
padding: 5px 14px;
|
||||
border-radius: var(--r-control);
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
font-size: var(--fs-ui);
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover:not(:disabled) {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent-text);
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
opacity: 0.45;
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
@@ -94,34 +211,45 @@ button.primary {
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
button.primary:hover:not(:disabled) {
|
||||
background: var(--accent-text);
|
||||
border-color: var(--accent-text);
|
||||
color: var(--on-accent);
|
||||
background: var(--accent);
|
||||
filter: brightness(0.96);
|
||||
}
|
||||
|
||||
button.ghost {
|
||||
background: none;
|
||||
border-color: transparent;
|
||||
color: var(--text3);
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
button.ghost:hover:not(:disabled) {
|
||||
color: var(--accent-text);
|
||||
background: var(--surface-2);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font: inherit;
|
||||
min-height: 36px;
|
||||
padding: var(--sp-2) var(--sp-3);
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--r-control);
|
||||
color: var(--text);
|
||||
background: var(--sunken);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
padding: 6px 10px;
|
||||
font-size: var(--fs-ui);
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
line-height: var(--lh-body);
|
||||
}
|
||||
|
||||
input::placeholder,
|
||||
textarea::placeholder {
|
||||
color: var(--faint);
|
||||
}
|
||||
|
||||
input:hover,
|
||||
@@ -130,50 +258,178 @@ textarea:hover {
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
input:focus-visible,
|
||||
select:focus-visible,
|
||||
textarea:focus-visible,
|
||||
button:focus-visible {
|
||||
outline: 1px solid var(--accent);
|
||||
outline-offset: 0;
|
||||
input:focus,
|
||||
select:focus,
|
||||
textarea:focus {
|
||||
border-color: var(--accent);
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: -1px;
|
||||
}
|
||||
|
||||
input::placeholder,
|
||||
textarea::placeholder {
|
||||
color: var(--text3);
|
||||
:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: var(--accent-soft);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.file-input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.faint {
|
||||
color: var(--faint);
|
||||
}
|
||||
|
||||
.meta {
|
||||
font-size: var(--fs-meta);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.label {
|
||||
font-family: var(--font-sans);
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: var(--faint);
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* --- controls ------------------------------------------------------- */
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--sp-2);
|
||||
height: 32px;
|
||||
padding: 0 var(--sp-3);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--r-control);
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
font-size: var(--fs-ui);
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn:hover:not(:disabled) {
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: var(--on-accent);
|
||||
}
|
||||
|
||||
.btn-primary:hover:not(:disabled) {
|
||||
background: var(--accent);
|
||||
filter: brightness(0.96);
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
color: var(--danger);
|
||||
border-color: var(--border-strong);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.btn-danger:hover:not(:disabled) {
|
||||
background: color-mix(in srgb, var(--danger) 8%, var(--surface));
|
||||
}
|
||||
|
||||
.btn-quiet {
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.btn-quiet:hover:not(:disabled) {
|
||||
background: var(--surface-2);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
height: 28px;
|
||||
padding: 0 var(--sp-2);
|
||||
font-size: var(--fs-meta);
|
||||
gap: var(--sp-1);
|
||||
}
|
||||
|
||||
.icon-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
min-height: 32px;
|
||||
padding: 0;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--r-control);
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.icon-btn:hover:not(:disabled) {
|
||||
background: var(--surface-2);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.icon-btn:disabled {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
/* --- surfaces ------------------------------------------------------- */
|
||||
|
||||
/* The one card: a titled container of setting rows or static facts. */
|
||||
.card {
|
||||
flex-shrink: 0;
|
||||
overflow: hidden;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
/* A card holds its content. Inside the settings pages' scrolling
|
||||
column, the default flex shrink would clip the last row instead. */
|
||||
flex-shrink: 0;
|
||||
border-radius: var(--r-card);
|
||||
}
|
||||
|
||||
.card > .card-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 12px 16px;
|
||||
gap: var(--sp-3);
|
||||
padding: var(--sp-3) var(--sp-4);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.card > .card-head .title {
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
font-size: var(--fs-ui);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.card > .card-head .meta {
|
||||
color: var(--text3);
|
||||
font-size: 12px;
|
||||
min-width: 0;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-small);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -181,74 +437,73 @@ textarea::placeholder {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Rows inside a card body separate by hairline, not by gaps. */
|
||||
.card > .card-body > * + * {
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.card > .card-body.flush {
|
||||
padding: 8px 16px;
|
||||
padding: var(--sp-2) var(--sp-4);
|
||||
}
|
||||
|
||||
.card > .card-body.flush > * + * {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
/* --- badges ---------------------------------------------------------- */
|
||||
/* --- tags ----------------------------------------------------------- */
|
||||
|
||||
.badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
padding: 1px 8px;
|
||||
border-radius: 999px;
|
||||
gap: var(--sp-1);
|
||||
padding: 1px var(--sp-2);
|
||||
border: 1px solid var(--border-strong);
|
||||
color: var(--text3);
|
||||
border-radius: 6px;
|
||||
background: var(--surface-2);
|
||||
color: var(--muted);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 11px;
|
||||
font-family: var(--mono);
|
||||
line-height: 1.6;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.badge.accent {
|
||||
border-color: color-mix(in srgb, var(--accent) 55%, transparent);
|
||||
color: var(--accent-text);
|
||||
background: color-mix(in srgb, var(--accent) 12%, transparent);
|
||||
border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.badge.ok {
|
||||
border-color: color-mix(in srgb, var(--ok) 55%, transparent);
|
||||
border-color: color-mix(in srgb, var(--ok) 40%, var(--border));
|
||||
color: var(--ok);
|
||||
}
|
||||
|
||||
.badge.warn {
|
||||
border-color: color-mix(in srgb, var(--warn) 55%, transparent);
|
||||
border-color: color-mix(in srgb, var(--warn) 40%, var(--border));
|
||||
color: var(--warn);
|
||||
}
|
||||
|
||||
.badge.error {
|
||||
border-color: color-mix(in srgb, var(--error) 55%, transparent);
|
||||
color: var(--error);
|
||||
border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
/* --- banners --------------------------------------------------------- */
|
||||
/* --- banners -------------------------------------------------------- */
|
||||
|
||||
/* Banners: the single inline error/notice surface. Never toasts, never
|
||||
console-only — claw down, 401, and stream drops all land here. */
|
||||
.banner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 8px 12px;
|
||||
gap: var(--sp-2);
|
||||
padding: var(--sp-2) var(--sp-3);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-left: 3px solid var(--info);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--r-control);
|
||||
background: var(--surface);
|
||||
color: var(--text2);
|
||||
color: var(--text);
|
||||
font-size: var(--fs-meta);
|
||||
}
|
||||
|
||||
.banner.error {
|
||||
border-left-color: var(--error);
|
||||
color: var(--text);
|
||||
border-left-color: var(--danger);
|
||||
}
|
||||
|
||||
.banner.warn {
|
||||
@@ -261,11 +516,8 @@ textarea::placeholder {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
/* --- markdown -------------------------------------------------------- */
|
||||
/* --- markdown ------------------------------------------------------- */
|
||||
|
||||
/* Rendered agent replies (AppMarkdown): markdown-it output mounted with
|
||||
v-html, so only generated tags show up here. Blocks separate by small
|
||||
margins; headings stay close to body size, a chat reply not a page. */
|
||||
.md > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -280,12 +532,12 @@ textarea::placeholder {
|
||||
.md pre,
|
||||
.md blockquote,
|
||||
.md table {
|
||||
margin: 0 0 8px;
|
||||
margin: 0 0 var(--sp-2);
|
||||
}
|
||||
|
||||
.md ul,
|
||||
.md ol {
|
||||
padding-left: 20px;
|
||||
padding-left: var(--sp-5);
|
||||
}
|
||||
|
||||
.md li {
|
||||
@@ -303,60 +555,58 @@ textarea::placeholder {
|
||||
.md h4,
|
||||
.md h5,
|
||||
.md h6 {
|
||||
margin: 14px 0 6px;
|
||||
font-weight: 700;
|
||||
line-height: 1.3;
|
||||
margin: var(--sp-3) 0 var(--sp-1);
|
||||
font-weight: 600;
|
||||
line-height: var(--lh-heading);
|
||||
}
|
||||
|
||||
.md h1 {
|
||||
font-size: 16px;
|
||||
font-size: var(--fs-section);
|
||||
}
|
||||
|
||||
.md h2 {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.md h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.md h3,
|
||||
.md h4,
|
||||
.md h5,
|
||||
.md h6 {
|
||||
font-size: 13.5px;
|
||||
font-size: var(--fs-ui);
|
||||
}
|
||||
|
||||
.md a {
|
||||
color: var(--accent-text);
|
||||
color: var(--accent);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
}
|
||||
|
||||
.md code {
|
||||
background: var(--sunken);
|
||||
padding: 1px 5px;
|
||||
background: var(--surface-2);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
padding: 1px 5px;
|
||||
}
|
||||
|
||||
.md pre {
|
||||
padding: 10px 12px;
|
||||
background: var(--sunken);
|
||||
padding: var(--sp-2) var(--sp-3);
|
||||
background: var(--surface-2);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--r-control);
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
/* The global code rule shrinks em-relative twice inside a pre; undo it. */
|
||||
.md pre code {
|
||||
padding: 0;
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.md blockquote {
|
||||
padding: 2px 12px;
|
||||
padding: 2px var(--sp-3);
|
||||
border-left: 3px solid var(--border-strong);
|
||||
color: var(--text2);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.md hr {
|
||||
@@ -370,24 +620,25 @@ textarea::placeholder {
|
||||
|
||||
.md th,
|
||||
.md td {
|
||||
padding: 3px var(--sp-2);
|
||||
border: 1px solid var(--border-strong);
|
||||
padding: 3px 10px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.md th {
|
||||
background: var(--surface);
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.md img {
|
||||
max-width: 100%;
|
||||
border-radius: var(--r-control);
|
||||
}
|
||||
|
||||
/* While the turn streams, the cursor rides the end of the last block. */
|
||||
.md.streaming > :last-child::after {
|
||||
content: '▊';
|
||||
margin-left: 1px;
|
||||
color: var(--accent-text);
|
||||
color: var(--accent);
|
||||
animation: md-blink 1.1s steps(1) infinite;
|
||||
}
|
||||
|
||||
@@ -396,3 +647,9 @@ textarea::placeholder {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.md.streaming > :last-child::after {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
Copyright (c) 2014, The Fira Code Project Authors (https://github.com/tonsky/FiraCode)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
@@ -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