okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
2b36e8a02
main
05 · Serving
Route #/serving · File src/screens/Serving.tsx (329 lines)
The screen for people wiring Strata into something else. It is the most "developer" surface in the app, which makes it the one most likely to be skimmed by someone who does not read API documentation for fun.
What it is today
- Local API card — base URL, OpenAI-compatible and Anthropic-compatible endpoint chips, a copy button, the model id, and a "Serving · bind locally" pill.
- Access card — toggles for other devices and network access, an API key row with reveal/copy, and a plain-language reassurance line.
- Requests table — time, client, endpoint, tokens in/out, duration, state. A row opens a detail drawer.
- Metrics — running, waiting, and a few counters.
- Empty state for a fresh install.
Where it falls short
The endpoints are shown as chips, not as usable snippets.Fixed. The endpoint rows printed a path fragment in muted mono with no way to take it, so wiring a client meant reading/chat/completionsoff the screen and typing the host yourself. Each row now carries its full URL and its own copy button. (A base-URL copy button did already exist — the plan over-claimed there.)No example request.Fixed. Acurlblock, switched between OpenAI and Anthropic formats, with a copy button. Verified by running the copied command against the host: it returns real SSE completion chunks, and the JSON body parses.- Security state is ambiguous. "Other devices" and "network access" toggles exist beside an API key, but nothing states plainly whether the server is reachable from outside this machine, which is the actual question.
- The requests table has no filtering or sorting. A hundred rows, no way to find the failed one — despite the state column having a colour.
- Failures are indistinguishable from successes at a glance. The state pill is the only signal, and it is small.
- The detail drawer is a dead end. It shows a request's facts and offers Cancel; it does not offer "copy as curl", which is what you want when debugging a call the model answered badly.
- The table does not say when it is empty because nothing has been asked vs when it is filtered to nothing.
The plan
Substance — make it pasteable
- Replace the endpoint chips with a copyable base URL block and a one-line example request beneath it, switched by a small OpenAI / Anthropic segmented control. One block, one copy button, no assembly.
- Add "Connect a client" with two or three concrete recipes — an editor, a CLI, a script — each copyable. This is the screen's real job.
- State the exposure plainly:
Only this computer can reach itorAnyone on your network can reach it, as a sentence with a status dot, above the toggles rather than implied by them. - Make the API key state visible at rest — present / not set — rather than requiring the reveal toggle to find out.
Hierarchy
- Order by intent, not by implementation: Connect to it → Who can reach it → What it has been doing. Today the layout is API, access, table, which is close but reads as three equal cards.
Fluidity
- Filter and sort the request table, with the state column as a filter rather than only a colour. Failed-only is the view people actually want.
- Row state gets an icon as well as a colour, so it survives greyscale.
- The detail drawer gains "Copy as cURL" and the full request/response payload, collapsed.
Motion
| Interaction | Spec |
|---|---|
| Endpoint protocol switch | Panel cross-fade only, --st-t-control; never both visible |
| Copy confirmation | Check icon swap + a toast; the button does not move |
| Request row → drawer | Existing drawer slide, --st-t-local; no shared-element morph — the sheet's own transform owns the motion |
| New row arriving | st-enter, --st-t-local, 6 px, capped at the newest 6 rows |
Verification
- Shipped and verified: every endpoint row copies a full URL, the request
block copies a
curlthat executes, and the Anthropic format differs from the OpenAI one (max_tokens,/messages). - Assert the exposure sentence matches the toggle state in all four combinations.
- Assert request rows expose state as both icon and colour.
flow serving: toggle each access switch, filter to failures, open a drawer.
1# 05 · Serving 2 3**Route** `#/serving` · **File** `src/screens/Serving.tsx` (329 lines) 4 5The screen for people wiring Strata into something else. It is the most 6"developer" surface in the app, which makes it the one most likely to be skimmed 7by someone who does not read API documentation for fun. 8 9## What it is today 10 11- **Local API card** — base URL, OpenAI-compatible and Anthropic-compatible 12endpoint chips, a copy button, the model id, and a "Serving · bind locally" 13 pill. 14 - **Access card** — toggles for other devices and network access, an API key row 15with reveal/copy, and a plain-language reassurance line. 16 - **Requests table** — time, client, endpoint, tokens in/out, duration, state. 17A row opens a detail drawer. 18 - **Metrics** — running, waiting, and a few counters. 19- **Empty state** for a fresh install. 20 21## Where it falls short 22 231. ~~The endpoints are shown as chips, not as usable snippets.~~ **Fixed.** The 24endpoint rows printed a *path fragment* in muted mono with no way to take it, 25so wiring a client meant reading `/chat/completions` off the screen and typing 26the host yourself. Each row now carries its full URL and its own copy button. 27(A base-URL copy button did already exist — the plan over-claimed there.) 282. ~~No example request.~~ **Fixed.** A `curl` block, switched between OpenAI and 29Anthropic formats, with a copy button. Verified by *running* the copied 30command against the host: it returns real SSE completion chunks, and the JSON 31body parses. 323. **Security state is ambiguous.** "Other devices" and "network access" toggles 33exist beside an API key, but nothing states plainly whether the server is 34reachable from outside this machine, which is the actual question. 354. **The requests table has no filtering or sorting.** A hundred rows, no way to 36find the failed one — despite the state column having a colour. 375. **Failures are indistinguishable from successes at a glance.** The state pill 38is the only signal, and it is small. 396. **The detail drawer is a dead end.** It shows a request's facts and offers 40Cancel; it does not offer "copy as curl", which is what you want when 41debugging a call the model answered badly. 427. **The table does not say when it is empty because nothing has been asked** vs 43when it is filtered to nothing. 44 45## The plan 46 47### Substance — make it pasteable 481. **Replace the endpoint chips with a copyable base URL block** and a 49one-line example request beneath it, switched by a small OpenAI / 50Anthropic segmented control. One block, one copy button, no assembly. 512. **Add "Connect a client" with two or three concrete recipes** — an editor, 52a CLI, a script — each copyable. This is the screen's real job. 533. **State the exposure plainly**: `Only this computer can reach it` or 54`Anyone on your network can reach it`, as a sentence with a status dot, above 55the toggles rather than implied by them. 564. **Make the API key state visible at rest** — present / not set — rather than 57requiring the reveal toggle to find out. 58 59### Hierarchy 605. **Order by intent, not by implementation**: *Connect to it* → *Who can reach 61it* → *What it has been doing*. Today the layout is API, access, table, which 62is close but reads as three equal cards. 63 64### Fluidity 656. **Filter and sort the request table**, with the state column as a filter 66rather than only a colour. Failed-only is the view people actually want. 677. **Row state gets an icon as well as a colour**, so it survives greyscale. 688. **The detail drawer gains "Copy as cURL"** and the full request/response 69payload, collapsed. 70 71## Motion 72 73| Interaction | Spec | 74|---|---| 75| Endpoint protocol switch | Panel cross-fade only, `--st-t-control`; never both visible | 76| Copy confirmation | Check icon swap + a toast; the button does not move | 77| Request row → drawer | Existing drawer slide, `--st-t-local`; no shared-element morph — the sheet's own transform owns the motion | 78| New row arriving | `st-enter`, `--st-t-local`, 6 px, capped at the newest 6 rows | 79 80## Verification 81 82- **Shipped and verified**: every endpoint row copies a full URL, the request 83block copies a `curl` that executes, and the Anthropic format differs from the 84OpenAI one (`max_tokens`, `/messages`). 85- Assert the exposure sentence matches the toggle state in all four combinations. 86- Assert request rows expose state as both icon and colour. 87- `flow serving`: toggle each access switch, filter to failures, open a drawer.