Merge main into settings-ux
Main now carries conn-row-polish. Together the two put internal/equipo at 15577 source lines, over its 15550 exemption: raised to 15650 with the reason in .rastrillo/budgets.txt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 files changed,
+268
−45
.rastrillo/budgets.txt+1 −1docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+14 −3internal/equipo/chat_connections.go+42 −4internal/equipo/connections_view.go+56 −24internal/equipo/connections_view_test.go+90 −3internal/equipo/copy.go+14 −3internal/equipo/static/connections.js+19 −0internal/equipo/static/equipo.css+29 −4internal/equipo/templates/models.html+3 −3
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index a3800631..6f124914 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -14,7 +14,7 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr |
| time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI. |
| time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage. |
| -size internal/equipo 15550 - The Connections Add page and four display fixes add the Add page handler, account naming, stale meter filtering and the resting row's destination (connections_view.go, chat_connections.go, about 120 lines); measured 15467. Claude setup tokens add the token card, sealing route and Check again beside the composer and Mac lines; measured 15350. Settings in sections adds the section pages, the secondary menu and the old URLs' redirects (settings_hub.go, about 110 lines, less the removed Thinking words page); measured 14922. Mac runners (Darwin worker) add the one-tap enrolment link, the runners view's self-probes, /install.sh, the outside-the-sandbox label and their copy (about 90 lines); measured 15058. Mac runners add the runner role, the protocol route and the placement minute, then two-phase removal, Remove now and Recover (about 110 lines). Housekeeping slice 1 adds the Housekeeping view beside the Notebook, the digest line and their copy (housekeeping_page.go, about 170 lines); measured 14513. Thin v1 UX1 thinking words adds the settings page and the set registry wiring (thinking_words.go) and 55 strings of phrases; measured 14411. The Connections page to Paul's approved mockup (connections_view.go: what is answering, the preference, rows with headroom, roles, usage and the recovery action, about 300 lines); measured 14268. Merged with UX1 round 3 (duplicate combining with Undo, timeline headlines) beside the Connections page; measured 13895. Connections slice 1 adds the Connections page, the switched line and the no_connection card and their copy (chat_connections.go, about 220 lines). Measured 12269. Thin v1 UX1 adds the inner screens' view model (work_views.go: stage track, badges, timeline, decisions, project facts, about 830 lines), the rich page handlers and their copy (about 170 lines); measured 13263. Thin v1 slice 4c adds the merged line, the merge card and its copy (about 60 lines). Thin v1 slice 4 adds the thin sidebar (rail.go), review and checks lines on the task card and pages, and their copy (about 190 lines). Thin v1 slice 3 adds the task card, the thin Tasks and Projects pages and their actions over the chat store, and their copy (about 280 lines). Thin v1 slice 2 adds activity labels, card copy and card rendering on the chat page (about 250 lines); slice 1 added the chat wiring and page (about 180 lines) beside code its slice 7 sweep deletes (the live hub, the old coordinator); lower then. Task 7 keeps the existing ceiling by moving transaction-bound event lookup into conversation. Measured 10796 source and 437 test lines; roster, database, pending copy and execution wiring remain here. |
| +size internal/equipo 15650 - Connection resets as a countdown (inText and its words, about 60 lines) and the Settings page pattern (settings_hub.go, team_links.go, about 30 lines) together; measured 15577 with both merged. The Connections Add page and four display fixes add the Add page handler, account naming, stale meter filtering and the resting row's destination (connections_view.go, chat_connections.go, about 120 lines); measured 15467. Claude setup tokens add the token card, sealing route and Check again beside the composer and Mac lines; measured 15350. Settings in sections adds the section pages, the secondary menu and the old URLs' redirects (settings_hub.go, about 110 lines, less the removed Thinking words page); measured 14922. Mac runners (Darwin worker) add the one-tap enrolment link, the runners view's self-probes, /install.sh, the outside-the-sandbox label and their copy (about 90 lines); measured 15058. Mac runners add the runner role, the protocol route and the placement minute, then two-phase removal, Remove now and Recover (about 110 lines). Housekeeping slice 1 adds the Housekeeping view beside the Notebook, the digest line and their copy (housekeeping_page.go, about 170 lines); measured 14513. Thin v1 UX1 thinking words adds the settings page and the set registry wiring (thinking_words.go) and 55 strings of phrases; measured 14411. The Connections page to Paul's approved mockup (connections_view.go: what is answering, the preference, rows with headroom, roles, usage and the recovery action, about 300 lines); measured 14268. Merged with UX1 round 3 (duplicate combining with Undo, timeline headlines) beside the Connections page; measured 13895. Connections slice 1 adds the Connections page, the switched line and the no_connection card and their copy (chat_connections.go, about 220 lines). Measured 12269. Thin v1 UX1 adds the inner screens' view model (work_views.go: stage track, badges, timeline, decisions, project facts, about 830 lines), the rich page handlers and their copy (about 170 lines); measured 13263. Thin v1 slice 4c adds the merged line, the merge card and its copy (about 60 lines). Thin v1 slice 4 adds the thin sidebar (rail.go), review and checks lines on the task card and pages, and their copy (about 190 lines). Thin v1 slice 3 adds the task card, the thin Tasks and Projects pages and their actions over the chat store, and their copy (about 280 lines). Thin v1 slice 2 adds activity labels, card copy and card rendering on the chat page (about 250 lines); slice 1 added the chat wiring and page (about 180 lines) beside code its slice 7 sweep deletes (the live hub, the old coordinator); lower then. Task 7 keeps the existing ceiling by moving transaction-bound event lookup into conversation. Measured 10796 source and 437 test lines; roster, database, pending copy and execution wiring remain here. |
| size internal/equipotest - 13400 Task 21 repairs historical migration and conversation fixtures after Plan 3. Measured 13024 test lines; the 300s time ceiling is unchanged. |
| time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded); 60s gives 34 percent headroom. Shared baseline capture reduces repeated Go runs; retain the CI allowance for sandbox sentinels, timeout and child cleanup. 2026-11-07: loaded CI (host load about 24) measured 66.5s with the package unchanged by thin v1 slice 4 beyond optional check mounts; 90s keeps 35 percent headroom. |
| time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). Parallel plan graphs and removal of repeated progress floods reduced their local targeted run from 146.920s to 30.784s; the original bug graph retains volume coverage. Keep 330s for journal, proxy, recovery and namespace integration, with 13 percent headroom. |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index 597b2c8f..05010eb3 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -5134,7 +5134,8 @@ records remain unchanged. |
| | `chat.connections.cancel` | Cancel | Connections slice 1 (Connections page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.healthy` | Ready | Connections slice 1 (Connections page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.limited` | Limited, no reset time reported | Connections slice 1 (Connections page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| -| `chat.connections.limited_until` | Limited until %s | Connections slice 1 (Connections page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.limited_now` | Limited | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.limited_resets_in` | Limited, resets in %s | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.signed_out` | Signed out | Connections slice 1 (Connections page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.sign_in_again` | Needs signing in again | Connections slice 1 (Connections page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.error` | Not working | Connections slice 1 (Connections page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| @@ -5250,7 +5251,10 @@ records remain unchanged. |
| | `chat.connections.answering.on` | Your coordinator is on %s. | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.answering.while` | while %s. | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.answering.rests` | %s rests | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| -| `chat.connections.answering.rests_until` | %s rests until %s | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.answering.back_in` | %s is back in %s | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.answering.then` | . %s. | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.answering.resets_in` | %s resets in %s | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.answering.resets_at` | %s resets %s | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.and` | and | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.answering.too` | Engineering and Review are on %s too. | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.answering.stays` | Work stays where it is until the next message or step, then Equipo picks the healthiest connection with headroom. | Connections page fixes (Paul, 2026-11-10: name the account, say what Automatic does) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| @@ -5284,7 +5288,14 @@ records remain unchanged. |
| | `chat.connections.window_hours` | %d h window | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.window_week` | Week | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.window_used` | Used | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| -| `chat.connections.resets` | resets %s | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.resets_in` | resets in %s | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.in.day` | %d day | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.in.days` | %d days | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.in.hour` | %d hour | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.in.hours` | %d hours | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.in.minute` | %d minute | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.in.minutes` | %d minutes | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `chat.connections.in.under_minute` | under a minute | Connections page fixes (Paul, 2026-11-11: "Can we get Resets in Xdays Yhours", the format as he dictated it) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.add` | Add a connection | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.add_hint` | Another account of yours, or a second provider so Review can use a different model family. | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `chat.connections.chooser_lede` | Equipo signs in through the provider's own flow and never sees your password. | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
diff --git a/internal/equipo/chat_connections.go b/internal/equipo/chat_connections.go| index 2e90e5eb..2ef0983f 100644 |
| --- a/internal/equipo/chat_connections.go |
| +++ b/internal/equipo/chat_connections.go |
| @@ -106,16 +106,54 @@ func providerName(p string) string { |
| } |
| // resetText renders a provider's reset time in UTC, the instance's only |
| -// zone until a person's zone is known. |
| +// zone until a person's zone is known. The conversation's lines keep it: |
| +// they are history under old messages. |
| func resetText(t time.Time) string { return t.UTC().Format("Mon 15:04") + " UTC" } |
| -func connectionState(c wire.Connection) string { |
| +// inText is how long until something, in words (Paul, 2026-11-11: |
| +// "Resets in Xdays Yhours"): days and hours from a day, hours and |
| +// minutes under a day, minutes under an hour, then under a minute. A |
| +// part that is zero is left out; what is left of a minute is dropped. |
| +func inText(d time.Duration) string { |
| + if d < time.Minute { |
| + return copyText("chat.connections.in.under_minute") |
| + } |
| + days, hours, minutes := int(d/(24*time.Hour)), int(d/time.Hour)%24, int(d/time.Minute)%60 |
| + var parts []string |
| + part := func(n int, unit string) { |
| + switch { |
| + case n == 1: |
| + parts = append(parts, fmt.Sprintf(copyText("chat.connections.in."+unit), n)) |
| + case n > 1: |
| + parts = append(parts, fmt.Sprintf(copyText("chat.connections.in."+unit+"s"), n)) |
| + } |
| + } |
| + switch { |
| + case days > 0: |
| + part(days, "day") |
| + part(hours, "hour") |
| + case hours > 0: |
| + part(hours, "hour") |
| + part(minutes, "minute") |
| + default: |
| + part(minutes, "minute") |
| + } |
| + return strings.Join(parts, " ") |
| +} |
| + |
| +// connectionState is a held connection's state in words on the |
| +// Connections page. A limited one says when it resets, unless a meter |
| +// beside it already does (metered). |
| +func connectionState(c wire.Connection, now time.Time, metered bool) string { |
| switch c.State { |
| case wire.ConnHealthy: |
| return copyText("chat.connections.healthy") |
| case wire.ConnLimited: |
| - if c.Headroom != nil && c.Headroom.ResetsAt != nil { |
| - return fmt.Sprintf(copyText("chat.connections.limited_until"), resetText(*c.Headroom.ResetsAt)) |
| + switch { |
| + case metered: |
| + return copyText("chat.connections.limited_now") |
| + case c.Headroom != nil && c.Headroom.ResetsAt != nil: |
| + return fmt.Sprintf(copyText("chat.connections.limited_resets_in"), inText(c.Headroom.ResetsAt.Sub(now))) |
| } |
| return copyText("chat.connections.limited") |
| case wire.ConnSignedOut: |
diff --git a/internal/equipo/connections_view.go b/internal/equipo/connections_view.go| index 96492349..0b25307f 100644 |
| --- a/internal/equipo/connections_view.go |
| +++ b/internal/equipo/connections_view.go |
| @@ -23,10 +23,11 @@ type connRow struct { |
| // says when its token expires, Renew asks for a new one near then. |
| Kind, Expires string |
| Renew bool |
| - // State is the wire state; Words says it. |
| - State, Words string |
| - Meters []connMeter |
| - Roles []connRole |
| + // State is the wire state; Words says it, WordsAt the reset it |
| + // counts down to as a time (the hover title). |
| + State, Words, WordsAt string |
| + Meters []connMeter |
| + Roles []connRole |
| // RolesNote stands where no role chip does. |
| RolesNote string |
| // Usage is today's tokens in words, "0" included; UsageTail the words |
| @@ -48,10 +49,11 @@ type connRow struct { |
| New bool |
| } |
| -// connMeter is one provider-reported rate window. |
| +// connMeter is one provider-reported rate window. Resets counts down to |
| +// its reset; At is that reset as a time (the hover title). |
| type connMeter struct { |
| - Name, Level, Resets string |
| - Used int |
| + Name, Level, Resets, At string |
| + Used int |
| } |
| // connRole is one role a connection serves, Live while it runs one now. |
| @@ -65,7 +67,10 @@ type connAnswering struct { |
| Tone string |
| // Lead is LeadStart, LeadName in bold, LeadEnd. |
| LeadStart, LeadName, LeadEnd string |
| - Sub string |
| + // LeadAt names the resets the lead counts down to as times (the |
| + // hover title). |
| + LeadAt string |
| + Sub string |
| // SeeConversation adds the link to the conversation after Sub. |
| SeeConversation bool |
| } |
| @@ -137,19 +142,27 @@ func connectionsPage(snap wire.Snapshot, today map[string]int64, prefer wire.Pre |
| } |
| work := workOn(snap, held, coord) |
| for _, c := range held { |
| - row := connRow{ID: c.ID, Provider: c.Provider, Name: providerName(c.Provider), Glyph: providerGlyph(c.Provider), Label: c.Label, Plan: c.Plan, Kind: c.Kind, State: c.State, Words: connectionState(c), Usage: tokensText(today[c.LocalID]), PreferRevision: prefer.Revision} |
| + row := connRow{ID: c.ID, Provider: c.Provider, Name: providerName(c.Provider), Glyph: providerGlyph(c.Provider), Label: c.Label, Plan: c.Plan, Kind: c.Kind, State: c.State, Usage: tokensText(today[c.LocalID]), PreferRevision: prefer.Revision} |
| _, row.UsageTail, _ = strings.Cut(copyText("chat.connections.usage_today"), "%s") |
| if c.State == wire.ConnError { |
| row.State = wire.ConnSignInAgain |
| } |
| - if c.Kind == wire.KindToken { |
| - tokenFacts(&row, c, now) |
| - } |
| + metered := false |
| if c.Headroom != nil && row.State != wire.ConnSignedOut && row.State != wire.ConnSignInAgain { |
| for _, w := range c.Headroom.Windows { |
| - row.Meters = append(row.Meters, meterOf(w)) |
| + m := meterOf(w, now) |
| + metered = metered || m.Resets != "" |
| + row.Meters = append(row.Meters, m) |
| } |
| } |
| + // The status and a meter do not both say when: the meter does. |
| + row.Words = connectionState(c, now, metered) |
| + if c.State == wire.ConnLimited && !metered && c.Headroom != nil && c.Headroom.ResetsAt != nil { |
| + row.WordsAt = resetText(*c.Headroom.ResetsAt) |
| + } |
| + if c.Kind == wire.KindToken { |
| + tokenFacts(&row, c, now) |
| + } |
| switch row.State { |
| case wire.ConnSignedOut: |
| row.Needs, row.Forget = copyText("chat.connections.connect_again"), true |
| @@ -187,7 +200,7 @@ func connectionsPage(snap wire.Snapshot, today map[string]int64, prefer wire.Pre |
| } |
| v.Rows = append(v.Rows, row) |
| } |
| - v.Answering = answering(held, coord, v.Attempts, names, prefer.Provider) |
| + v.Answering = answering(held, coord, v.Attempts, names, prefer.Provider, now) |
| return v |
| } |
| @@ -264,7 +277,8 @@ func coordinatorOn(snap wire.Snapshot) string { |
| // provider; what happens next is what the choice does, not a promise |
| // (Paul, 2026-11-10): under Automatic work stays put until its next |
| // message or step; with a preference it moves to the preferred one. |
| -func answering(held []wire.Connection, coord string, attempts []modelLine, names connNames, prefer string) connAnswering { |
| +// A rest counts down to its reset from now (Paul, 2026-11-11). |
| +func answering(held []wire.Connection, coord string, attempts []modelLine, names connNames, prefer string, now time.Time) connAnswering { |
| if len(held) == 0 { |
| return connAnswering{} |
| } |
| @@ -279,13 +293,14 @@ func answering(held []wire.Connection, coord string, attempts []modelLine, names |
| } |
| } |
| if on == nil { |
| - var parts []string |
| + var parts, at []string |
| for _, c := range held { |
| name := names.of(c) |
| switch c.State { |
| case wire.ConnLimited: |
| if c.Headroom != nil && c.Headroom.ResetsAt != nil { |
| - parts = append(parts, fmt.Sprintf(copyText("chat.no_connection.resets"), name, resetText(*c.Headroom.ResetsAt))) |
| + parts = append(parts, fmt.Sprintf(copyText("chat.connections.answering.resets_in"), name, inText(c.Headroom.ResetsAt.Sub(now)))) |
| + at = append(at, resetAt(name, *c.Headroom.ResetsAt)) |
| } else { |
| parts = append(parts, fmt.Sprintf(copyText("chat.connections.answering.no_reset"), name)) |
| } |
| @@ -299,26 +314,35 @@ func answering(held []wire.Connection, coord string, attempts []modelLine, names |
| if len(parts) > 0 { |
| why = " " + strings.Join(parts, "; ") + "." |
| } |
| - return connAnswering{Tone: "attention", LeadName: copyText("chat.connections.answering.none"), LeadEnd: why, Sub: copyText("chat.connections.answering.kept"), SeeConversation: true} |
| + return connAnswering{Tone: "attention", LeadName: copyText("chat.connections.answering.none"), LeadEnd: why, LeadAt: strings.Join(at, "; "), Sub: copyText("chat.connections.answering.kept"), SeeConversation: true} |
| } |
| a := connAnswering{} |
| a.LeadStart, a.LeadEnd, _ = strings.Cut(copyText("chat.connections.answering.on"), "%s") |
| a.LeadName = names.of(*on) |
| a.Sub = fmt.Sprintf(copyText("chat.connections.answering.too"), a.LeadName) |
| if len(resting) > 0 { |
| - var rests []string |
| + var rests, at []string |
| for _, c := range resting { |
| name := names.of(c) |
| if c.Provider == on.Provider && names[c.Provider] == 2 { |
| name = fmt.Sprintf(copyText("chat.connections.answering.other"), providerName(c.Provider)) |
| } |
| if c.Headroom != nil && c.Headroom.ResetsAt != nil { |
| - rests = append(rests, fmt.Sprintf(copyText("chat.connections.answering.rests_until"), name, resetText(*c.Headroom.ResetsAt))) |
| + rests = append(rests, fmt.Sprintf(copyText("chat.connections.answering.back_in"), name, inText(c.Headroom.ResetsAt.Sub(now)))) |
| + at = append(at, resetAt(name, *c.Headroom.ResetsAt)) |
| } else { |
| rests = append(rests, fmt.Sprintf(copyText("chat.connections.answering.rests"), name)) |
| } |
| } |
| - a.LeadEnd = fmt.Sprintf(copyText("chat.connections.answering.while"), strings.Join(rests, copyText("chat.connections.and"))) |
| + // "On X while Y rests." With a time it is a sentence of its own: |
| + // "On X. Your other Codex account is back in 22 hours 5 minutes." |
| + said := strings.Join(rests, copyText("chat.connections.and")) |
| + if len(at) == 0 { |
| + a.LeadEnd = fmt.Sprintf(copyText("chat.connections.answering.while"), said) |
| + } else { |
| + a.LeadEnd = fmt.Sprintf(copyText("chat.connections.answering.then"), sentenceCase(said)) |
| + } |
| + a.LeadAt = strings.Join(at, "; ") |
| switch { |
| case prefer == "": |
| a.Sub += " " + copyText("chat.connections.answering.stays") |
| @@ -332,6 +356,12 @@ func answering(held []wire.Connection, coord string, attempts []modelLine, names |
| return a |
| } |
| +// resetAt is a reset as a time, for a hover title: "Codex resets Thu |
| +// 09:36 UTC". |
| +func resetAt(name string, t time.Time) string { |
| + return sentenceCase(fmt.Sprintf(copyText("chat.connections.answering.resets_at"), name, resetText(t))) |
| +} |
| + |
| // connNames counts the person's connections by provider, to name each: |
| // the provider, and the account when there is more than one of it. |
| type connNames map[string]int |
| @@ -398,8 +428,9 @@ func freshen(c wire.Connection, now time.Time) wire.Connection { |
| return c |
| } |
| -// meterOf is one reported window in words. |
| -func meterOf(w wire.Window) connMeter { |
| +// meterOf is one reported window in words, its reset counted down from |
| +// now. |
| +func meterOf(w wire.Window, now time.Time) connMeter { |
| m := connMeter{Used: int(w.UsedPercent + 0.5), Level: "ok"} |
| switch { |
| case w.Minutes >= 7*24*60: |
| @@ -416,7 +447,8 @@ func meterOf(w wire.Window) connMeter { |
| m.Level = "high" |
| } |
| if w.ResetsAt != nil { |
| - m.Resets = fmt.Sprintf(copyText("chat.connections.resets"), resetText(*w.ResetsAt)) |
| + m.Resets = fmt.Sprintf(copyText("chat.connections.resets_in"), inText(w.ResetsAt.Sub(now))) |
| + m.At = resetText(*w.ResetsAt) |
| } |
| return m |
| } |
diff --git a/internal/equipo/connections_view_test.go b/internal/equipo/connections_view_test.go| index 7556a0af..55806294 100644 |
| --- a/internal/equipo/connections_view_test.go |
| +++ b/internal/equipo/connections_view_test.go |
| @@ -5,6 +5,7 @@ import ( |
| "testing" |
| "time" |
| + "amadan.net/oficina/equipo/internal/equipo/chat" |
| "amadan.net/oficina/equipo/internal/wire" |
| ) |
| @@ -48,7 +49,7 @@ func lead(a connAnswering) string { return a.LeadStart + a.LeadName + a.LeadEnd |
| // the resting one is the other Codex account, not "Codex". |
| func TestConnectionsSummaryNamesTheAccount(t *testing.T) { |
| v := connectionsPage(screenshotSnapshot(), nil, wire.Preferences{}, "Tito Studio", screenshotNow) |
| - want := "Your coordinator is on Codex (paul@keymail.dev) while your other Codex account rests until Thu 09:36 UTC." |
| + want := "Your coordinator is on Codex (paul@keymail.dev). Your other Codex account is back in 1 day 11 hours." |
| if got := lead(v.Answering); got != want { |
| t.Fatalf("lead %q, want %q", got, want) |
| } |
| @@ -60,7 +61,7 @@ func TestConnectionsSummaryNamesTheAccount(t *testing.T) { |
| snap.Connections = snap.Connections[:2] |
| snap.Turns = snap.Turns[:0] |
| one := connectionsPage(snap, nil, wire.Preferences{}, "Tito Studio", screenshotNow) |
| - if got := lead(one.Answering); got != "Your coordinator is on Claude while Codex rests until Thu 09:36 UTC." { |
| + if got := lead(one.Answering); got != "Your coordinator is on Claude. Codex is back in 1 day 11 hours." { |
| t.Fatalf("one of each: %q", got) |
| } |
| } |
| @@ -73,7 +74,7 @@ func TestConnectionsStaleMeterAfterReset(t *testing.T) { |
| t.Fatalf("Claude shows a stale meter after its reset: %+v", m) |
| } |
| // The resting Codex keeps its reported window: its reset is ahead. |
| - if m := rowOf(t, v, "c-promax").Meters; len(m) != 1 || m[0].Used != 100 || m[0].Resets != "resets Thu 09:36 UTC" { |
| + if m := rowOf(t, v, "c-promax").Meters; len(m) != 1 || m[0].Used != 100 || m[0].Resets != "resets in 1 day 11 hours" || m[0].At != "Thu 09:36 UTC" { |
| t.Fatalf("promax meters %+v", m) |
| } |
| snap := screenshotSnapshot() |
| @@ -151,3 +152,89 @@ func TestConnectionsEndedNoteClears(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// Paul, 2026-11-11: "Can we get Resets in Xdays Yhours". Days and hours |
| +// from a day, hours and minutes under one, minutes under an hour; a zero |
| +// part left out, singular and plural. |
| +func TestInText(t *testing.T) { |
| + for _, c := range []struct { |
| + d time.Duration |
| + want string |
| + }{ |
| + {0, "under a minute"}, |
| + {59 * time.Second, "under a minute"}, |
| + {time.Minute, "1 minute"}, |
| + {12 * time.Minute, "12 minutes"}, |
| + {59*time.Minute + 59*time.Second, "59 minutes"}, |
| + {time.Hour, "1 hour"}, |
| + {time.Hour + time.Minute, "1 hour 1 minute"}, |
| + {5*time.Hour + 20*time.Minute, "5 hours 20 minutes"}, |
| + {23*time.Hour + 59*time.Minute, "23 hours 59 minutes"}, |
| + {24 * time.Hour, "1 day"}, |
| + {24*time.Hour + 59*time.Minute, "1 day"}, |
| + {25 * time.Hour, "1 day 1 hour"}, |
| + {49 * time.Hour, "2 days 1 hour"}, |
| + {51*time.Hour + 30*time.Minute, "2 days 3 hours"}, |
| + {-time.Minute, "under a minute"}, |
| + } { |
| + if got := inText(c.d); got != c.want { |
| + t.Errorf("inText(%v) = %q, want %q", c.d, got, c.want) |
| + } |
| + } |
| +} |
| + |
| +// A limited row says when it is back once: the meter counts down and the |
| +// status says "Limited"; without a meter the status counts down. Each |
| +// keeps the time as its hover title. |
| +func TestConnectionsLimitedRowCountsDown(t *testing.T) { |
| + now := time.Date(2026, 11, 11, 11, 31, 0, 0, time.UTC) |
| + reset := time.Date(2026, 11, 12, 9, 36, 0, 0, time.UTC) |
| + snap := screenshotSnapshot() |
| + snap.Connections[1].Headroom = &wire.Headroom{ResetsAt: &reset, Windows: []wire.Window{{Name: "secondary", UsedPercent: 100, Minutes: 7 * 24 * 60, ResetsAt: &reset}}} |
| + r := rowOf(t, connectionsPage(snap, nil, wire.Preferences{}, "", now), "c-promax") |
| + if r.Words != "Limited" || r.WordsAt != "" || len(r.Meters) != 1 || r.Meters[0].Resets != "resets in 22 hours 5 minutes" || r.Meters[0].At != "Thu 09:36 UTC" { |
| + t.Fatalf("metered limited row: %q (%q) %+v", r.Words, r.WordsAt, r.Meters) |
| + } |
| + snap.Connections[1].Headroom = &wire.Headroom{ResetsAt: &reset} |
| + r = rowOf(t, connectionsPage(snap, nil, wire.Preferences{}, "", now), "c-promax") |
| + if r.Words != "Limited, resets in 22 hours 5 minutes" || r.WordsAt != "Thu 09:36 UTC" || len(r.Meters) != 0 { |
| + t.Fatalf("limited row without a meter: %q (%q) %+v", r.Words, r.WordsAt, r.Meters) |
| + } |
| + // A meter without a reset time leaves the countdown to the status. |
| + snap.Connections[1].Headroom = &wire.Headroom{ResetsAt: &reset, Windows: []wire.Window{{Name: "secondary", UsedPercent: 100}}} |
| + if r = rowOf(t, connectionsPage(snap, nil, wire.Preferences{}, "", now), "c-promax"); r.Words != "Limited, resets in 22 hours 5 minutes" { |
| + t.Fatalf("limited row with an untimed meter: %q", r.Words) |
| + } |
| +} |
| + |
| +// The answering card counts down too: "is back in", the time in its |
| +// title; and when nothing can answer, "resets in". |
| +func TestConnectionsAnsweringCountsDown(t *testing.T) { |
| + now := time.Date(2026, 11, 11, 11, 31, 0, 0, time.UTC) |
| + v := connectionsPage(screenshotSnapshot(), nil, wire.Preferences{}, "", now) |
| + if got := lead(v.Answering); got != "Your coordinator is on Codex (paul@keymail.dev). Your other Codex account is back in 22 hours 5 minutes." { |
| + t.Fatalf("lead %q", got) |
| + } |
| + if v.Answering.LeadAt != "Your other Codex account resets Thu 09:36 UTC" { |
| + t.Fatalf("lead title %q", v.Answering.LeadAt) |
| + } |
| + snap := screenshotSnapshot() |
| + snap.Connections = snap.Connections[1:2] |
| + snap.Turns = nil |
| + v = connectionsPage(snap, nil, wire.Preferences{}, "", now) |
| + if got := lead(v.Answering); got != "Nothing can answer right now. Codex resets in 22 hours 5 minutes." || v.Answering.LeadAt != "Codex resets Thu 09:36 UTC" { |
| + t.Fatalf("nothing answers: %q (%q)", got, v.Answering.LeadAt) |
| + } |
| +} |
| + |
| +// The conversation's lines are history under old messages: they keep the |
| +// time, not a countdown. |
| +func TestConnectionsChatLinesStayAbsolute(t *testing.T) { |
| + reset := time.Date(2026, 11, 12, 9, 36, 0, 0, time.UTC) |
| + if got := switchedText(&wire.Switched{From: wire.ProviderCodex, To: wire.ProviderClaude, ResetsAt: &reset}); got != "Switched to Claude; Codex resets Thu 09:36 UTC" { |
| + t.Fatalf("switched %q", got) |
| + } |
| + if got := noConnectionText([]chat.NoConnectionLine{{Provider: wire.ProviderCodex, State: wire.ConnLimited, ResetsAt: &reset}}); got != "Nothing can answer right now. Codex resets Thu 09:36 UTC." { |
| + t.Fatalf("no connection %q", got) |
| + } |
| +} |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 1557d81f..f7c13859 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -716,7 +716,8 @@ var pageCopy = map[string]string{ |
| "chat.connections.cancel": "Cancel", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.healthy": "Ready", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.limited": "Limited, no reset time reported", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| - "chat.connections.limited_until": "Limited until %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.limited_now": "Limited", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.limited_resets_in": "Limited, resets in %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.signed_out": "Signed out", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.sign_in_again": "Needs signing in again", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.error": "Not working", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| @@ -747,7 +748,10 @@ var pageCopy = map[string]string{ |
| "chat.connections.answering.on": "Your coordinator is on %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.answering.while": " while %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.answering.rests": "%s rests", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| - "chat.connections.answering.rests_until": "%s rests until %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.answering.back_in": "%s is back in %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.answering.then": ". %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.answering.resets_in": "%s resets in %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.answering.resets_at": "%s resets %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.and": " and ", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.answering.too": "Engineering and Review are on %s too.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.answering.stays": "Work stays where it is until the next message or step, then Equipo picks the healthiest connection with headroom.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| @@ -781,7 +785,14 @@ var pageCopy = map[string]string{ |
| "chat.connections.window_hours": "%d h window", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.window_week": "Week", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.window_used": "Used", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| - "chat.connections.resets": "resets %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.resets_in": "resets in %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.in.day": "%d day", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.in.days": "%d days", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.in.hour": "%d hour", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.in.hours": "%d hours", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.in.minute": "%d minute", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.in.minutes": "%d minutes", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.connections.in.under_minute": "under a minute", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.add": "Add a connection", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.add_hint": "Another account of yours, or a second provider so Review can use a different model family.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.connections.chooser_lede": "Equipo signs in through the provider's own flow and never sees your password.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
diff --git a/internal/equipo/static/connections.js b/internal/equipo/static/connections.js| index 35175f37..bc0f77e7 100644 |
| --- a/internal/equipo/static/connections.js |
| +++ b/internal/equipo/static/connections.js |
| @@ -287,6 +287,25 @@ |
| } |
| var source, failures = 0; |
| live(root); |
| + |
| + // Resets count down ("resets in 22 hours 5 minutes"), so the |
| + // Connections page reads itself again in place each minute while it is |
| + // seen, and once on coming back to it. Not while a menu is open or a |
| + // control in it has focus: a tick never takes them away. |
| + if (!adding) { |
| + var ticked = Date.now(); |
| + var tick = function () { |
| + var box = root.querySelector("[data-connections-live]"); |
| + if (leaving || document.hidden || !box) return; |
| + if (box.querySelector("details[open]") || box.contains(document.activeElement)) return; |
| + ticked = Date.now(); |
| + refresh().catch(function () {}); |
| + }; |
| + setInterval(tick, 60000); |
| + document.addEventListener("visibilitychange", function () { |
| + if (Date.now() - ticked >= 60000) tick(); |
| + }); |
| + } |
| if (!window.EventSource) return; |
| function open() { |
| if (leaving) return; |
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css| index 28b37dcd..be277d20 100644 |
| --- a/internal/equipo/static/equipo.css |
| +++ b/internal/equipo/static/equipo.css |
| @@ -737,9 +737,12 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-conn-row] { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--rst-sp-4); align-items: start; padding: var(--rst-sp-4); transition: background .15s; } |
| [equipo-conn-row] + [equipo-conn-row] { border-block-start: 1px solid var(--rst-line); } |
| [equipo-conn-row]:hover { background: var(--rst-tint-hover, var(--rst-surface-2)); } |
| -/* A row that needs the person: a gentle tint and a hairline, never a stripe. */ |
| -[equipo-conn-row][data-needs], [equipo-conn-row][data-state="limited"] { background: color-mix(in srgb, var(--rst-tone-warning-bg) 30%, var(--rst-surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rst-tone-warning-fg) 14%, transparent); } |
| -[equipo-conn-row][data-state="signed_out"] { background: var(--rst-surface-2); box-shadow: inset 0 0 0 1px var(--rst-line); } |
| +/* A row that needs the person: a gentle tint, no border of its own (the |
| + list's separators are the only lines) and never a stripe. A limited |
| + row whose work moved needs nothing from the person: its dot and full |
| + meter say it, untinted. */ |
| +[equipo-conn-row][data-needs] { background: color-mix(in srgb, var(--rst-tone-warning-bg) 30%, var(--rst-surface)); } |
| +[equipo-conn-row][data-state="signed_out"] { background: var(--rst-surface-2); } |
| [equipo-conn-row][data-state="signed_out"] [equipo-pmark], [equipo-conn-row][data-state="sign_in_again"] [equipo-pmark] { filter: saturate(.35); opacity: .75; } |
| /* The row just added, back from the Add page: it arrives, then a soft |
| accent wash fades from it. */ |
| @@ -840,7 +843,29 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-conn-code] { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 600; letter-spacing: .08em; padding: .2rem .7rem; border: 1px solid var(--rst-line); border-radius: var(--rst-radius); background: var(--rst-surface); white-space: nowrap; user-select: all; } |
| [equipo-conn-code][data-command] { font-size: var(--rst-fs-sm); font-weight: 400; letter-spacing: 0; padding: .35rem .7rem; white-space: normal; overflow-wrap: anywhere; } |
| [equipo-conn-once] { flex-basis: 100%; margin: 0; color: var(--rst-text-faint, var(--rst-text-muted)); font-size: var(--rst-fs-xs); } |
| -[equipo-conn-waiting] { display: flex; align-items: center; gap: .1em; margin: var(--rst-sp-4) 0 0; font-size: var(--rst-fs-sm); } |
| +[equipo-conn-waiting] { display: flex; align-items: center; gap: 0; margin: var(--rst-sp-4) 0 0; font-size: var(--rst-fs-sm); } |
| +/* Waiting on the runner (the link coming, finishing the sign-in, |
| + checking a token, an approval): the shared star floats gently while |
| + its motes circle it, going out and coming back, and a soft light |
| + passes along the words. Slower and quieter than the coordinator's |
| + thinking line; the star keeps a clear gap from the words. */ |
| +[equipo-conn-waiting] [equipo-sparkle], [equipo-conn-loading] [equipo-sparkle] { --orbit: .95em; animation: equipo-conn-float 4.8s cubic-bezier(.37, 0, .63, 1) infinite; } |
| +[equipo-conn-waiting] [equipo-sparkle] { margin-inline-end: .95em; } |
| +[equipo-conn-loading] [equipo-sparkle] { --orbit: .8em; } |
| +[equipo-conn-waiting] [equipo-sparkle] [data-mote], [equipo-conn-loading] [equipo-sparkle] [data-mote] { animation: equipo-conn-orbit 4.8s linear calc(-1 * var(--d, 0s)) infinite; } |
| +@keyframes equipo-conn-float { 0%, 100% { transform: translate(0, .07em); } 50% { transform: translate(.04em, -.09em); } } |
| +@keyframes equipo-conn-orbit { |
| + 0% { opacity: .2; transform: rotate(0turn) translateX(calc(.55 * var(--orbit))) scale(.6); } |
| + 50% { opacity: .8; transform: rotate(.5turn) translateX(var(--orbit)) scale(.95); } |
| + 100% { opacity: .2; transform: rotate(1turn) translateX(calc(.55 * var(--orbit))) scale(.6); } |
| +} |
| +[equipo-conn-waiting] [data-words], [equipo-conn-loading] [data-phrase] { --ink: var(--rst-text); background: linear-gradient(100deg, var(--ink) 0 40%, var(--rst-accent) 50%, var(--ink) 60% 100%) 100% 0 / 250% 100% no-repeat; -webkit-background-clip: text; background-clip: text; color: transparent; animation: equipo-conn-shimmer 3.6s cubic-bezier(.37, 0, .63, 1) infinite; } |
| +[equipo-conn-loading] [data-phrase] { --ink: var(--rst-text-muted); } |
| +@keyframes equipo-conn-shimmer { 0% { background-position: 100% 0; } 70%, 100% { background-position: 0 0; } } |
| +@media (prefers-reduced-motion: reduce) { |
| + [equipo-conn-waiting] [equipo-sparkle], [equipo-conn-loading] [equipo-sparkle] { animation: none; } |
| + [equipo-conn-waiting] [data-words], [equipo-conn-loading] [data-phrase] { animation: none; background: none; color: var(--ink); } |
| +} |
| [equipo-conn-small] { margin: var(--rst-sp-3) 0 0; color: var(--rst-text-faint, var(--rst-text-muted)); font-size: var(--rst-fs-xs); } |
| [equipo-conn-card-foot] { display: flex; align-items: center; justify-content: space-between; gap: var(--rst-sp-3); margin-block-start: var(--rst-sp-4); } |
| [equipo-conn-card-foot] [equipo-conn-small] { margin: 0; } |
diff --git a/internal/equipo/templates/models.html b/internal/equipo/templates/models.html| index 4714be48..a7773ea6 100644 |
| --- a/internal/equipo/templates/models.html |
| +++ b/internal/equipo/templates/models.html |
| @@ -7,7 +7,7 @@ |
| {{define "conn-copy-link"}}<button type="button" rst-btn data-copy="{{.}}" data-copy-link data-copied="{{copy "chat.connections.copied"}}">{{copy "chat.connections.copy_link"}}</button>{{end}} |
| {{define "conn-sign-in-instead"}}<form method="post" action="/conversation/connections" data-add-form equipo-inline-form><input type="hidden" name="provider" value="claude"><input type="hidden" name="kind" value="subscription"><button equipo-link type="submit" data-sign-in-instead>{{copy "chat.connections.sign_in_instead"}}</button></form>{{end}} |
| {{define "conn-paste-instead"}}<form method="post" action="/conversation/connections" data-add-form equipo-inline-form><input type="hidden" name="provider" value="claude"><input type="hidden" name="kind" value="token"><button equipo-link type="submit" data-paste-instead>{{copy "chat.connections.paste_token_instead"}}</button></form>{{end}} |
| -{{define "conn-waiting"}}<p equipo-conn-waiting aria-live="polite">{{template "conn-star"}}<span>{{.}}</span></p>{{end}} |
| +{{define "conn-waiting"}}<p equipo-conn-waiting aria-live="polite">{{template "conn-star"}}<span data-words>{{.}}</span></p>{{end}} |
| {{define "conn-cancel"}}<form method="post" action="/conversation/connections/{{.}}/cancel" equipo-inline-form><button rst-btn data-quiet type="submit" data-connection-cancel>{{copy "chat.connections.cancel"}}</button></form>{{end}} |
| {{define "conn-attempt"}}<div equipo-conn-card data-connection="{{.ID}}" data-connecting data-provider="{{.Provider}}"{{if eq .Kind "token"}} data-kind="token" data-runner="{{.RunnerID}}" data-endpoint="{{.Endpoint}}"{{with .SealKey}} data-seal-key="{{.}}"{{end}}{{else if .SignIn}} data-kind="sign_in" data-runner="{{.RunnerID}}" data-endpoint="{{.Endpoint}}" data-attempt="{{.Prompt.Attempt}}"{{with .SealKey}} data-seal-key="{{.}}"{{end}}{{end}}> |
| <div equipo-conn-card-head>{{template "conn-mark" .Provider}}<div><h3>{{if eq .Provider "codex"}}{{copy "chat.connections.title_codex"}}{{else}}{{copy "chat.connections.title_claude"}}{{end}}</h3><p>{{if eq .Kind "token"}}{{copy "chat.connections.token_sub"}}{{else if .Phrases}}{{copy "chat.connections.loading_sub"}}{{else if eq .Provider "codex"}}{{copy "chat.connections.codex_sub"}}{{else}}{{copy "chat.connections.claude_sub"}}{{end}}</p></div></div> |
| @@ -59,7 +59,7 @@ |
| {{template "conn-mark" .Provider}} |
| <div equipo-conn-body> |
| <p equipo-conn-head><span equipo-conn-name>{{.Name}}</span><span equipo-conn-account>{{.Label}}{{with .Plan}}, {{.}}{{end}}</span>{{if .Preferred}}<span equipo-conn-pref>{{icon "star"}}{{copy "chat.connections.preferred"}}</span>{{end}}</p> |
| -<p equipo-conn-facts><span equipo-conn-state data-connection-state data-s="{{.State}}">{{.Words}}</span>{{with .Expires}}<span equipo-conn-expires data-token-expires>{{.}}</span>{{end}}{{range .Meters}}<span equipo-conn-meter data-level="{{.Level}}"><span equipo-conn-bar><i data-w="{{.Used}}"></i></span><span>{{.Name}} <b>{{.Used}}%</b>{{with .Resets}}, {{.}}{{end}}</span></span>{{end}}</p> |
| +<p equipo-conn-facts><span equipo-conn-state data-connection-state data-s="{{.State}}"{{with .WordsAt}} title="{{.}}"{{end}}>{{.Words}}</span>{{with .Expires}}<span equipo-conn-expires data-token-expires>{{.}}</span>{{end}}{{range .Meters}}<span equipo-conn-meter data-level="{{.Level}}"{{with .At}} title="{{.}}"{{end}}><span equipo-conn-bar><i data-w="{{.Used}}"></i></span><span>{{.Name}} <b>{{.Used}}%</b>{{with .Resets}}, {{.}}{{end}}</span></span>{{end}}</p> |
| {{if .Renew}}<div equipo-conn-renew data-token-renew>{{copy "chat.connections.token_renew"}} <form method="post" action="/conversation/connections" data-add-form equipo-inline-form><input type="hidden" name="provider" value="{{.Provider}}"><button equipo-link type="submit" data-renew>{{copy "chat.connections.sign_in_again_action"}}</button></form></div>{{end}} |
| {{if .Roles}}<p equipo-conn-roles><span equipo-conn-roles-label>{{copy "chat.connections.serving"}}</span>{{range .Roles}}<span equipo-conn-chip{{if .Live}} data-live{{end}}>{{if .Live}}{{template "conn-star"}}{{end}}{{.Name}}</span>{{end}}</p>{{else}}{{with .RolesNote}}<p equipo-conn-roles><span equipo-conn-roles-note>{{.}}</span></p>{{end}}{{end}} |
| </div> |
| @@ -81,7 +81,7 @@ |
| {{if .Models.Adding}}{{range .Models.Ended}}{{template "conn-note" (dict "Row" . "Add" $.Models.Adding)}}{{end}} |
| <div equipo-conn-add-area data-attempts>{{range .Models.Attempts}}{{template "conn-attempt" .}}{{else}}{{template "conn-chooser"}}{{end}}</div> |
| <div hidden>{{range .Models.Rows}}<i data-held-connection="{{.ID}}" data-state="{{.State}}" data-account="{{.Label}}"></i>{{end}}</div> |
| -{{else if .Models.Rows}}{{with .Models.Answering}}<section equipo-conn-answering{{with .Tone}} data-tone="{{.}}"{{end}} aria-label="{{copy "chat.connections.title"}}" data-answering>{{if .Tone}}<span equipo-conn-lead-icon aria-hidden="true">{{icon "alert-triangle"}}</span>{{else}}{{template "conn-star"}}{{end}}<p equipo-conn-lead>{{.LeadStart}}<b>{{.LeadName}}</b>{{.LeadEnd}}</p><p equipo-conn-sub>{{.Sub}}{{if .SeeConversation}} <a href="/conversation">{{copy "chat.connections.answering.see"}}</a>{{end}}</p> |
| +{{else if .Models.Rows}}{{with .Models.Answering}}<section equipo-conn-answering{{with .Tone}} data-tone="{{.}}"{{end}} aria-label="{{copy "chat.connections.title"}}" data-answering>{{if .Tone}}<span equipo-conn-lead-icon aria-hidden="true">{{icon "alert-triangle"}}</span>{{else}}{{template "conn-star"}}{{end}}<p equipo-conn-lead{{with .LeadAt}} title="{{.}}"{{end}}>{{.LeadStart}}<b>{{.LeadName}}</b>{{.LeadEnd}}</p><p equipo-conn-sub>{{.Sub}}{{if .SeeConversation}} <a href="/conversation">{{copy "chat.connections.answering.see"}}</a>{{end}}</p> |
| {{if not .Tone}}{{with $.Models.Prefer}}<div equipo-conn-prefer><span>{{copy "chat.connections.prefer"}}</span><span equipo-seg role="group" aria-label="{{copy "chat.connections.prefer"}}">{{range .Options}}<form method="post" action="/conversation/connections/prefer" equipo-inline-form><input type="hidden" name="provider" value="{{.Value}}"><input type="hidden" name="revision" value="{{$.Models.Prefer.Revision}}"><button type="submit" aria-pressed="{{.On}}" data-prefer="{{.Value}}">{{.Label}}</button></form>{{end}}</span><span equipo-conn-hint>{{.Hint}}</span></div>{{end}}{{end}} |
| </section>{{end}} |
| <section equipo-conn-group><h2>{{copy "chat.connections.group"}} <span equipo-conn-n>{{len .Models.Rows}}</span><span equipo-conn-hint>{{copy "chat.connections.usage_resets"}}</span></h2> |