fix(webui): make chat a FAB-opened panel and stop the topbar clipping
Four P0 defects from the frontend audit, plus the one-line theme fix that was
making every one of them look worse.
Chat is a floating launcher and the panel it opens, not a route
(archie-core-yuvg, archie-core-hesx). /chat rendered an empty page with a
drawer over it, and that drawer hosted the full-page chat workspace: a page
title, a conversations column, a four-control action row and a command-help
column, all inside 440px. Measured at 1440x900, .chat-workspace was 174px wide
holding 270px of content and the composer ran off the viewport.
- The Chat nav entry, the /chat route and the topbar chat icon are gone;
the launcher is the single way in.
- The panel anchors to the launcher and opens leftward from it, sharing its
bottom edge, so the button never moves. No scrim and no scroll lock: the
page stays readable and clickable, which is the point of asking Archie
about the page you are on.
- Conversations became a switcher in a compact bar; personality, provider
and model moved into a disclosure beside it; the empty state and composer
dropped to panel type scale.
- The launcher renders outside .shell because .shell's backdrop-filter is a
containing block for fixed positioning, which otherwise pinned the button
to the scrolling shell instead of the viewport.
- Update-check, Dangerous actions and Reload Telegram left the panel; their
api.* calls are untouched for the rehome to Configuration
(archie-core-tf20).
The topbar no longer clips its utility cluster (archie-core-mkb3). brand, nav
and topbar-end were all flex:none with no wrap above 1220px, and .app sets
overflow:hidden, so between 1221px and ~1582px the avatar, theme toggle and
documentation button were cut off with no way to reach them. The nav is now
the one region allowed to shrink, the search collapses to its icon below
1500px, and the nav wraps to its own row below 1270px where it stops fitting.
Live activity clamps its detail column (archie-core-qo7f). An agent_finish
payload rendered raw turned one row into six viewports and the dashboard into
7,481px. The cell shows the first meaningful line; the full text stays on the
title.
color-scheme is bound to the active theme (archie-core-nm0y), so scrollbars
and native controls stop rendering light inside the dark UI.
This commit is contained in:
1 parent
5baeadd85e
commit
1422dc5955
15 files changed
+729
-465
No files matched your search
+129
-21
@@ -1,8 +1,120 @@
|
||||
.chat-page-content { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
|
||||
.chat-topbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
|
||||
.chat-kicker, .chat-workspace-label { color: var(--fg-muted); font-size: .68rem; font-weight: 700; letter-spacing: .12em; }
|
||||
.chat-topbar-actions { display: flex; align-items: center; gap: .55rem; }
|
||||
.chat-topbar-actions .chat-select { max-width: 14rem; min-width: 0; }
|
||||
/* The panel's own column. ChatApp is mounted in a ~440px launcher panel, never
|
||||
on a page, so there is one column and every row earns its height
|
||||
(archie-core-hesx). */
|
||||
.chat-panel-content {
|
||||
display: grid;
|
||||
grid-template-rows: auto minmax(0, 1fr);
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* One row for everything that is not the conversation: which conversation,
|
||||
a new one, and the model controls folded away behind a disclosure. */
|
||||
.chat-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--sp-2);
|
||||
padding: var(--sp-2) var(--sp-3);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.chat-session-switch {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.chat-session-switch select {
|
||||
width: 100%;
|
||||
background: var(--surface-hover);
|
||||
color: var(--fg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: var(--sp-2);
|
||||
font: inherit;
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.chat-new,
|
||||
.chat-settings > summary {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.chat-settings {
|
||||
position: relative;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.chat-settings > summary {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--fg-muted);
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.chat-settings > summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.chat-settings > summary:hover {
|
||||
background: var(--surface-hover);
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
/* Opens over the transcript rather than pushing it down: the panel is short
|
||||
and the conversation should not jump when the controls are consulted. */
|
||||
.chat-settings-body {
|
||||
position: absolute;
|
||||
top: calc(100% + var(--sp-2));
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
display: grid;
|
||||
gap: var(--sp-3);
|
||||
width: 15rem;
|
||||
padding: var(--sp-3);
|
||||
background: var(--bg-raised);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.chat-settings-body label {
|
||||
display: grid;
|
||||
gap: var(--sp-1);
|
||||
font-size: var(--text-xs);
|
||||
color: var(--fg-muted);
|
||||
}
|
||||
|
||||
.chat-settings-body .chat-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.chat-layout {
|
||||
display: grid;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chat-workspace {
|
||||
display: grid;
|
||||
grid-template-rows: auto minmax(0, 1fr) auto;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chat-workspace-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--sp-2);
|
||||
padding: var(--sp-2) var(--sp-3);
|
||||
border-bottom: 1px solid var(--border);
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
|
||||
.chat-update-panel { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 .75rem; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: .75rem; color: var(--fg-muted); font-size: .8rem; }
|
||||
.chat-update-panel > div:first-child { display: grid; gap: .2rem; }
|
||||
.chat-update-panel strong { color: var(--fg); }
|
||||
@@ -15,27 +127,21 @@
|
||||
.chat-dangerous-input { min-width: 0; flex: 1; padding: .5rem .65rem; background: var(--surface-hover); color: var(--fg); border: 1px solid var(--border-strong); border-radius: .5rem; font: inherit; }
|
||||
.chat-dangerous-pending-list { display: grid; gap: .45rem; margin-top: .75rem; }
|
||||
.chat-dangerous-pending { padding-top: .55rem; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: .8rem; }
|
||||
.chat-layout { display: grid; grid-template-columns: 242px minmax(0, 1fr); gap: .75rem; flex: 1 1 auto; min-height: 0; overflow: hidden; }
|
||||
.chat-sidebar, .chat-workspace { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; }
|
||||
.chat-sidebar { padding: .8rem; overflow-y: auto; }
|
||||
.chat-sidebar-head, .chat-toolbar, .chat-compose-actions { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
|
||||
.chat-session-list { display: grid; gap: .35rem; margin-top: 1rem; }
|
||||
.chat-session { display: grid; gap: .25rem; text-align: left; background: transparent; color: var(--fg-muted); border: 1px solid transparent; border-radius: .65rem; padding: .7rem; cursor: pointer; }
|
||||
.chat-session:hover, .chat-session.active { background: var(--surface-hover); color: var(--fg); border-color: var(--border-strong); }
|
||||
.chat-session span { font-size: .72rem; }
|
||||
.chat-workspace { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; min-width: 0; }
|
||||
.chat-workspace-head { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); }
|
||||
.chat-session-tools { position: relative; margin-left: .6rem; color: var(--fg-muted); font-size: .78rem; }
|
||||
.chat-session-tools summary { cursor: pointer; }
|
||||
.chat-session-tool-list { position: absolute; z-index: 2; right: 0; top: calc(100% + .45rem); display: flex; flex-wrap: wrap; gap: .35rem; width: min(22rem, 72vw); padding: .55rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: .65rem; box-shadow: 0 .7rem 2rem color-mix(in srgb, #000 30%, transparent); }
|
||||
.chat-select { background: var(--surface-hover); color: var(--fg); border: 1px solid var(--border-strong); border-radius: .5rem; padding: .5rem .65rem; }
|
||||
.chat-transcript { overflow: auto; padding: 1.25rem; display: grid; align-content: start; gap: 1rem; }
|
||||
.chat-empty-state { align-self: center; justify-self: center; width: min(100%, 40rem); padding: 3rem 1rem; text-align: center; }
|
||||
.chat-empty-mark { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin: 0 auto 1rem; border: 1px solid var(--border-strong); border-radius: .8rem; color: var(--accent); font-weight: 700; }
|
||||
.chat-empty-state h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -.04em; }
|
||||
.chat-empty-state p { margin: .6rem 0 1.4rem; color: var(--fg-muted); }
|
||||
.chat-prompt-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
|
||||
.chat-prompt { padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-hover); color: var(--fg-muted); cursor: pointer; }
|
||||
.chat-transcript { overflow: auto; padding: var(--sp-4); display: grid; align-content: start; gap: var(--sp-4); }
|
||||
.chat-empty-state { align-self: center; justify-self: center; width: 100%; padding: var(--sp-5) 0; text-align: center; }
|
||||
.chat-empty-mark { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; margin: 0 auto var(--sp-3); border: 1px solid var(--border-strong); border-radius: .8rem; color: var(--accent); font-weight: 700; }
|
||||
.chat-empty-state h2 { margin: 0; font-size: var(--text-lg); letter-spacing: -.02em; }
|
||||
.chat-empty-state p { margin: var(--sp-2) 0 var(--sp-4); color: var(--fg-muted); font-size: var(--text-sm); }
|
||||
.chat-prompt-grid { display: grid; gap: var(--sp-2); }
|
||||
.chat-prompt { padding: var(--sp-2) var(--sp-3); font-size: var(--text-sm); text-align: left; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-hover); color: var(--fg-muted); cursor: pointer; }
|
||||
.chat-prompt:hover { color: var(--fg); border-color: var(--border-strong); }
|
||||
.chat-bubble-row { display: flex; }
|
||||
.chat-bubble-row.user { justify-content: flex-end; }
|
||||
@@ -96,7 +202,7 @@
|
||||
}
|
||||
.chat-nav-chip-icon { font-size: .8rem; line-height: 1; }
|
||||
|
||||
.chat-compose { padding: .85rem 1rem 1rem; border-top: 1px solid var(--border); }
|
||||
.chat-compose { padding: var(--sp-3); border-top: 1px solid var(--border); }
|
||||
.chat-composer-shell { position: relative; padding: .7rem .8rem .55rem; background: var(--surface-hover); border: 1px solid var(--border-strong); border-radius: .9rem; }
|
||||
.chat-composer { width: 100%; min-height: 3.3rem; resize: vertical; box-sizing: border-box; background: transparent; color: var(--fg); border: 0; padding: .25rem 0; font: inherit; }
|
||||
.chat-composer:focus { outline: 0; }
|
||||
@@ -105,12 +211,14 @@
|
||||
.chat-command-option { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: .65rem; align-items: center; padding: .5rem .6rem; text-align: left; color: var(--fg-muted); background: transparent; border: 1px solid transparent; border-radius: .45rem; cursor: pointer; }
|
||||
.chat-command-option:hover, .chat-command-option[aria-selected="true"] { color: var(--fg); background: var(--surface-hover); border-color: var(--border); }
|
||||
.chat-command-option code { color: var(--fg); }
|
||||
.chat-compose-actions { margin-top: .55rem; }
|
||||
/* The hint takes the whole first row so Stop and Send always sit together on
|
||||
the second, rather than the hint pushing Send onto a line of its own. */
|
||||
.chat-compose-actions { margin-top: var(--sp-2); flex-wrap: wrap; row-gap: var(--sp-2); justify-content: flex-end; }
|
||||
.chat-compose-actions .chat-hint { flex: 1 0 100%; font-size: var(--text-xs); color: var(--fg-muted); }
|
||||
.chat-hint, .chat-empty { color: var(--fg-muted); font-size: .78rem; }
|
||||
.chat-command-help { color: var(--fg-muted); font-size: .78rem; margin-right: auto; }
|
||||
.chat-command-help summary { cursor: pointer; }
|
||||
.chat-command-list { min-width: min(34rem, 70vw); max-width: 40rem; padding-top: .4rem; line-height: 1.45; }
|
||||
.chat-command-item { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: .7rem; padding: .3rem 0; }
|
||||
.chat-command-item code { color: var(--fg); }
|
||||
@media (max-width: 760px) { .chat-topbar, .chat-topbar-actions { align-items: flex-start; flex-direction: column; } .chat-layout { grid-template-columns: 1fr; } .chat-sidebar { max-height: 14rem; overflow: auto; } }
|
||||
@media (max-width: 520px) { .chat-update-panel { align-items: flex-start; flex-direction: column; } }
|
||||
+71
-282
@@ -5,7 +5,6 @@ import { ChatMarkdown } from "./markdown.jsx";
|
||||
import { channelID } from "./chat-state.jsx";
|
||||
import { newChatTurn, retryChatTurn, resolveTurn } from "./chat-retry.jsx";
|
||||
import { sessionTitle } from "./chat-render.jsx";
|
||||
import { updateUnavailableMessage } from "./chat-update-status.jsx";
|
||||
|
||||
import "./chat.css";
|
||||
|
||||
@@ -31,13 +30,6 @@ export function ChatApp() {
|
||||
const [commandSelection, setCommandSelection] = useState(0);
|
||||
const [isCommandMenuOpen, setIsCommandMenuOpen] = useState(false);
|
||||
|
||||
const [updateData, setUpdateData] = useState(null);
|
||||
const [updateSnapshot, setUpdateSnapshot] = useState(null);
|
||||
|
||||
const [dangerousData, setDangerousData] = useState(null);
|
||||
const [dangerousCheckpoint, setDangerousCheckpoint] = useState("");
|
||||
const [dangerousStopSpec, setDangerousStopSpec] = useState("");
|
||||
|
||||
const [streamingTurn, setStreamingTurn] = useState(null);
|
||||
// streamingTurn: { text: string, tools: [], isError: bool, turn: object, isRetry: bool }
|
||||
|
||||
@@ -60,7 +52,6 @@ export function ChatApp() {
|
||||
refreshSessions().catch((err) => {
|
||||
setStatusText(err.message || "Chat unavailable");
|
||||
});
|
||||
refreshUpdate();
|
||||
|
||||
const onTeardown = () => {
|
||||
activeControllerRef.current?.abort();
|
||||
@@ -72,75 +63,6 @@ export function ChatApp() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
async function refreshUpdate() {
|
||||
try {
|
||||
const data = await api.chatUpdate();
|
||||
setUpdateSnapshot(data?.snapshot || null);
|
||||
setUpdateData(data);
|
||||
} catch (err) {
|
||||
const message = updateUnavailableMessage(err);
|
||||
if (message) {
|
||||
setUpdateData({ error: message });
|
||||
} else {
|
||||
setUpdateData(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function deferUpdate() {
|
||||
if (!updateSnapshot) return;
|
||||
try {
|
||||
await api.chatUpdateDefer(updateSnapshot);
|
||||
setUpdateData({ snapshot: { deferred: true }, available: [] });
|
||||
setStatusText("Update deferred");
|
||||
} catch (err) {
|
||||
setStatusText(err.message || "Could not defer update");
|
||||
}
|
||||
}
|
||||
|
||||
async function installUpdate() {
|
||||
if (!updateSnapshot) return;
|
||||
try {
|
||||
setStatusText("Installing…");
|
||||
const result = await api.chatUpdateInstall(updateSnapshot);
|
||||
setUpdateSnapshot(null);
|
||||
setUpdateData({ snapshot: {}, available: [] });
|
||||
setStatusText(result?.result?.restart_requested ? "Update installed; restart queued" : "Update complete");
|
||||
} catch (err) {
|
||||
setStatusText(err.message || "Update install failed");
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshDangerous() {
|
||||
try {
|
||||
const data = await api.chatDangerous();
|
||||
setDangerousData(data);
|
||||
} catch (err) {
|
||||
setDangerousData({ error: err.message || "Dangerous actions unavailable" });
|
||||
}
|
||||
}
|
||||
|
||||
async function requestDangerousAction(kind, spec) {
|
||||
if (!spec) return;
|
||||
try {
|
||||
await api.chatDangerousRequest(kind, spec);
|
||||
setStatusText("Approval requested");
|
||||
await refreshDangerous();
|
||||
} catch (err) {
|
||||
setStatusText(err.message || "Could not request action");
|
||||
}
|
||||
}
|
||||
|
||||
async function decideDangerousAction(id, decision) {
|
||||
try {
|
||||
await api.chatDangerousDecision(id, decision);
|
||||
setStatusText(decision === "deny" ? "Action denied" : "Action approved");
|
||||
await refreshDangerous();
|
||||
} catch (err) {
|
||||
setStatusText(err.message || "Approval failed");
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshSessions() {
|
||||
const data = await api.chatSessions();
|
||||
const sessionList = data.sessions || [];
|
||||
@@ -158,10 +80,6 @@ export function ChatApp() {
|
||||
);
|
||||
setCommandSpecs(specs);
|
||||
|
||||
if (data.dangerous_available) {
|
||||
await refreshDangerous();
|
||||
}
|
||||
|
||||
if (!currentSession && sessionList[0]) {
|
||||
await selectSession(sessionList[0].session_id, data, sessionList);
|
||||
}
|
||||
@@ -258,12 +176,6 @@ export function ChatApp() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleRestartTelegram() {
|
||||
if (!window.confirm("Reload the Telegram chat adapter?")) return;
|
||||
setComposerText("/restart");
|
||||
sendMessage({ textOverride: "/restart" });
|
||||
}
|
||||
|
||||
function handleNewChat() {
|
||||
setComposerText("/new");
|
||||
sendMessage({ textOverride: "/new" });
|
||||
@@ -487,213 +399,94 @@ export function ChatApp() {
|
||||
: selectorData.models || [];
|
||||
|
||||
return (
|
||||
<div className="chat-page-content">
|
||||
<header className="chat-topbar">
|
||||
<div>
|
||||
<span className="chat-kicker">ARCHIE WORKSPACE</span>
|
||||
<h1 className="page-title">Chat</h1>
|
||||
</div>
|
||||
<div className="chat-topbar-actions">
|
||||
<span className="chat-status">{statusText}</span>
|
||||
{selectorData.restart_available && (
|
||||
<button className="btn" type="button" onClick={handleRestartTelegram}>
|
||||
Reload Telegram
|
||||
</button>
|
||||
)}
|
||||
<button className="btn" type="button" onClick={refreshUpdate}>
|
||||
Check updates
|
||||
</button>
|
||||
<div className="chat-panel-content">
|
||||
<div className="chat-bar">
|
||||
<label className="chat-session-switch">
|
||||
<span className="sr-only">Conversation</span>
|
||||
<select
|
||||
className="chat-select"
|
||||
aria-label="Personality"
|
||||
value={selectedPersona}
|
||||
onChange={handlePersonaChange}
|
||||
value={currentSession}
|
||||
onChange={(e) => selectSession(e.target.value)}
|
||||
disabled={!sessions.length}
|
||||
>
|
||||
<option value="">Personality</option>
|
||||
{(selectorData.personas || []).map((name) => (
|
||||
<option key={name} value={name}>
|
||||
{name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{(selectorData.providers || []).length > 0 && (
|
||||
<select
|
||||
className="chat-select"
|
||||
aria-label="Provider"
|
||||
value={selectedProvider}
|
||||
onChange={handleProviderChange}
|
||||
>
|
||||
<option value="">Provider</option>
|
||||
{(selectorData.providers || []).map((p) => (
|
||||
<option key={p} value={p}>
|
||||
{p}
|
||||
{!sessions.length ? (
|
||||
<option value="">No conversations yet</option>
|
||||
) : (
|
||||
sessions.map((session) => (
|
||||
<option key={session.session_id} value={session.session_id}>
|
||||
{sessionTitle(session)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
<select
|
||||
className="chat-select"
|
||||
aria-label="Model"
|
||||
value={selectedModel}
|
||||
onChange={handleModelChange}
|
||||
>
|
||||
<option value="">Model</option>
|
||||
{currentModels.map((m) => (
|
||||
<option key={m} value={m}>
|
||||
{m}
|
||||
</option>
|
||||
))}
|
||||
))
|
||||
)}
|
||||
</select>
|
||||
</div>
|
||||
</header>
|
||||
</label>
|
||||
|
||||
{/* Update Panel */}
|
||||
{updateData && (
|
||||
<div className="chat-update-panel">
|
||||
{updateData.error ? (
|
||||
<span>{updateData.error}</span>
|
||||
) : updateData.available?.length ? (
|
||||
<Fragment>
|
||||
<div>
|
||||
<strong>Update available</strong>
|
||||
<span>
|
||||
{updateData.available
|
||||
.map((c) => `${c.Label || c.label}: ${c.Available || c.available}`)
|
||||
.join(" · ")}
|
||||
</span>
|
||||
</div>
|
||||
<div className="chat-update-actions">
|
||||
<button className="btn" type="button" onClick={deferUpdate}>
|
||||
Defer
|
||||
</button>
|
||||
{updateData.can_install && (
|
||||
<button className="btn btn-primary" type="button" onClick={installUpdate}>
|
||||
Install update
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</Fragment>
|
||||
) : (
|
||||
<span>{updateData.snapshot?.deferred ? "Update deferred." : "Archie is up to date."}</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<button className="icon-btn chat-new" type="button" title="New chat" aria-label="New chat" onClick={handleNewChat}>
|
||||
+
|
||||
</button>
|
||||
|
||||
{/* Dangerous Panel */}
|
||||
{selectorData.dangerous_available && dangerousData && (
|
||||
<div className="chat-dangerous-panel">
|
||||
<div className="chat-dangerous-head">
|
||||
<strong>Dangerous actions</strong>
|
||||
<span className="chat-hint">Every action requires approval.</span>
|
||||
</div>
|
||||
<div className="chat-dangerous-controls">
|
||||
<div>
|
||||
<details className="chat-settings">
|
||||
<summary aria-label="Chat settings" title="Chat settings">
|
||||
<span aria-hidden="true">⚙</span>
|
||||
</summary>
|
||||
<div className="chat-settings-body">
|
||||
<span className="chat-status">{statusText}</span>
|
||||
<label>
|
||||
Personality
|
||||
<select
|
||||
className="chat-select"
|
||||
aria-label="Checkpoint"
|
||||
value={dangerousCheckpoint}
|
||||
onChange={(e) => setDangerousCheckpoint(e.target.value)}
|
||||
aria-label="Personality"
|
||||
value={selectedPersona}
|
||||
onChange={handlePersonaChange}
|
||||
>
|
||||
<option value="">Select checkpoint</option>
|
||||
{(dangerousData.checkpoints || []).map((cp) => (
|
||||
<option key={cp.Number ?? cp.number} value={cp.Number ?? cp.number}>
|
||||
{cp.Number ?? cp.number} — {cp.Label ?? cp.label ?? "checkpoint"}
|
||||
<option value="">Default</option>
|
||||
{(selectorData.personas || []).map((name) => (
|
||||
<option key={name} value={name}>
|
||||
{name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<button
|
||||
className="btn"
|
||||
type="button"
|
||||
onClick={() => requestDangerousAction("rollback", dangerousCheckpoint)}
|
||||
>
|
||||
Request rollback
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<input
|
||||
className="chat-dangerous-input"
|
||||
placeholder="Process name or id"
|
||||
aria-label="Process name or id"
|
||||
value={dangerousStopSpec}
|
||||
onInput={(e) => setDangerousStopSpec(e.target.value)}
|
||||
/>
|
||||
<button
|
||||
className="btn"
|
||||
type="button"
|
||||
onClick={() => requestDangerousAction("stop", dangerousStopSpec)}
|
||||
>
|
||||
Request stop
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="chat-dangerous-pending-list">
|
||||
{(dangerousData.pending || []).length ? (
|
||||
dangerousData.pending.map((action) => (
|
||||
<div className="chat-dangerous-pending" key={action.id}>
|
||||
<span>{action.description}</span>
|
||||
<div className="chat-update-actions">
|
||||
<button
|
||||
className="btn"
|
||||
type="button"
|
||||
onClick={() => decideDangerousAction(action.id, "approve")}
|
||||
>
|
||||
Approve
|
||||
</button>
|
||||
<button
|
||||
className="btn"
|
||||
type="button"
|
||||
onClick={() => decideDangerousAction(action.id, "permanent")}
|
||||
>
|
||||
Approve for 24h
|
||||
</button>
|
||||
<button
|
||||
className="btn"
|
||||
type="button"
|
||||
onClick={() => decideDangerousAction(action.id, "deny")}
|
||||
>
|
||||
Deny
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<span className="chat-hint">No pending dangerous actions.</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Main Layout */}
|
||||
<div className="chat-layout">
|
||||
<aside className="chat-sidebar">
|
||||
<div className="chat-sidebar-head">
|
||||
<strong>Conversations</strong>
|
||||
<button className="btn btn-primary" type="button" onClick={handleNewChat}>
|
||||
+ New chat
|
||||
</button>
|
||||
</div>
|
||||
<div className="chat-session-list">
|
||||
{!sessions.length ? (
|
||||
<div className="chat-empty">Your conversations will appear here.</div>
|
||||
) : (
|
||||
sessions.map((session) => (
|
||||
<button
|
||||
key={session.session_id}
|
||||
className={`chat-session ${currentSession === session.session_id ? "active" : ""}`}
|
||||
type="button"
|
||||
onClick={() => selectSession(session.session_id)}
|
||||
</label>
|
||||
{(selectorData.providers || []).length > 0 && (
|
||||
<label>
|
||||
Provider
|
||||
<select
|
||||
className="chat-select"
|
||||
aria-label="Provider"
|
||||
value={selectedProvider}
|
||||
onChange={handleProviderChange}
|
||||
>
|
||||
<strong>{sessionTitle(session)}</strong>
|
||||
<span>{new Date(session.last_active_at).toLocaleString()}</span>
|
||||
</button>
|
||||
))
|
||||
<option value="">Default</option>
|
||||
{(selectorData.providers || []).map((provider) => (
|
||||
<option key={provider} value={provider}>
|
||||
{provider}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
)}
|
||||
<label>
|
||||
Model
|
||||
<select
|
||||
className="chat-select"
|
||||
aria-label="Model"
|
||||
value={selectedModel}
|
||||
onChange={handleModelChange}
|
||||
>
|
||||
<option value="">Default</option>
|
||||
{currentModels.map((model) => (
|
||||
<option key={model} value={model}>
|
||||
{model}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</aside>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<div className="chat-layout">
|
||||
<section className="chat-workspace">
|
||||
<div className="chat-workspace-head">
|
||||
<span className="chat-workspace-label">PERSONAL ASSISTANT</span>
|
||||
<details className="chat-command-help">
|
||||
<summary>Available commands ({commandSpecs.length})</summary>
|
||||
<div className="chat-command-list">
|
||||
@@ -937,7 +730,7 @@ export function ChatApp() {
|
||||
ref={composerRef}
|
||||
className="chat-composer"
|
||||
rows={3}
|
||||
placeholder="Message Archie… (commands like /status and /new work here)"
|
||||
placeholder="Message Archie, or type / for commands"
|
||||
aria-label="Message Archie"
|
||||
disabled={isSending}
|
||||
value={composerText}
|
||||
@@ -993,7 +786,3 @@ export function ChatApp() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function ChatPage() {
|
||||
return <ChatApp />;
|
||||
}
|
||||
Reference in new issue
Block a user