One button in the header of every tab: Load while the model is unloaded, Unload otherwise. It calls POST /load and POST /unload (the server already had both, for its own page only). Unload asks first and never interrupts a turn: the button is off while an answer is being written, an image is made or a request is queued. The pill and the Monitor say Unloaded / Loading / Unloading, a message or an image on an unloaded model shows Loading, and a poll that started before the POST cannot flip the button back (the POST's state is held until a later poll agrees). On a phone the pill's text is the first thing the header row gives up (it measures the row, not a fixed width), so Load/Unload and the theme button stay on the screen from 320 px. Browser tests (tools/webtest/browser_test.mjs): unload with its question, load back, declining, not while answering, a message that loads, the header at 320 to 640 px. Ported by hand from PR #3550 by Sakurai Momoka (sakuumomo); the texts now go through the page's translation catalog. Co-authored-by: Sakurai Momoka <159397306+sakuumomo@users.noreply.github.com>
260 lines
17 KiB
CSS
260 lines
17 KiB
CSS
/* Strata web app - layout on top of tokens.css + components.css (the Strata UI kit). Colours, type, radii and
|
|
shadows come only from the kit's tokens. */
|
|
[hidden] { display: none !important; }
|
|
html, body { height: 100%; }
|
|
body { display: flex; flex-direction: column; overflow: hidden; }
|
|
main { flex: 1; min-height: 0; display: flex; }
|
|
.view { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
|
|
.view[hidden] { display: none; }
|
|
.muted { color: var(--st-ink-muted); }
|
|
.small { font-size: var(--st-fs-xs); }
|
|
.card-title { font-weight: var(--st-fw-bold); font-size: var(--st-fs-base); color: var(--st-ink); }
|
|
.st-header { position: relative; z-index: 2; flex: none; }
|
|
.st-header .st-tabs { margin-left: var(--st-s-4); }
|
|
#unload-btn { flex: none; height: 32px; padding: 0 12px; min-width: 7.75rem; }
|
|
.st-header--clip #pill-text { display: none; }
|
|
#drawer-close .st-icon { transform: rotate(-90deg); }
|
|
|
|
/* ---------------------------------------------------------------- chat */
|
|
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; }
|
|
.chat { max-width: min(100%, 1100px); margin: 0 auto; padding: var(--st-s-8) var(--st-s-6) var(--st-s-6); display: flex;
|
|
flex-direction: column; gap: var(--st-s-6); }
|
|
.chat-empty { margin: 12vh auto 0; text-align: center; }
|
|
.chat-empty__title { font-weight: var(--st-fw-black); font-size: var(--st-fs-display); line-height: var(--st-lh-tight);
|
|
letter-spacing: -.02em; }
|
|
.chat-empty__sub { overflow-wrap: anywhere; margin-top: var(--st-s-3); color: var(--st-ink-muted); }
|
|
.st-msg { width: 100%; }
|
|
.st-msg--assistant { align-self: flex-start; }
|
|
.st-msg--assistant .st-bubble { width: 100%; overflow-wrap: anywhere; }
|
|
.st-msg--user .st-bubble { white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
.st-bubble > :first-child { margin-top: 0; }
|
|
.st-bubble > :last-child { margin-bottom: 0; }
|
|
.st-bubble p, .st-bubble ul, .st-bubble ol { margin: 0 0 var(--st-s-3); }
|
|
.st-bubble ul, .st-bubble ol { padding-left: var(--st-s-6); }
|
|
.st-bubble li + li { margin-top: var(--st-s-1); }
|
|
.st-bubble h3 { font-size: var(--st-fs-lg); margin: var(--st-s-4) 0 var(--st-s-2); color: var(--st-ink); }
|
|
.st-bubble h4 { font-size: var(--st-fs-base); margin: var(--st-s-3) 0 var(--st-s-2); color: var(--st-ink); }
|
|
.st-bubble code.inline { font: 400 .9em var(--st-font-mono); background: var(--st-surface-2); border: 1px solid var(--st-line-soft);
|
|
border-radius: 6px; padding: 1px 5px; }
|
|
.st-bubble .st-code { margin: var(--st-s-3) 0; }
|
|
.st-bubble blockquote { margin: 0 0 var(--st-s-3); padding-left: var(--st-s-3); border-left: 3px solid var(--st-line);
|
|
color: var(--st-ink-muted); }
|
|
.st-bubble hr { border: 0; border-top: 1px solid var(--st-line); margin: var(--st-s-4) 0; }
|
|
.st-bubble table { border-collapse: collapse; margin: 0 0 var(--st-s-3); font-size: var(--st-fs-md); display: block; max-width: 100%; overflow-x: auto; }
|
|
.st-bubble th, .st-bubble td { border: 1px solid var(--st-line); padding: 6px 10px; text-align: left; }
|
|
.msg-images { display: flex; flex-wrap: wrap; gap: var(--st-s-2); justify-content: flex-end; }
|
|
.msg-images img { max-width: 220px; max-height: 180px; border-radius: var(--st-r-md); border: 1px solid var(--st-line); }
|
|
.st-msg .st-collapse { width: 100%; }
|
|
.st-collapse__body.thinking { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }
|
|
.st-msg { min-width: 0; }
|
|
.st-msg__meta .st-btn--icon { width: 28px; height: 28px; }
|
|
.st-msg__meta .st-btn--icon .st-icon { width: 16px; height: 16px; }
|
|
.cursor::after { content: ""; display: inline-block; width: 8px; height: 1.1em; margin-left: 2px; vertical-align: -3px;
|
|
border-radius: 2px; background: var(--st-accent); animation: blink 1s steps(2) infinite; }
|
|
@keyframes blink { 50% { opacity: 0; } }
|
|
.msg-error { color: var(--st-danger-text); background: var(--st-danger-tint); border-radius: var(--st-r-md); padding: 10px 14px;
|
|
font-size: var(--st-fs-md); }
|
|
/* MCP tool calls inside an answer: one compact collapsible block per call */
|
|
.st-bubble .tool-call { margin: var(--st-s-3) 0; }
|
|
.tool-call > summary { min-width: 0; padding: 8px 12px; overflow: hidden; }
|
|
.tool-call__name { font: 500 var(--st-fs-sm)/1.2 var(--st-font-mono); color: var(--st-ink); white-space: nowrap;
|
|
min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
.tool-call__preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--st-fs-xs); }
|
|
.tool-call .st-badge, .tool-call summary .small { flex: none; }
|
|
.tool-call[data-state="error"] { border-color: color-mix(in srgb, var(--st-danger) 35%, var(--st-line)); }
|
|
.tool-call[data-state="running"] .st-badge::before, .tool-call[data-state="writing"] .st-badge::before { animation: blink 1s steps(2) infinite; }
|
|
.tool-call__label { font-size: var(--st-fs-xs); font-weight: var(--st-fw-medium); color: var(--st-ink-muted); margin: var(--st-s-2) 0 var(--st-s-1); }
|
|
.tool-call__pre { margin: 0; padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
|
|
font: 400 12.5px/1.5 var(--st-font-mono); color: var(--st-ink-soft); background: var(--st-surface);
|
|
border: 1px solid var(--st-line-soft); border-radius: var(--st-r-sm); }
|
|
|
|
.composer-wrap { flex: none; padding: 0 var(--st-s-6) var(--st-s-6); }
|
|
.st-composer { max-width: min(100%, 1100px); margin: 0 auto; }
|
|
.st-composer textarea { max-height: 40vh; }
|
|
.st-btn--send { width: 42px; padding: 0; }
|
|
.composer-hint { font-size: var(--st-fs-xs); color: var(--st-ink-muted); margin-right: var(--st-s-2); font-variant-numeric: tabular-nums; }
|
|
.attachments { display: flex; flex-wrap: wrap; gap: var(--st-s-2); padding: 2px 4px 0; }
|
|
.st-composer.dragging { outline: 2px dashed var(--st-accent); outline-offset: 3px; }
|
|
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border-radius: var(--st-r-pill);
|
|
background: var(--st-surface-2); border: 1px solid var(--st-line); font-size: var(--st-fs-xs); color: var(--st-ink-soft); }
|
|
.chip .st-btn--icon { width: 22px; height: 22px; border-radius: 50%; }
|
|
.chip .st-btn--icon .st-icon { width: 14px; height: 14px; }
|
|
|
|
/* ---------------------------------------------------------------- monitor */
|
|
.view--monitor, .view--about { overflow-y: auto; }
|
|
.monitor, .about { max-width: min(100%, 1920px); width: 100%; margin: 0 auto; padding: var(--st-s-6); display: flex; flex-direction: column;
|
|
gap: var(--st-s-5); }
|
|
.state-card { display: flex; flex-direction: column; gap: var(--st-s-3); }
|
|
.state-card__head { display: flex; align-items: center; gap: var(--st-s-4); flex-wrap: wrap; }
|
|
.state-card, .metric-card, .req-card, .ctx-card, .cc-card, .mcp-card { min-width: 0; }
|
|
.badges { display: flex; gap: var(--st-s-2); flex-wrap: wrap; }
|
|
.badges .st-badge { opacity: .38; transition: opacity var(--st-dur); }
|
|
.badges .st-badge.on { opacity: 1; }
|
|
.state-card__row { display: flex; justify-content: space-between; gap: var(--st-s-4); font-size: var(--st-fs-sm);
|
|
font-weight: var(--st-fw-medium); font-variant-numeric: tabular-nums; }
|
|
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--st-s-4); }
|
|
.metric-card { padding: var(--st-s-4) var(--st-s-5); }
|
|
.st-metric__value small { font-size: var(--st-fs-md); font-weight: var(--st-fw-medium); color: var(--st-ink-muted); margin-left: 4px; }
|
|
.st-metric__sub { font-size: var(--st-fs-xs); color: var(--st-ink-muted); font-variant-numeric: tabular-nums; min-height: 1em; }
|
|
.st-metric__spark { display: block; overflow: visible; }
|
|
.speed-values { display: flex; justify-content: space-between; gap: var(--st-s-3); }
|
|
.speed-values > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
|
|
.speed-values > div:last-child { text-align: right; }
|
|
.speed-values .st-metric__value { font-size: clamp(20px, 2.2vw, var(--st-fs-stat)); }
|
|
.st-metric__spark .speed-prefill { color: color-mix(in srgb, var(--st-accent) 65%, black); }
|
|
.st-metric__spark[data-tone="warn"] { color: var(--st-warn); }
|
|
.st-metric__spark[data-tone="info"] { color: var(--st-info); }
|
|
.monitor-row { display: grid; grid-template-columns: minmax(min(260px, 100%), 1fr) minmax(0, 2.4fr); gap: var(--st-s-4); }
|
|
.ctx-card { display: flex; flex-direction: column; gap: var(--st-s-2); }
|
|
.ctx-gauge { position: relative; width: 150px; max-width: 100%; aspect-ratio: 1; height: auto; margin: var(--st-s-2) auto var(--st-s-3); }
|
|
.ctx-gauge .st-gauge { width: 100%; height: 100%; }
|
|
.ctx-gauge .st-gauge__fill { transition: stroke-dasharray 400ms var(--st-ease); }
|
|
.ctx-gauge__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
font-size: var(--st-fs-xs); }
|
|
.ctx-gauge__pct { font-weight: var(--st-fw-black); font-size: var(--st-fs-xl); line-height: 1.1; font-variant-numeric: tabular-nums; }
|
|
.bar-row { display: flex; justify-content: space-between; font-size: var(--st-fs-sm); font-weight: var(--st-fw-medium);
|
|
margin-top: var(--st-s-2); font-variant-numeric: tabular-nums; }
|
|
.req-card { display: flex; flex-direction: column; gap: var(--st-s-3); min-width: 0; }
|
|
.table-wrap { overflow-x: auto; }
|
|
/* Recent requests: keep headings, values and status badges on one line. */
|
|
#req-wrap .st-table th,
|
|
#req-wrap .st-table td {
|
|
white-space: nowrap;
|
|
padding-inline: 8px;
|
|
}
|
|
.req-head { display: flex; align-items: center; justify-content: space-between; gap: var(--st-s-2); }
|
|
.table-wrap.all { max-height: 420px; overflow-y: auto; }
|
|
.req-totals { margin: 0; font-size: var(--st-fs-sm); }
|
|
.req-totals:empty { display: none; }
|
|
.cc-card { display: flex; flex-direction: column; gap: var(--st-s-3); }
|
|
.cc-bars { display: grid; grid-template-columns: 1fr 1fr; gap: var(--st-s-2) var(--st-s-6); }
|
|
.cc-bars[hidden] { display: none; }
|
|
.cc-note { margin: 0; }
|
|
.cc-note:empty { display: none; }
|
|
.mcp-card { display: flex; flex-direction: column; gap: var(--st-s-3); }
|
|
.cfg-form { display: grid; grid-template-columns: minmax(min(180px, 100%), max-content) minmax(0, 1fr); gap: var(--st-s-3) var(--st-s-4);
|
|
align-items: center; }
|
|
.cfg-form label { overflow-wrap: anywhere; font-size: var(--st-fs-sm); font-weight: var(--st-fw-medium); }
|
|
.cfg-form label code { font: 400 12px var(--st-font-mono); color: var(--st-ink-muted); display: block; }
|
|
.cfg-form .st-input { height: 38px; width: 100%; max-width: 360px; min-width: 0; }
|
|
.cfg-actions { display: flex; align-items: center; gap: var(--st-s-3); }
|
|
.mcp-server { display: flex; flex-direction: column; gap: var(--st-s-2); padding-top: var(--st-s-3); border-top: 1px solid var(--st-line-soft); }
|
|
.mcp-server:first-child { padding-top: 0; border-top: 0; }
|
|
.mcp-server__head { display: flex; align-items: center; gap: var(--st-s-2); flex-wrap: wrap; font-size: var(--st-fs-sm); }
|
|
.mcp-server__tools { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
.mcp-server__tools .chip { height: 26px; padding: 0 10px; font-family: var(--st-font-mono); }
|
|
.mcp-note { margin: 0; }
|
|
|
|
/* ---------------------------------------------------------------- about */
|
|
.about { max-width: min(100%, 1100px); }
|
|
.about .st-card { display: flex; flex-direction: column; gap: var(--st-s-3); }
|
|
.about p { margin: 0; }
|
|
.facts { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 10px var(--st-s-6); margin: 0; font-size: var(--st-fs-md); }
|
|
.facts dt { color: var(--st-ink-muted); }
|
|
.facts dd { margin: 0; color: var(--st-ink-soft); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px;
|
|
overflow-wrap: anywhere; }
|
|
.facts dd code { font: 400 13px var(--st-font-mono); }
|
|
.facts .st-btn--icon { width: 28px; height: 28px; }
|
|
.facts .st-btn--icon .st-icon { width: 16px; height: 16px; }
|
|
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--st-s-4); font-size: var(--st-fs-sm);
|
|
font-weight: var(--st-fw-medium); color: var(--st-ink-soft); }
|
|
.toggle-row .st-toggle { flex: none; } /* a long label must not squeeze the switch */
|
|
|
|
/* ---------------------------------------------------------------- drawer */
|
|
.st-drawer { z-index: 40; }
|
|
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .18); z-index: 39; }
|
|
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: var(--st-surface-2);
|
|
border: 1px solid var(--st-line); border-radius: var(--st-r-md); }
|
|
.seg button { height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--st-ink-muted);
|
|
font: 500 var(--st-fs-sm)/1 var(--st-font); cursor: pointer; }
|
|
.seg button[aria-checked="true"] { background: var(--st-surface); color: var(--st-ink); font-weight: var(--st-fw-bold);
|
|
box-shadow: var(--st-sh-card); }
|
|
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--st-s-3); margin-top: var(--st-s-2); }
|
|
.st-toast { animation: toast-in 180ms var(--st-ease); }
|
|
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
|
|
|
|
/* ---------------------------------------------------------------- narrow screens */
|
|
@media (max-width: 1000px) {
|
|
.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
.cc-bars { grid-template-columns: 1fr; }
|
|
.cfg-form { grid-template-columns: 1fr; gap: 4px; }
|
|
.cfg-form .st-input { margin-bottom: var(--st-s-2); }
|
|
}
|
|
@media (max-width: 900px) {
|
|
.monitor-row { grid-template-columns: minmax(0, 1fr); }
|
|
}
|
|
/* The tab strip keeps a width it can scroll. The pill's text hides only when the header row overflows (fitHeader in app.js).
|
|
Load / Unload (PR #3550) sits in the row: 9rem of tabs plus its 7.75rem fit from 458px; below that the tighter floors keep
|
|
it and the theme button in the viewport. */
|
|
@media (max-width: 955px) {
|
|
.st-header { padding: 0 var(--st-s-3); gap: var(--st-s-2); }
|
|
.st-header__brand, #theme-btn, #pill, #unload-btn { flex: none; }
|
|
.st-header .st-tabs { margin-left: 0; flex: 1 1 auto; min-width: 9rem; overflow-x: auto; }
|
|
.st-tab { padding: 0 10px; }
|
|
.st-tab .st-icon { display: none; }
|
|
}
|
|
@media (max-width: 457px) {
|
|
#unload-btn { min-width: 0; padding: 0 8px; }
|
|
.st-header .st-tabs { min-width: 5.5rem; }
|
|
}
|
|
/* the name plus "Unloading…" still overflows at 374px in Firefox 158 */
|
|
@media (max-width: 382px) {
|
|
.st-header__brand { display: none; }
|
|
.st-header .st-tabs { min-width: 4.75rem; }
|
|
}
|
|
@media (max-width: 640px) {
|
|
.chat { padding: var(--st-s-5) var(--st-s-4); }
|
|
.composer-wrap { padding: 0 var(--st-s-3) var(--st-s-3); }
|
|
.monitor, .about { padding: var(--st-s-4); }
|
|
.facts { grid-template-columns: 1fr; gap: 2px; }
|
|
.facts dd { margin-bottom: var(--st-s-2); }
|
|
.cfg-form .st-input { max-width: none; }
|
|
.st-btn, .st-input, .seg button, .st-tab { min-height: 40px; }
|
|
.st-btn--icon, .st-composer__bar .st-btn--icon { width: 40px; height: 40px; }
|
|
.st-btn--send { width: 44px; }
|
|
.st-msg__meta .st-btn--icon, .facts .st-btn--icon { width: 40px; height: 40px; }
|
|
.st-composer__bar { flex-wrap: wrap; }
|
|
.tool-call__pre, .st-code pre, .table-wrap { max-width: 100%; }
|
|
}
|
|
@media (max-width: 560px) {
|
|
.metrics { grid-template-columns: minmax(0, 1fr); }
|
|
}
|
|
@media (max-width: 480px) {
|
|
.st-header { padding: 0 var(--st-s-2); gap: 6px; }
|
|
.st-header__brand { font-size: var(--st-fs-md); }
|
|
.st-tabs { gap: 2px; padding: 3px; }
|
|
.st-tab { padding: 0 8px; }
|
|
.composer-hint { display: none; }
|
|
.chat { padding: var(--st-s-4) var(--st-s-3); }
|
|
.monitor, .about { padding: var(--st-s-3); }
|
|
.st-bubble { padding: 10px 12px; }
|
|
}
|
|
/* Images tab (POST /v1/images/generations) */
|
|
.img-form{display:flex;flex-direction:column;gap:12px}
|
|
.img-prompt{height:auto;padding:10px 14px;resize:vertical}
|
|
.img-row{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
|
|
.img-results{display:flex;flex-direction:column;gap:12px}
|
|
.img-results figure{margin:0}
|
|
.img-results img{max-width:100%;border-radius:var(--st-r-lg);display:block}
|
|
.img-results figcaption{font-size:var(--st-fs-sm, 13px);color:var(--st-ink-2, inherit);margin-top:4px}
|
|
|
|
/* Math (serve/web/math.js): a formula never widens the chat; a long display formula scrolls inside its own box. */
|
|
.chat-math { overflow-wrap: normal; }
|
|
.chat-math--display { display: block; text-align: center; overflow-x: auto; max-width: 100%; margin: .6em 0; padding: .25em 0; }
|
|
.chat-math--display > * { margin: 0 !important; }
|
|
.chat-math[data-math-error] { white-space: pre-wrap; }
|
|
.chat-math .katex { font-size: 1.08em; }
|
|
|
|
/* svg/html preview (serve/web/preview.js): the frame is sandboxed and carries the page's colours, so it is transparent on the
|
|
theme's surface; the code and the preview swap places inside the same box. */
|
|
.st-code__btns { display: flex; gap: 4px; }
|
|
.st-code .st-btn--icon[aria-pressed="true"] { background: rgba(255, 255, 255, .12); color: #fff; }
|
|
.st-code__preview { display: none; }
|
|
.st-code[data-preview="true"] > pre { display: none; }
|
|
.st-code[data-preview="true"] .st-code__preview { display: block; height: min(340px, 60vh); background: var(--st-surface-2); }
|
|
.st-code [data-preview-scripts] { display: none; }
|
|
.st-code[data-preview="true"] [data-preview-scripts] { display: inline-flex; }
|
|
.st-code .st-btn--icon[data-preview-scripts][aria-pressed="true"] { background: var(--st-warn-tint); color: var(--st-warn-text); }
|
|
.st-code--run .st-code__preview { outline: 2px solid var(--st-warn-text); outline-offset: -2px; }
|
|
.st-code__preview iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; }
|