mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 08:12:52 +00:00
Rebuild the Coach thinking row as one calm line
While a turn runs the Coach now shows a single row: a brain icon, the current step in the answer's text size with a shimmer passing through it and fading dots, and a chevron once there are steps to open. There is no running clock any more, and the interim table preview with its sparkline no longer renders under the row; interim tables stay in state until the answer's own results show them. When the answer is done the row reads "Thought process · N steps" with proper plurals, and "Answer needed" while a clarifying question waits. It never opens by itself, and a row opened during the run closes when the turn ends. Opened, the steps form a vertical list with an icon per kind of work on a thin connector line, and a reasoning round shows its summary under its title. The shimmer and the dots are a `text-shimmer` utility and a reusable WaitingText component, both still under reduced motion. The demo's write block now carries `meta.errorCode: "demo.readOnly"`, listed in the error-code catalogue, and the Coach answers it with an honest line instead of the provider-outage copy. Removes the interim preview component, the elapsed-seconds and summary helpers, and their message keys in all seven locales.
This commit is contained in:
1 parent
3df5754ab1
commit
dd72634791
32 files changed
+1069
-1312
No files matched your search
@@ -159,6 +159,18 @@ describe("proxy.ts DEMO_MODE mutation allowlist", () => {
|
||||
expect(res.status).toBe(403);
|
||||
});
|
||||
|
||||
it("refuses the Coach chat with a code a client can name", async () => {
|
||||
// The chat POST is not on the allowlist. The refusal carries a stable
|
||||
// code, so the Coach says "not in the demo" instead of reading the 403
|
||||
// as a provider outage.
|
||||
const res = proxy(makeRequest("/api/insights/chat", "POST"));
|
||||
expect(res.status).toBe(403);
|
||||
const body = (await res.json()) as {
|
||||
meta?: { demo?: boolean; errorCode?: string };
|
||||
};
|
||||
expect(body.meta).toEqual({ demo: true, errorCode: "demo.readOnly" });
|
||||
});
|
||||
|
||||
it("does not drag in the layout-reset DELETE on the allowlisted widgets path", () => {
|
||||
// The allowlist pins method per path; admitting the widgets PUT
|
||||
// must not open DELETE (which wipes the user's dashboard layout).
|
||||
|
||||
Reference in new issue
Block a user