Settings in sections: a second sidebar on desktop, drill-ins on a phone
Paul: "settings could probably get a submenu on mobile and its own menu sidebar on desktop". Thinking words, Connections (moved, with Prefer), Housekeeping and Notebook each have a URL under /conversation/settings with a menu of the sections; Teams links out; Usage is not built yet. On a desktop the menu stands beside the section with the rail kept; on a phone /conversation/settings is full-row drill-ins and a section leads back to Settings. Old URLs answer 303. Saves stay in the background with "Saved" (Reset in place; Prefer gains the tick). Neither Rastrillo nor Fiesta has a secondary nav, so it is Equipo's own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 files changed,
+384
−126
.rastrillo/budgets.txt+1 −1docs/mockups/built/2026-11-09/settings-connections-1280-dark.pngbinarydocs/mockups/built/2026-11-09/settings-connections-1280-light.pngbinarydocs/mockups/built/2026-11-09/settings-housekeeping-390-dark.pngbinarydocs/mockups/built/2026-11-09/settings-housekeeping-390-light.pngbinarydocs/mockups/built/2026-11-09/settings-list-390-dark.pngbinarydocs/mockups/built/2026-11-09/settings-list-390-light.pngbinarydocs/mockups/built/2026-11-09/settings-menu-1280-dark.pngbinarydocs/mockups/built/2026-11-09/settings-menu-1280-light.pngbinarydocs/mockups/built/2026-11-09/settings-thinking-390-dark.pngbinarydocs/mockups/built/2026-11-09/settings-thinking-390-light.pngbinarydocs/superpowers/plans/COMPOSER-PROGRESS.md+42 −0internal/equipo/app.go+7 −3internal/equipo/chat_connections.go+7 −7internal/equipo/chat_page.go+2 −2internal/equipo/handlers.go+1 −0internal/equipo/housekeeping_page.go+2 −2internal/equipo/render.go+2 −2internal/equipo/settings_hub.go+79 −26internal/equipo/static/connections.js+20 −1internal/equipo/static/equipo.css+35 −0internal/equipo/static/settings.js+3 −2internal/equipo/templates/chat.html+2 −2internal/equipo/templates/housekeeping.html+1 −1internal/equipo/templates/models.html+8 −4internal/equipo/templates/notebook.html+7 −3internal/equipo/templates/settings.html+1 −1internal/equipo/templates/settings_hub.html+10 −15internal/equipo/templates/settings_nav.html+3 −0internal/equipo/templates/thinking_words.html+0 −4internal/equipo/thinking_words.go+1 −28internal/headless/browser_notebook_test.go+3 −3internal/headless/browser_receipts_test.go+8 −4internal/thintest/gallery_test.go+1 −0internal/thintest/housekeeping_browser_test.go+3 −3internal/thintest/housekeeping_contract_test.go+1 −1internal/thintest/index_browser_test.go+2 −2internal/thintest/inline_style_test.go+5 −4internal/thintest/settings_browser_test.go+59 −5internal/thintest/settings_pages_test.go+61 −0scripts/runner-reference-allowlist.json+7 −0
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 4f1faaea..fff90972 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 14900 - 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 15100 - 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. 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/mockups/built/2026-11-09/settings-connections-1280-dark.png b/docs/mockups/built/2026-11-09/settings-connections-1280-dark.png| new file mode 100644 |
| index 00000000..2edc8336 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-connections-1280-dark.png differ |
diff --git a/docs/mockups/built/2026-11-09/settings-connections-1280-light.png b/docs/mockups/built/2026-11-09/settings-connections-1280-light.png| new file mode 100644 |
| index 00000000..9dc474cf |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-connections-1280-light.png differ |
diff --git a/docs/mockups/built/2026-11-09/settings-housekeeping-390-dark.png b/docs/mockups/built/2026-11-09/settings-housekeeping-390-dark.png| new file mode 100644 |
| index 00000000..0863e1e5 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-housekeeping-390-dark.png differ |
diff --git a/docs/mockups/built/2026-11-09/settings-housekeeping-390-light.png b/docs/mockups/built/2026-11-09/settings-housekeeping-390-light.png| new file mode 100644 |
| index 00000000..a73de5bf |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-housekeeping-390-light.png differ |
diff --git a/docs/mockups/built/2026-11-09/settings-list-390-dark.png b/docs/mockups/built/2026-11-09/settings-list-390-dark.png| new file mode 100644 |
| index 00000000..3435a2f5 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-list-390-dark.png differ |
diff --git a/docs/mockups/built/2026-11-09/settings-list-390-light.png b/docs/mockups/built/2026-11-09/settings-list-390-light.png| new file mode 100644 |
| index 00000000..c79c2e2e |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-list-390-light.png differ |
diff --git a/docs/mockups/built/2026-11-09/settings-menu-1280-dark.png b/docs/mockups/built/2026-11-09/settings-menu-1280-dark.png| new file mode 100644 |
| index 00000000..9079dd1e |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-menu-1280-dark.png differ |
diff --git a/docs/mockups/built/2026-11-09/settings-menu-1280-light.png b/docs/mockups/built/2026-11-09/settings-menu-1280-light.png| new file mode 100644 |
| index 00000000..6f79366e |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-menu-1280-light.png differ |
diff --git a/docs/mockups/built/2026-11-09/settings-thinking-390-dark.png b/docs/mockups/built/2026-11-09/settings-thinking-390-dark.png| new file mode 100644 |
| index 00000000..dd6bfd60 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-thinking-390-dark.png differ |
diff --git a/docs/mockups/built/2026-11-09/settings-thinking-390-light.png b/docs/mockups/built/2026-11-09/settings-thinking-390-light.png| new file mode 100644 |
| index 00000000..707441a3 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-09/settings-thinking-390-light.png differ |
diff --git a/docs/superpowers/plans/COMPOSER-PROGRESS.md b/docs/superpowers/plans/COMPOSER-PROGRESS.md| index b397ef69..c0306bba 100644 |
| --- a/docs/superpowers/plans/COMPOSER-PROGRESS.md |
| +++ b/docs/superpowers/plans/COMPOSER-PROGRESS.md |
| @@ -389,6 +389,48 @@ staging: |
| New copy, accepted for now: `api.attachment_pixels` "That image is too |
| large: at most 12,000 pixels on a side and 40 megapixels." |
| +## Round: Settings in sections (Paul, 2026-11-09) |
| + |
| +"I think settings could probably get a submenu on mobile and its own |
| +menu sidebar on desktop?" |
| +- Framework first: Rastrillo v0.30.1 (and its main checkout) has the |
| + sidebar shell, its phone index and segmented tabs, but no secondary or |
| + hierarchical navigation and no settings layout; Fiesta's only sub-nav |
| + is the docs website's per-page sections. So it is Equipo's own |
| + (`settings_nav.html`, `settings_hub.go`, equipo.css), to file upstream. |
| +- Sections, each at its own URL with the menu of all of them and the |
| + current one marked (`aria-current`): Thinking words with the preview |
| + (`/conversation/settings/thinking`), Connections moved here with Prefer |
| + (`/conversation/settings/connections`; the header's plug leads there), |
| + Housekeeping (Pause, quiet hours, the activity link), Notebook with |
| + Reset (the header's notebook leads there), and Teams as a link out. |
| + Usage is left out: there is no usage view to put there yet. |
| +- Desktop: the menu is a second sidebar (13rem) beside the section; the |
| + app's rail stays with Settings marked. Phone: `/conversation/settings` |
| + is the menu as full-row drill-ins with chevrons, drawn as the home |
| + screen's grouped nav (surface, hairlines, radius, 3rem rows); a section |
| + is its own page, the bar's back link reads Settings. |
| +- `/conversation/settings` serves the menu on a phone and the first |
| + section beside it on a desktop (one page, CSS by width; no redirect by |
| + guessing the device). `/conversation/connections`, |
| + `/conversation/notebook` and `/settings/thinking` answer 303 to their |
| + sections; the standalone Thinking words page is gone. |
| +- Saves stay in the background with "Saved": Thinking words and |
| + Housekeeping as before, Reset now in place (the notebook empties, no |
| + navigation), and Prefer on Connections gains the same tick. |
| +- Fixed while here: the Notebook page had lost its columns to a later |
| + `[equipo-notes]` grid rule (failing on 321413d too). |
| +- Tests: `TestPagesSettingsSections` (CI: every section's menu and |
| + current mark, the redirects, the header links; failed on 0797ad0's |
| + app), `TestBrowserSettingsMenu` (1280 and 390, light and dark: the |
| + second sidebar beside the section with the rail, the current mark, |
| + moving between sections; the phone's drill-ins at 44px and more with |
| + chevrons, a section with Settings in its bar and no menu, back to the |
| + menu), and `TestBrowserSettingsStayOnPage`, `TestBrowserHousekeeping`, |
| + `TestBrowserPhoneIndex`, `TestBrowserThinkingWords`, |
| + `TestBrowserNotebook` and `TestBrowserNotebookLook` moved to the |
| + section URLs. Shots: `docs/mockups/built/2026-11-09/settings-*.png`. |
| + |
| ## Staging |
| Not restaged (the controller sequences it). |
diff --git a/internal/equipo/app.go b/internal/equipo/app.go| index 49dc0fb8..ba78236f 100644 |
| --- a/internal/equipo/app.go |
| +++ b/internal/equipo/app.go |
| @@ -232,7 +232,8 @@ func RouterWithStore(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logg |
| r.Get("/conversation/attachments/{id}/preview", a.chatAttachment(true)) |
| r.Post("/conversation/cards/{id}/answer", a.chatCardAnswer) |
| r.Post("/conversation/projects/{id}/remove", a.chatProjectRemove) |
| - r.Get("/conversation/notebook", a.chatNotebook) |
| + r.Get("/conversation/notebook", movedTo("/conversation/settings/notebook")) |
| + r.Get("/conversation/settings/notebook", a.chatNotebook) |
| r.Get("/housekeeping", a.housekeepingPage) |
| r.Post("/settings/housekeeping/pause", a.housekeepingPause) |
| r.Post("/settings/housekeeping/quiet", a.housekeepingQuiet) |
| @@ -240,7 +241,10 @@ func RouterWithStore(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logg |
| r.Post("/housekeeping/actions/{id}/undo", a.housekeepingUndo) |
| r.Post("/conversation/notebook/reset", a.chatNotebookReset) |
| r.Get("/conversation/settings", a.settingsHub) |
| - r.Get("/conversation/connections", a.connectionsView) |
| + r.Get("/conversation/settings/thinking", a.settingsSectionHandler("thinking")) |
| + r.Get("/conversation/settings/housekeeping", a.settingsSectionHandler("housekeeping")) |
| + r.Get("/conversation/connections", movedTo("/conversation/settings/connections")) |
| + r.Get("/conversation/settings/connections", a.connectionsView) |
| r.Post("/conversation/connections", a.connectionsStart) |
| r.Post("/conversation/connections/{id}/cancel", a.connectionsCancel) |
| r.Post("/conversation/connections/{id}/sign-out", a.connectionsSignOut) |
| @@ -271,7 +275,7 @@ func RouterWithStore(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logg |
| r.Post("/runners/enrol", a.approveEnrolment) |
| r.Post("/runners/{id}/revoke", a.revokeRunner) |
| r.Post("/projects/{id}/connections", a.saveConnectionChoice) |
| - r.Get("/settings/thinking", a.thinkingPage) |
| + r.Get("/settings/thinking", movedTo("/conversation/settings/thinking")) |
| r.Post("/settings/thinking", a.thinkingSave) |
| r.Get("/settings", a.settings) |
| r.Get("/settings/devices", a.deviceBrowser().Devices) |
diff --git a/internal/equipo/chat_connections.go b/internal/equipo/chat_connections.go| index 1615e617..e7e0d0f9 100644 |
| --- a/internal/equipo/chat_connections.go |
| +++ b/internal/equipo/chat_connections.go |
| @@ -168,7 +168,7 @@ func (a *application) connectionsView(w http.ResponseWriter, r *http.Request) { |
| a.failure(w, r, chatError(err)) |
| return |
| } |
| - data, err := a.page(r, "conversation") |
| + data, err := a.settingsPage(r, "connections", false) |
| if err != nil { |
| a.failure(w, r, err) |
| return |
| @@ -195,7 +195,7 @@ func (a *application) connectionsView(w http.ResponseWriter, r *http.Request) { |
| // connectionsStart is Add Codex, Add Claude and "I am at this machine". |
| func (a *application) connectionsStart(w http.ResponseWriter, r *http.Request) { |
| - a.chatActionTo(w, r, "/conversation/connections", func(ctx context.Context, address string) error { |
| + a.chatActionTo(w, r, "/conversation/settings/connections", func(ctx context.Context, address string) error { |
| provider, same := r.PostFormValue("provider"), r.PostFormValue("same_machine") == "1" |
| if same { |
| // The terminal card gives way to the sign-in at this machine. |
| @@ -221,7 +221,7 @@ func (a *application) connectionsStart(w http.ResponseWriter, r *http.Request) { |
| // connectionsSignOut is a connection's quiet Sign out. |
| func (a *application) connectionsSignOut(w http.ResponseWriter, r *http.Request) { |
| - a.chatActionTo(w, r, "/conversation/connections", func(ctx context.Context, address string) error { |
| + a.chatActionTo(w, r, "/conversation/settings/connections", func(ctx context.Context, address string) error { |
| _, err := a.store.Chat().SignOut(ctx, address, chi.URLParam(r, "id")) |
| return err |
| }) |
| @@ -229,9 +229,9 @@ func (a *application) connectionsSignOut(w http.ResponseWriter, r *http.Request) |
| // connectionsPrefer is the Prefer control and a row's Make preferred. |
| func (a *application) connectionsPrefer(w http.ResponseWriter, r *http.Request) { |
| - back := "/conversation/connections" |
| + back := "/conversation/settings/connections" |
| if r.PostFormValue("from") == "settings" { |
| - back = "/conversation/settings#connections" |
| + back = "/conversation/settings/connections" |
| } |
| a.chatActionTo(w, r, back, func(ctx context.Context, address string) error { |
| revision, _ := strconv.ParseInt(r.PostFormValue("revision"), 10, 64) |
| @@ -247,13 +247,13 @@ func (a *application) connectionsPrefer(w http.ResponseWriter, r *http.Request) |
| // connectionsForget removes a signed-out connection, or an ended |
| // attempt, from the list. |
| func (a *application) connectionsForget(w http.ResponseWriter, r *http.Request) { |
| - a.chatActionTo(w, r, "/conversation/connections", func(ctx context.Context, address string) error { |
| + a.chatActionTo(w, r, "/conversation/settings/connections", func(ctx context.Context, address string) error { |
| return a.store.Chat().Forget(ctx, address, chi.URLParam(r, "id")) |
| }) |
| } |
| func (a *application) connectionsCancel(w http.ResponseWriter, r *http.Request) { |
| - a.chatActionTo(w, r, "/conversation/connections", func(ctx context.Context, address string) error { |
| + a.chatActionTo(w, r, "/conversation/settings/connections", func(ctx context.Context, address string) error { |
| _, err := a.store.Chat().CancelConnection(ctx, address, chi.URLParam(r, "id")) |
| return err |
| }) |
diff --git a/internal/equipo/chat_page.go b/internal/equipo/chat_page.go| index cf0268f3..da453e11 100644 |
| --- a/internal/equipo/chat_page.go |
| +++ b/internal/equipo/chat_page.go |
| @@ -404,7 +404,7 @@ func (a *application) chatNotebook(w http.ResponseWriter, r *http.Request) { |
| a.failure(w, r, chatError(err)) |
| return |
| } |
| - data, err := a.page(r, "conversation") |
| + data, err := a.settingsPage(r, "notebook", false) |
| if err != nil { |
| a.failure(w, r, err) |
| return |
| @@ -424,7 +424,7 @@ func (a *application) chatNotebook(w http.ResponseWriter, r *http.Request) { |
| } |
| func (a *application) chatNotebookReset(w http.ResponseWriter, r *http.Request) { |
| - a.chatAction(w, r, func(ctx context.Context, address string) error { |
| + a.chatActionTo(w, r, "/conversation/settings/notebook", func(ctx context.Context, address string) error { |
| _, err := a.store.Chat().ResetCoordinator(ctx, address) |
| return err |
| }) |
diff --git a/internal/equipo/handlers.go b/internal/equipo/handlers.go| index 049e2038..af75128e 100644 |
| --- a/internal/equipo/handlers.go |
| +++ b/internal/equipo/handlers.go |
| @@ -53,6 +53,7 @@ type pageData struct { |
| ThinkingSet, ThinkingWords string |
| Thinking thinkingView |
| Settings settingsHubView |
| + SettingsNav []settingsLink |
| Coordinator conversation.CoordinatorPage |
| Plan planning.Page |
| Rendered RenderedChangeView |
diff --git a/internal/equipo/housekeeping_page.go b/internal/equipo/housekeeping_page.go| index 36da9156..420ff775 100644 |
| --- a/internal/equipo/housekeeping_page.go |
| +++ b/internal/equipo/housekeeping_page.go |
| @@ -169,7 +169,7 @@ func housekeepingSettings(h wire.Housekeeping) *hkSettingsView { |
| // housekeepingQuiet saves the person's quiet hours from Settings; off is |
| // a window of no hours. |
| func (a *application) housekeepingQuiet(w http.ResponseWriter, r *http.Request) { |
| - a.chatActionTo(w, r, "/conversation/settings#housekeeping", func(ctx context.Context, address string) error { |
| + a.chatActionTo(w, r, "/conversation/settings/housekeeping", func(ctx context.Context, address string) error { |
| revision, _ := strconv.ParseInt(r.PostFormValue("revision"), 10, 64) |
| from, err1 := strconv.Atoi(r.PostFormValue("from")) |
| until, err2 := strconv.Atoi(r.PostFormValue("until")) |
| @@ -192,7 +192,7 @@ func (a *application) housekeepingQuiet(w http.ResponseWriter, r *http.Request) |
| // housekeepingPause is Pause and Resume, from Settings. |
| func (a *application) housekeepingPause(w http.ResponseWriter, r *http.Request) { |
| - a.chatActionTo(w, r, "/conversation/settings#housekeeping", func(ctx context.Context, address string) error { |
| + a.chatActionTo(w, r, "/conversation/settings/housekeeping", func(ctx context.Context, address string) error { |
| revision, _ := strconv.ParseInt(r.PostFormValue("revision"), 10, 64) |
| _, err := a.store.Chat().SetHousekeeping(ctx, address, wire.SetHousekeeping{Paused: r.PostFormValue("paused") == "1", Revision: revision}) |
| return hkPageError(err) |
diff --git a/internal/equipo/render.go b/internal/equipo/render.go| index 32761140..895db5d1 100644 |
| --- a/internal/equipo/render.go |
| +++ b/internal/equipo/render.go |
| @@ -34,7 +34,7 @@ var assets = rastrillo.NewAssets(appFS) |
| var pages = map[string]*template.Template{} |
| func init() { |
| - for _, name := range []string{"person_devices", "person_device", "teams", "onboarding", "invite", "playbooks", "playbook_form", "playbook_diff", "specialist_form", "template_library", "template_diff", "conversation", "chat", "thread", "plan", "coordinator", "preferences", "index", "empty", "projects", "project", "project_form", "people", "settings", "specialist", "errors", "signin_page", "form_error", "runners", "tasks", "task", "task_form", "question", "merge", "connections", "recovery", "recovery_form", "rendered_approval", "notebook", "housekeeping", "work_tasks", "work_task", "work_projects", "work_project", "models", "work_needs", "thinking_words", "settings_hub"} { |
| + for _, name := range []string{"person_devices", "person_device", "teams", "onboarding", "invite", "playbooks", "playbook_form", "playbook_diff", "specialist_form", "template_library", "template_diff", "conversation", "chat", "thread", "plan", "coordinator", "preferences", "index", "empty", "projects", "project", "project_form", "people", "settings", "specialist", "errors", "signin_page", "form_error", "runners", "tasks", "task", "task_form", "question", "merge", "connections", "recovery", "recovery_form", "rendered_approval", "notebook", "housekeeping", "work_tasks", "work_task", "work_projects", "work_project", "models", "work_needs", "settings_hub"} { |
| page := template.Must(template.New("layout"). |
| Funcs(ui.Funcs(ui.WithIcons(icons.Icon, icons.Assets))). |
| Funcs(template.FuncMap{"chatMarkdown": chatmarkdown.Render, "fileSize": fileSize, "loadingLine": loadingLine, "split": strings.Split, "since": sinceMillis, "elapsed": elapsedText, "short": short, "agoData": agoData, "agoFormats": agoFormats, "projectAllows": library.ProjectAllowed, "asset": assets.Path, "copy": copyText, "taskGroups": func() []string { return []string{"needs-person", "running", "queued", "finished"} }, |
| @@ -52,7 +52,7 @@ func init() { |
| page = template.Must(page.ParseFS(appFS, "templates/layout.html")) |
| } |
| if name != "signin_page" && name != "errors" { |
| - page = template.Must(page.ParseFS(appFS, "templates/chrome.html", "templates/forms.html", "templates/task_card.html", "templates/conversation_card.html", "templates/work_parts.html", "templates/housekeeping_settings.html")) |
| + page = template.Must(page.ParseFS(appFS, "templates/chrome.html", "templates/forms.html", "templates/task_card.html", "templates/conversation_card.html", "templates/work_parts.html", "templates/housekeeping_settings.html", "templates/settings_nav.html")) |
| } |
| pages[name] = template.Must(page.ParseFS(appFS, "templates/"+name+".html")) |
| } |
diff --git a/internal/equipo/settings_hub.go b/internal/equipo/settings_hub.go| index 13c05dd3..95fa3bee 100644 |
| --- a/internal/equipo/settings_hub.go |
| +++ b/internal/equipo/settings_hub.go |
| @@ -4,48 +4,101 @@ import ( |
| "net/http" |
| ) |
| -// The Settings section (Paul: "Settings should be its own section... not |
| -// an option in the profile dropdown"): Thinking words with its preview, |
| -// Connections with Prefer, Housekeeping (Pause, quiet hours and the way |
| -// to the activity view; housekeeping_settings.html), |
| -// Notebook and Teams. The profile menu keeps only the person. |
| +// Settings (Paul, 2026-11-09: "settings could probably get a submenu on |
| +// mobile and its own menu sidebar on desktop"): a section per URL under |
| +// /conversation/settings, with a secondary menu of the sections. On a |
| +// desktop the menu stands beside the section, the app's rail stays; on a |
| +// phone /conversation/settings is the menu as full-row drill-ins and each |
| +// section is its own page with a way back to Settings. Neither Rastrillo |
| +// v0.30.1 nor Fiesta has a secondary navigation or settings layout, so |
| +// it is Equipo's own (settings_nav.html, equipo.css). |
| +// |
| +// Usage is not a section yet: there is no usage view to put there. |
| -// settingsHubView is the Settings page. |
| +// settingsLink is one entry of the Settings menu. |
| +type settingsLink struct { |
| + Key, Href, CopyKey, Icon string |
| + Current bool |
| +} |
| + |
| +var settingsSections = []settingsLink{ |
| + {Key: "thinking", Href: "/conversation/settings/thinking", CopyKey: "thinking.title", Icon: "type"}, |
| + {Key: "connections", Href: "/conversation/settings/connections", CopyKey: "settings.connections", Icon: "plug"}, |
| + {Key: "housekeeping", Href: "/conversation/settings/housekeeping", CopyKey: "settings.housekeeping", Icon: "list-checks"}, |
| + {Key: "notebook", Href: "/conversation/settings/notebook", CopyKey: "settings.notebook_open", Icon: "notebook"}, |
| + {Key: "teams", Href: "/teams", CopyKey: "settings.teams_open", Icon: "users"}, |
| +} |
| + |
| +// settingsHubView is a Settings section: which one, whether it is the |
| +// root (the menu on a phone, the first section on a desktop), and the |
| +// section's own data. |
| type settingsHubView struct { |
| + Section string |
| + Root bool |
| Thinking thinkingView |
| - Prefer connPrefer |
| } |
| -// settingsHub is GET /conversation/settings. |
| +// settingsPage is a page in the Settings section: the app's rail shows |
| +// Settings, the secondary menu shows section. |
| +func (a *application) settingsPage(r *http.Request, section string, root bool) (pageData, error) { |
| + data, err := a.page(r, "settings-hub") |
| + if err != nil { |
| + return data, err |
| + } |
| + for _, s := range settingsSections { |
| + s.Current = s.Key == section |
| + data.SettingsNav = append(data.SettingsNav, s) |
| + } |
| + data.Settings.Section, data.Settings.Root = section, root |
| + data.Title = "nav.settings" |
| + return data, nil |
| +} |
| + |
| +// settingsHub is GET /conversation/settings: the menu on a phone, the |
| +// first section (Thinking words) beside it on a desktop. |
| func (a *application) settingsHub(w http.ResponseWriter, r *http.Request) { |
| + a.settingsSection(w, r, "thinking", true) |
| +} |
| + |
| +// settingsSectionHandler serves /conversation/settings/{thinking,housekeeping}. |
| +func (a *application) settingsSectionHandler(section string) http.HandlerFunc { |
| + return func(w http.ResponseWriter, r *http.Request) { a.settingsSection(w, r, section, false) } |
| +} |
| + |
| +func (a *application) settingsSection(w http.ResponseWriter, r *http.Request, section string, root bool) { |
| w.Header().Set("Cache-Control", "no-store") |
| ctx, address, ok := sessionContext(r) |
| if !ok { |
| a.failure(w, r, ErrForbidden) |
| return |
| } |
| - words, err := a.store.Chat().Thinking(ctx, address) |
| - if err != nil { |
| - a.failure(w, r, chatError(err)) |
| - return |
| - } |
| - prefer, err := a.store.Chat().Preference(ctx, address) |
| - if err != nil { |
| - a.failure(w, r, chatError(err)) |
| - return |
| - } |
| - data, err := a.page(r, "settings-hub") |
| + data, err := a.settingsPage(r, section, root) |
| if err != nil { |
| a.failure(w, r, err) |
| return |
| } |
| - data.Title = "nav.settings" |
| - h, err := a.store.Chat().Housekeeping(ctx, address) |
| - if err != nil { |
| - a.failure(w, r, chatError(err)) |
| - return |
| + switch section { |
| + case "thinking": |
| + words, err := a.store.Chat().Thinking(ctx, address) |
| + if err != nil { |
| + a.failure(w, r, chatError(err)) |
| + return |
| + } |
| + data.Settings.Thinking = thinkingView{ThinkingWords: words, JSON: thinkingJSON(words.Sets)} |
| + case "housekeeping": |
| + h, err := a.store.Chat().Housekeeping(ctx, address) |
| + if err != nil { |
| + a.failure(w, r, chatError(err)) |
| + return |
| + } |
| + data.HousekeepingSettings = housekeepingSettings(h) |
| } |
| - data.HousekeepingSettings = housekeepingSettings(h) |
| - data.Settings = settingsHubView{Thinking: thinkingView{ThinkingWords: words, JSON: thinkingJSON(words.Sets), Saved: r.URL.Query().Get("saved") == "1"}, Prefer: preferControl(prefer)} |
| render(w, "settings_hub", data) |
| } |
| + |
| +// movedTo answers an old Settings URL with its section's. |
| +func movedTo(path string) http.HandlerFunc { |
| + return func(w http.ResponseWriter, r *http.Request) { |
| + http.Redirect(w, r, path, http.StatusSeeOther) |
| + } |
| +} |
diff --git a/internal/equipo/static/connections.js b/internal/equipo/static/connections.js| index a047f56d..91668e00 100644 |
| --- a/internal/equipo/static/connections.js |
| +++ b/internal/equipo/static/connections.js |
| @@ -177,10 +177,29 @@ |
| if (seg) seg.querySelectorAll("button").forEach(function (b) { b.setAttribute("aria-pressed", String(form.contains(b))); }); |
| } |
| fetch(form.action, { method: "POST", credentials: "same-origin", headers: { "Accept": "application/json" }, body: new URLSearchParams(new FormData(form)) }) |
| - .then(function (r) { if (!r.ok) throw new Error("post"); refreshSoon(); }) |
| + .then(function (r) { |
| + if (!r.ok) throw new Error("post"); |
| + if (form.matches('[action$="/prefer"]')) saved(); |
| + refreshSoon(); |
| + }) |
| .catch(function () { form.submit(); }); |
| }); |
| + // A preference saved: the quiet tick by the heading, as in Settings. |
| + function saved() { |
| + var tpl = document.querySelector("template[equipo-saved-template]"); |
| + var head = root.querySelector("h1"); |
| + if (!tpl || !head) return; |
| + var t = head.querySelector("[equipo-saved-tick]"); |
| + if (!t) { |
| + t = tpl.content.firstElementChild.cloneNode(true); |
| + head.append(t); |
| + } |
| + t.removeAttribute("data-gone"); |
| + t.setAttribute("data-shown", ""); |
| + clearTimeout(t.timer); |
| + t.timer = setTimeout(function () { t.setAttribute("data-gone", ""); }, 2400); |
| + } |
| live(root); |
| if (!window.EventSource) return; |
| var source, failures = 0; |
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css| index 05f5e657..e8b62252 100644 |
| --- a/internal/equipo/static/equipo.css |
| +++ b/internal/equipo/static/equipo.css |
| @@ -1106,3 +1106,38 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-mark] [data-m="1"] { --dx: .9em; --dy: -.6em; --d: .3s; --dur: 4.6s; } |
| [equipo-mark] [data-m="2"] { --dx: 1.5em; --dy: -.1em; --d: 2.1s; --dur: 5.7s; } |
| [equipo-mark] [data-m="3"] { --dx: 1.1em; --dy: .5em; --d: 3.8s; --dur: 5.1s; } |
| +/* Settings (Paul, 2026-11-09): a menu of its sections. On a desktop the |
| + menu is a second sidebar beside the section, the current one marked; |
| + on a phone /conversation/settings is the menu as full-row drill-ins, |
| + drawn as the home screen's grouped nav, and a section is its own page |
| + with the way back to Settings in the bar. */ |
| +[equipo-settings-layout] { display: grid; gap: var(--rst-sp-6); align-items: start; max-inline-size: 66rem; } |
| +[equipo-settings-nav] ul { list-style: none; margin: 0; padding: 0; display: grid; } |
| +[equipo-settings-nav-title] { margin: 0 0 var(--rst-sp-3); font-size: var(--rst-fs-sm); font-weight: 600; color: var(--rst-text-muted); } |
| +[equipo-settings-link] { display: flex; align-items: center; gap: var(--rst-sp-3); color: var(--rst-text); text-decoration: none; } |
| +[equipo-settings-link] > .icon:first-child { flex: none; inline-size: 1.05rem; block-size: 1.05rem; margin: 0; color: var(--rst-text-muted); } |
| +[equipo-settings-link] > span { flex: 1; min-inline-size: 0; } |
| +[equipo-settings-link] > .icon:last-child { flex: none; inline-size: 1rem; block-size: 1rem; margin: 0; color: var(--rst-text-faint); } |
| +[equipo-settings-body] { min-inline-size: 0; } |
| +@media (min-width: 800px) { |
| + [equipo-settings-layout] { grid-template-columns: 13rem minmax(0, 1fr); } |
| + [equipo-settings-nav] { position: sticky; inset-block-start: var(--rst-sp-4); } |
| + [equipo-settings-link] { min-block-size: 2.25rem; padding: 0 var(--rst-sp-3); border-radius: var(--rst-radius); font-size: var(--rst-fs-sm); } |
| + [equipo-settings-link]:hover { background: var(--rst-tint-hover, var(--rst-surface-2)); } |
| + [equipo-settings-link][aria-current="page"] { background: var(--rst-nav-current-bg, var(--rst-accent-soft)); color: var(--rst-nav-current-fg, var(--rst-text)); font-weight: 600; } |
| + [equipo-settings-link][aria-current="page"] > .icon:first-child { color: currentColor; } |
| + [equipo-settings-link] > .icon:last-child { display: none; } |
| +} |
| +@media (max-width: 799.98px) { |
| + [equipo-settings-layout] { gap: 0; } |
| + /* The root is the menu; a section hides it (its bar leads back). */ |
| + [equipo-settings-layout][data-root] [equipo-settings-body] { display: none; } |
| + [equipo-settings-layout]:not([data-root]) [equipo-settings-nav] { display: none; } |
| + [equipo-settings-nav-title] { margin: var(--rst-sp-4) 0 var(--rst-sp-2); padding: 0 1rem; font-size: var(--rst-fs-sm); font-weight: 400; line-height: 1.3; } |
| + [equipo-settings-link] { box-sizing: border-box; min-block-size: 3rem; padding: 0 .75rem 0 1rem; background: var(--rst-surface); border: 1px solid var(--rst-line); border-block-start-width: 0; font-size: 1rem; font-weight: 450; } |
| + [equipo-settings-nav] li:first-child [equipo-settings-link] { border-block-start-width: 1px; border-start-start-radius: var(--rst-radius); border-start-end-radius: var(--rst-radius); } |
| + [equipo-settings-nav] li:last-child [equipo-settings-link] { border-end-start-radius: var(--rst-radius); border-end-end-radius: var(--rst-radius); } |
| + [equipo-settings-link]:active { background: var(--rst-tint-press, var(--rst-surface-2)); } |
| +} |
| +/* The Notebook page keeps its columns (a later rule makes the project page's notes a grid). */ |
| +[equipo-notebook] [equipo-notes] { display: block; } |
diff --git a/internal/equipo/static/settings.js b/internal/equipo/static/settings.js| index 86166cda..906e77ea 100644 |
| --- a/internal/equipo/static/settings.js |
| +++ b/internal/equipo/static/settings.js |
| @@ -9,7 +9,7 @@ |
| "use strict"; |
| var root = document.querySelector("[data-settings-live]"); |
| if (!root || !window.fetch) return; |
| - var swaps = ["[equipo-conn-prefer]", "[data-hk-settings]"]; |
| + var swaps = ["[equipo-conn-prefer]", "[data-hk-settings]", "[equipo-notebook]"]; |
| var template = document.querySelector("template[equipo-saved-template]"); |
| root.addEventListener("submit", function (event) { |
| var form = event.target; |
| @@ -33,7 +33,8 @@ |
| .then(function (html) { |
| refresh(form, new DOMParser().parseFromString(html, "text/html")); |
| section.removeAttribute("aria-busy"); |
| - tick(section); |
| + // The section itself may have been put back (the notebook). |
| + tick((section.id && document.getElementById(section.id)) || section); |
| }) |
| .catch(function () { |
| // The server's own answer, as without script. |
diff --git a/internal/equipo/templates/chat.html b/internal/equipo/templates/chat.html| index 7aa406db..2fa8c32d 100644 |
| --- a/internal/equipo/templates/chat.html |
| +++ b/internal/equipo/templates/chat.html |
| @@ -13,7 +13,7 @@ |
| {{define "message-files"}}{{with .}}<div equipo-message-files>{{range .}}{{if eq .Kind "image"}}<a equipo-file-thumb href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}"><img src="/conversation/attachments/{{.ID}}/preview" alt="{{.Name}}"{{if .Width}} width="{{.Width}}" height="{{.Height}}"{{end}} loading="lazy" decoding="async"></a>{{else}}<a equipo-file-chip href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}">{{icon "file-text"}}<span equipo-file-name>{{.Name}}</span><span equipo-file-size>{{fileSize .Size}}</span></a>{{end}}{{end}}</div>{{end}}{{end}} |
| {{define "content"}} |
| <div equipo-conversation data-chat-stream data-thinking-set="{{.ThinkingSet}}" data-thinking-words="{{.ThinkingWords}}" data-cursor="{{.Chat.Cursor}}" data-person="{{.Address}}" data-elapsed="{{copy "chat.elapsed"}}" data-moving-in="{{copy "chat.moving_in"}}" data-exploring="{{copy "chat.exploring"}}"> |
| -<header equipo-chat-header><h1>{{copy "conversation.title"}}</h1><a href="/conversation/notebook" equipo-header-button aria-label="{{copy "chat.notebook.link"}}" title="{{copy "chat.notebook.link"}}">{{icon "notebook"}}</a><a href="/housekeeping" equipo-header-button aria-label="{{copy "chat.housekeeping.link"}}" title="{{copy "chat.housekeeping.link"}}" data-housekeeping-link>{{icon "list-checks"}}</a><a href="/conversation/connections" equipo-header-button aria-label="{{copy "chat.connections.title"}}" title="{{copy "chat.connections.title"}}" data-connections-link>{{icon "plug"}}</a></header> |
| +<header equipo-chat-header><h1>{{copy "conversation.title"}}</h1><a href="/conversation/settings/notebook" equipo-header-button aria-label="{{copy "chat.notebook.link"}}" title="{{copy "chat.notebook.link"}}">{{icon "notebook"}}</a><a href="/housekeeping" equipo-header-button aria-label="{{copy "chat.housekeeping.link"}}" title="{{copy "chat.housekeeping.link"}}" data-housekeeping-link>{{icon "list-checks"}}</a><a href="/conversation/settings/connections" equipo-header-button aria-label="{{copy "chat.connections.title"}}" title="{{copy "chat.connections.title"}}" data-connections-link>{{icon "plug"}}</a></header> |
| <p equipo-offline role="status"{{if not .Chat.Offline}} hidden{{end}}>{{copy "chat.offline"}}</p> |
| <div equipo-scroll tabindex="0" role="region" aria-label="{{copy "conversation.title"}}"> |
| <section id="conversation-feed"> |
| @@ -36,7 +36,7 @@ |
| {{range .Cards}}{{template "chat-card" .}}{{end}}{{end}} |
| {{else}}<li data-empty-state="conversation.empty">{{copy "conversation.empty"}}</li>{{end}} |
| {{range .Chat.Waiting}}<li equipo-message="incoming" equipo-thinking data-turn="{{.ID}}"{{with .Kind}} data-kind="{{.}}"{{end}} data-started="{{.CreatedAt.UnixMilli}}" aria-busy="true"><div equipo-message-meta><strong>{{icon "message-circle"}}{{copy "conversation.coordinator"}}</strong><time></time></div><div equipo-bubble><div equipo-message-body equipo-markdown data-stream-text></div><p equipo-activity-line><span equipo-activity>{{if eq .Kind "move_in"}}{{copy "chat.moving_in"}}{{else if eq .Kind "explore"}}{{copy "chat.exploring"}}{{else}}{{copy "chat.activity.thinking"}}{{end}}</span><span equipo-activity-sep aria-hidden="true">·</span><span equipo-elapsed></span></p></div></li>{{end}} |
| -{{with .Chat.NoConnection}}<li equipo-card="no_connection" data-no-connection="{{.TurnID}}"><p equipo-card-line>{{.Line}}</p><p equipo-actions><a rst-btn="primary" href="/conversation/connections" data-add-connection>{{copy "chat.no_connection.add"}}</a></p></li>{{end}} |
| +{{with .Chat.NoConnection}}<li equipo-card="no_connection" data-no-connection="{{.TurnID}}"><p equipo-card-line>{{.Line}}</p><p equipo-actions><a rst-btn="primary" href="/conversation/settings/connections" data-add-connection>{{copy "chat.no_connection.add"}}</a></p></li>{{end}} |
| {{with .Chat.Ended}}<li equipo-system-note data-ended="{{.ID}}"><p>{{copy .Key}}</p></li>{{end}} |
| </ol> |
| </section> |
diff --git a/internal/equipo/templates/housekeeping.html b/internal/equipo/templates/housekeeping.html| index eb592d33..5618a5a3 100644 |
| --- a/internal/equipo/templates/housekeeping.html |
| +++ b/internal/equipo/templates/housekeeping.html |
| @@ -4,7 +4,7 @@ |
| {{define "content"}}{{with .Housekeeping}} |
| <section equipo-notebook equipo-hk data-housekeeping data-work-live data-work-region id="housekeeping-view"{{if .Paused}} data-paused{{end}}> |
| <header equipo-notebook-head equipo-hk-head><div><h1>{{copy "housekeeping.title"}}</h1><p>{{copy "housekeeping.lede"}}</p></div> |
| -<p equipo-hk-to-settings><a href="/conversation/settings#housekeeping" data-hk-settings-link>{{copy "housekeeping.settings_link"}}</a></p></header> |
| +<p equipo-hk-to-settings><a href="/conversation/settings/housekeeping" data-hk-settings-link>{{copy "housekeeping.settings_link"}}</a></p></header> |
| {{if .Paused}}<p equipo-hk-paused role="status">{{copy "housekeeping.paused"}}</p>{{end}} |
| <section equipo-hk-part aria-labelledby="hk-today"><h2 id="hk-today">{{copy "housekeeping.today"}}</h2> |
| <ul equipo-hk-meters role="list">{{range .Meters}}<li equipo-conn-meter data-hk-meter><span>{{.Label}}</span><span equipo-conn-bar aria-hidden="true"><i data-w="{{.Percent}}"></i></span><span><b>{{.Used}}</b>{{with .Held}}, {{.}}{{end}}</span></li>{{end}}</ul></section> |
diff --git a/internal/equipo/templates/models.html b/internal/equipo/templates/models.html| index 9f60450c..445c6f8f 100644 |
| --- a/internal/equipo/templates/models.html |
| +++ b/internal/equipo/templates/models.html |
| @@ -1,5 +1,5 @@ |
| -{{define "up-label"}}{{copy "conversation.title"}}{{end}} |
| -{{define "up"}}/conversation{{end}} |
| +{{define "up-label"}}{{template "settings-up-label" .}}{{end}} |
| +{{define "up"}}{{template "settings-up" .}}{{end}} |
| {{define "title"}}{{copy "chat.connections.title"}}{{end}} |
| {{define "conn-star"}}<span equipo-sparkle data-conn-star aria-hidden="true"><svg viewBox="0 0 16 16" focusable="false"><path d="M8 0C8.6 4.6 11.4 7.4 16 8 11.4 8.6 8.6 11.4 8 16 7.4 11.4 4.6 8.6 0 8 4.6 7.4 7.4 4.6 8 0Z"/><circle cx="8" cy="8" r="1.7"/></svg><i data-sat="1"></i><i data-sat="2"></i><i data-sat="3"></i></span>{{end}} |
| {{define "conn-mark"}}<span equipo-pmark data-provider="{{.}}" aria-hidden="true">{{if eq . "claude"}}Cl{{else if eq . "codex"}}Cx{{else if eq . "mistral"}}Mi{{else if eq . "tensorx"}}Tx{{else}}{{icon "cpu"}}{{end}}</span>{{end}} |
| @@ -59,7 +59,10 @@ |
| </article>{{end}} |
| {{define "conn-quiet"}}{{if .MakePreferred}}<form method="post" action="/conversation/connections/prefer" equipo-inline-form><input type="hidden" name="provider" value="{{.Provider}}"><input type="hidden" name="revision" value="{{.PreferRevision}}"><button type="submit" data-make-preferred>{{copy "chat.connections.make_preferred"}}</button></form>{{end}}{{if .SignOut}}<form method="post" action="/conversation/connections/{{.ID}}/sign-out" equipo-inline-form><button type="submit" data-danger data-sign-out>{{copy "chat.connections.sign_out"}}</button></form>{{end}}{{if .Forget}}<form method="post" action="/conversation/connections/{{.ID}}/forget" equipo-inline-form><button type="submit" data-danger data-forget>{{copy "chat.connections.forget"}}</button></form>{{end}}{{end}} |
| {{define "content"}} |
| -<section equipo-connections data-connections data-cursor="{{.Models.Cursor}}" data-connected="{{copy "chat.connections.connected_big"}}" data-connected-next="{{copy "chat.connections.connected_next"}}"> |
| +<div equipo-settings-layout data-section="connections"> |
| +<template equipo-saved-template><span equipo-saved-tick role="status">{{icon "check"}}<span>{{copy "settings.saved"}}</span></span></template> |
| +{{template "settings-nav" .}} |
| +<section equipo-settings-body equipo-connections data-connections data-cursor="{{.Models.Cursor}}" data-connected="{{copy "chat.connections.connected_big"}}" data-connected-next="{{copy "chat.connections.connected_next"}}"> |
| <header equipo-conn-page-head><h1>{{copy "chat.connections.title"}}</h1>{{if .Models.Rows}}<p>{{copy "chat.connections.lede"}}</p>{{end}}</header> |
| {{if .Models.Offline}}<p equipo-offline role="status">{{copy "chat.connections.offline"}}</p>{{end}} |
| <div data-connections-live> |
| @@ -80,9 +83,10 @@ |
| <div hidden data-connection-list></div> |
| </section>{{end}} |
| </div> |
| -{{if .Models.Connecting}}<noscript><p equipo-conn-small><a href="/conversation/connections">{{copy "chat.connections.check_again"}}</a></p></noscript>{{end}} |
| +{{if .Models.Connecting}}<noscript><p equipo-conn-small><a href="/conversation/settings/connections">{{copy "chat.connections.check_again"}}</a></p></noscript>{{end}} |
| </section> |
| <template data-loading-template>{{template "conn-attempt" (loadingLine "codex")}}</template> |
| <template data-loading-template-claude>{{template "conn-attempt" (loadingLine "claude")}}</template> |
| <template data-success-template><div equipo-conn-card data-success aria-live="polite"><div equipo-conn-success><span equipo-conn-burst>{{template "conn-star"}}</span><p equipo-conn-big data-success-title></p><p equipo-conn-account data-success-account></p></div></div></template> |
| +</div> |
| {{end}} |
diff --git a/internal/equipo/templates/notebook.html b/internal/equipo/templates/notebook.html| index 48385572..38c57fd8 100644 |
| --- a/internal/equipo/templates/notebook.html |
| +++ b/internal/equipo/templates/notebook.html |
| @@ -1,10 +1,14 @@ |
| -{{define "up-label"}}{{copy "conversation.title"}}{{end}} |
| -{{define "up"}}/conversation{{end}} |
| +{{define "up-label"}}{{template "settings-up-label" .}}{{end}} |
| +{{define "up"}}{{template "settings-up" .}}{{end}} |
| {{define "title"}}{{copy "chat.notebook.title"}}{{end}} |
| {{define "content"}} |
| -<section equipo-notebook> |
| +<div equipo-settings-layout data-section="notebook" data-settings-live> |
| +<template equipo-saved-template><span equipo-saved-tick role="status">{{icon "check"}}<span>{{copy "settings.saved"}}</span></span></template> |
| +{{template "settings-nav" .}} |
| +<section equipo-notebook equipo-settings-body equipo-settings-section id="notebook"> |
| <header equipo-notebook-head><h1>{{copy "chat.notebook.title"}}</h1><p>{{copy "chat.notebook.lede"}}</p></header> |
| {{if .Notebook}}<ul equipo-notes role="list">{{range .Notebook}}<li equipo-note{{if .Said}} data-said{{end}}>{{if .Said}}<blockquote><p>{{.Text}}</p></blockquote>{{else}}<p>{{.Text}}</p>{{end}}<p equipo-note-caption><span>{{.Who}}</span><time datetime="{{.At.UTC.Format "2006-01-02"}}">{{.Day}}</time></p></li>{{end}}</ul>{{else}}<p data-empty-state="chat.notebook.empty">{{copy "chat.notebook.empty"}}</p>{{end}} |
| <footer equipo-notebook-foot><form method="post" action="/conversation/notebook/reset"><button equipo-link type="submit" data-notebook-reset>{{copy "chat.notebook.reset"}}</button></form><p>{{copy "chat.notebook.reset_help"}}</p></footer> |
| </section> |
| +</div> |
| {{end}} |
diff --git a/internal/equipo/templates/settings.html b/internal/equipo/templates/settings.html| index bde94ddb..1404a37e 100644 |
| --- a/internal/equipo/templates/settings.html |
| +++ b/internal/equipo/templates/settings.html |
| @@ -1,7 +1,7 @@ |
| {{define "content"}} |
| <a href="/settings/devices">{{copy "device.list"}}</a> |
| <a href="/settings/coordinator">{{copy "coordinator.settings"}}</a> |
| -<a href="/conversation/connections" data-connections-link>{{copy "chat.connections.title"}}</a> |
| +<a href="/conversation/settings/connections" data-connections-link>{{copy "chat.connections.title"}}</a> |
| <a href="/preferences">{{copy "preferences.title"}}</a>{{if .Owner}}<a href="/settings/recovery">{{copy "recovery.title"}}</a>{{end}} |
| <h1>{{copy "nav.settings"}}</h1> |
| <p>{{copy "account.note"}}</p> |
diff --git a/internal/equipo/templates/settings_hub.html b/internal/equipo/templates/settings_hub.html| index 378936da..964b16ae 100644 |
| --- a/internal/equipo/templates/settings_hub.html |
| +++ b/internal/equipo/templates/settings_hub.html |
| @@ -1,21 +1,16 @@ |
| -{{define "title"}}{{copy "nav.settings"}}{{end}} |
| +{{define "up"}}{{template "settings-up" .}}{{end}} |
| +{{define "up-label"}}{{template "settings-up-label" .}}{{end}} |
| +{{define "title"}}{{if eq .Settings.Section "housekeeping"}}{{copy "settings.housekeeping"}}{{else if .Settings.Root}}{{copy "nav.settings"}}{{else}}{{copy "thinking.title"}}{{end}}{{end}} |
| {{define "content"}} |
| -<section equipo-inner equipo-settings data-settings-live> |
| +<div equipo-settings-layout data-section="{{.Settings.Section}}"{{if .Settings.Root}} data-root{{end}} data-settings-live> |
| <template equipo-saved-template><span equipo-saved-tick role="status">{{icon "check"}}<span>{{copy "settings.saved"}}</span></span></template> |
| -<div equipo-page-head><h1>{{copy "nav.settings"}}</h1></div> |
| -<section equipo-settings-section id="thinking"><h2>{{copy "thinking.title"}}</h2> |
| +{{template "settings-nav" .}} |
| +<section equipo-settings-body equipo-settings-section id="{{.Settings.Section}}"> |
| +{{if eq .Settings.Section "thinking"}}<div equipo-page-head><h1>{{copy "thinking.title"}}</h1></div> |
| {{template "thinking-form" (dict "Thinking" .Settings.Thinking "From" "settings")}} |
| -</section> |
| -<section equipo-settings-section id="connections"><h2>{{copy "settings.connections"}}</h2> |
| -<ol equipo-rows><li equipo-row equipo-setting-row><span equipo-mono data-size="s" aria-hidden="true">{{icon "plug"}}</span><div equipo-row-body><p equipo-row-title><a equipo-row-link href="/conversation/connections" data-connections-link>{{copy "settings.connections_open"}}</a></p><p equipo-desc>{{copy "settings.connections_about"}}</p></div></li></ol> |
| -{{with .Settings.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="{{$.Settings.Prefer.Revision}}"><input type="hidden" name="from" value="settings"><button type="submit" aria-pressed="{{.On}}" data-prefer="{{.Value}}">{{.Label}}</button></form>{{end}}</span><span equipo-conn-hint>{{.Hint}}</span></div>{{end}} |
| -</section> |
| -<section equipo-settings-section id="housekeeping" data-settings-slot="housekeeping"><h2>{{copy "settings.housekeeping"}}</h2> |
| +{{else if eq .Settings.Section "housekeeping"}}<div equipo-page-head><h1>{{copy "settings.housekeeping"}}</h1></div> |
| {{with .HousekeepingSettings}}{{template "housekeeping-settings" .}}{{end}} |
| +{{end}} |
| </section> |
| -<section equipo-settings-section id="notebook"><h2>{{copy "settings.notebook"}}</h2> |
| -<ol equipo-rows><li equipo-row equipo-setting-row><span equipo-mono data-size="s" aria-hidden="true">{{icon "notebook"}}</span><div equipo-row-body><p equipo-row-title><a equipo-row-link href="/conversation/notebook">{{copy "settings.notebook_open"}}</a></p><p equipo-desc>{{copy "settings.notebook_about"}}</p></div></li> |
| -<li equipo-row equipo-setting-row><span equipo-mono data-size="s" aria-hidden="true">{{icon "users"}}</span><div equipo-row-body><p equipo-row-title><a equipo-row-link href="/teams">{{copy "settings.teams_open"}}</a></p><p equipo-desc>{{copy "settings.teams_about"}}</p></div></li></ol> |
| -</section> |
| -</section> |
| +</div> |
| {{end}} |
diff --git a/internal/equipo/templates/settings_nav.html b/internal/equipo/templates/settings_nav.html| new file mode 100644 |
| index 00000000..a3b922e9 |
| --- /dev/null |
| +++ b/internal/equipo/templates/settings_nav.html |
| @@ -0,0 +1,3 @@ |
| +{{define "settings-nav"}}<nav equipo-settings-nav aria-label="{{copy "nav.settings"}}"><h2 equipo-settings-nav-title>{{copy "nav.settings"}}</h2><ul role="list">{{range .SettingsNav}}<li><a href="{{.Href}}" equipo-settings-link data-settings-link="{{.Key}}"{{if .Current}} aria-current="page"{{end}}>{{icon .Icon}}<span>{{copy .CopyKey}}</span>{{icon "chevron-right"}}</a></li>{{end}}</ul></nav>{{end}} |
| +{{define "settings-up"}}{{if .Settings.Root}}/work#nav-settings-hub{{else}}/conversation/settings{{end}}{{end}} |
| +{{define "settings-up-label"}}{{if .Settings.Root}}{{.TeamName}}{{else}}{{copy "nav.settings"}}{{end}}{{end}} |
diff --git a/internal/equipo/templates/thinking_words.html b/internal/equipo/templates/thinking_words.html| deleted file mode 100644 |
| index d70e46a2..00000000 |
| --- a/internal/equipo/templates/thinking_words.html |
| +++ /dev/null |
| @@ -1,4 +0,0 @@ |
| -{{define "title"}}{{copy "thinking.title"}}{{end}} |
| -{{define "content"}} |
| -<section equipo-inner>{{template "thinking-form" (dict "Thinking" .Thinking "From" "")}}</section> |
| -{{end}} |
diff --git a/internal/equipo/thinking_words.go b/internal/equipo/thinking_words.go| index 2dc306d8..c54037e3 100644 |
| --- a/internal/equipo/thinking_words.go |
| +++ b/internal/equipo/thinking_words.go |
| @@ -40,39 +40,12 @@ type thinkingView struct { |
| Saved bool |
| } |
| -// thinkingPage is GET /settings/thinking: the sets, a live preview, and |
| -// the person's choice. |
| -func (a *application) thinkingPage(w http.ResponseWriter, r *http.Request) { |
| - w.Header().Set("Cache-Control", "no-store") |
| - ctx, address, ok := sessionContext(r) |
| - if !ok { |
| - a.failure(w, r, ErrForbidden) |
| - return |
| - } |
| - words, err := a.store.Chat().Thinking(ctx, address) |
| - if err != nil { |
| - a.failure(w, r, chatError(err)) |
| - return |
| - } |
| - data, err := a.page(r, "thinking") |
| - if err != nil { |
| - a.failure(w, r, err) |
| - return |
| - } |
| - data.Title = "thinking.title" |
| - data.Thinking = thinkingView{ThinkingWords: words, JSON: thinkingJSON(words.Sets), Saved: r.URL.Query().Get("saved") == "1"} |
| - render(w, "thinking_words", data) |
| -} |
| - |
| // thinkingSave is POST /settings/thinking: the same SetThinking a device |
| // makes, as the session's person. |
| func (a *application) thinkingSave(w http.ResponseWriter, r *http.Request) { |
| revision, _ := strconv.ParseInt(r.PostFormValue("revision"), 10, 64) |
| set := r.PostFormValue("set") |
| - back := "/settings/thinking?saved=1" |
| - if r.PostFormValue("from") == "settings" { |
| - back = "/conversation/settings?saved=1#thinking" |
| - } |
| + back := "/conversation/settings/thinking" |
| a.chatActionTo(w, r, back, func(ctx context.Context, address string) error { |
| _, err := a.store.Chat().SetThinking(ctx, address, wire.ThinkingChoice{Set: set, Revision: revision}) |
| return err |
diff --git a/internal/headless/browser_notebook_test.go b/internal/headless/browser_notebook_test.go| index 09c1bf9a..e6e98bff 100644 |
| --- a/internal/headless/browser_notebook_test.go |
| +++ b/internal/headless/browser_notebook_test.go |
| @@ -58,7 +58,7 @@ func TestNotebookScreenshots(t *testing.T) { |
| for _, view := range []string{"conversation", "notebook"} { |
| path := "/conversation" |
| if view == "notebook" { |
| - path = "/conversation/notebook" |
| + path = "/conversation/settings/notebook" |
| } |
| p.run(chromedp.Navigate(inst.URL+path), browsertest.Wait(`document.readyState==='complete'`)) |
| p.theme(theme) |
| @@ -93,7 +93,7 @@ func TestBrowserNotebookLook(t *testing.T) { |
| for _, theme := range []string{"light", "dark"} { |
| p.run(chromedp.Navigate(inst.URL+"/conversation"), browsertest.Wait(`!!document.querySelector('[data-chat-stream]')`)) |
| p.theme(theme) |
| - p.check(`(()=>{const b=document.querySelector('[equipo-chat-header] a[equipo-header-button][href="/conversation/notebook"]');if(!b)return false;const r=b.getBoundingClientRect();return b.getAttribute('aria-label')==='Notebook' && b.title==='Notebook' && !!b.querySelector('svg') && b.textContent.trim()==='' && getComputedStyle(b).cursor==='pointer' && (`+strconv.FormatBool(width < 600)+` ? r.width>=44 && r.height>=44 : r.width>=24)})()`, "header button") |
| + p.check(`(()=>{const b=document.querySelector('[equipo-chat-header] a[equipo-header-button][href="/conversation/settings/notebook"]');if(!b)return false;const r=b.getBoundingClientRect();return b.getAttribute('aria-label')==='Notebook' && b.title==='Notebook' && !!b.querySelector('svg') && b.textContent.trim()==='' && getComputedStyle(b).cursor==='pointer' && (`+strconv.FormatBool(width < 600)+` ? r.width>=44 && r.height>=44 : r.width>=24)})()`, "header button") |
| // Keyboard: Tab reaches the button, and its focus shows. |
| for i := 0; i < 30; i++ { |
| var on bool |
| @@ -108,7 +108,7 @@ func TestBrowserNotebookLook(t *testing.T) { |
| p.run(chromedp.KeyEvent("\t")) |
| } |
| p.check(`document.activeElement.hasAttribute('equipo-header-button') && getComputedStyle(document.activeElement).outlineStyle!=='none'`, "keyboard focus on the Notebook button") |
| - p.run(chromedp.KeyEvent("\r"), browsertest.Wait(`location.pathname==='/conversation/notebook'`)) |
| + p.run(chromedp.KeyEvent("\r"), browsertest.Wait(`location.pathname==='/conversation/settings/notebook'`)) |
| p.theme(theme) |
| p.check(`(()=>{const ns=[...document.querySelectorAll('[equipo-notes] > [equipo-note]')];if(ns.length!==5)return false;const page=getComputedStyle(document.body).backgroundColor;return ns.every(n=>{const s=getComputedStyle(n);return s.borderTopWidth==='1px'&&s.borderLeftWidth==='1px'&&s.borderLeftColor===s.borderTopColor&&s.boxShadow!=='none'&&s.backgroundColor!==page&&n.querySelector('[equipo-note-caption] time')})})()`, "notes are not paper cards") |
| p.check(`(()=>{const q=document.querySelector('[equipo-note][data-said] blockquote p');return !!q && q.textContent.startsWith('I like short replies') && getComputedStyle(q,'::before').content==='"“"' && q.closest('[equipo-note]').querySelector('[equipo-note-caption]').textContent.includes('You said')})()`, "the person's words are not a quote") |
diff --git a/internal/headless/browser_receipts_test.go b/internal/headless/browser_receipts_test.go| index 28c4abbd..6c5576a6 100644 |
| --- a/internal/headless/browser_receipts_test.go |
| +++ b/internal/headless/browser_receipts_test.go |
| @@ -143,10 +143,14 @@ func TestBrowserNotebook(t *testing.T) { |
| p := openPage(t, inst.URL, c.Name, c.Value, 1280, 900, true) |
| defer p.stop() |
| p.run(browsertest.Wait(`[...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator"))`)) |
| - p.check(`(()=>{const a=document.querySelector('[equipo-chat-header] a[href="/conversation/notebook"]');if(!a)return false;a.click();return true})()`, "no Notebook link in the header") |
| - p.run(browsertest.Wait(`location.pathname==='/conversation/notebook' && [...document.querySelectorAll('[equipo-note]')].some(e=>e.textContent.includes('From oficina/equipo/README.md'))`)) |
| - p.check(`(()=>{document.querySelector('[data-notebook-reset]').click();return true})()`, "reset") |
| - p.run(browsertest.Wait(`location.pathname==='/conversation'`)) |
| + p.check(`(()=>{const a=document.querySelector('[equipo-chat-header] a[href="/conversation/settings/notebook"]');if(!a)return false;a.click();return true})()`, "no Notebook link in the header") |
| + p.run(browsertest.Wait(`location.pathname==='/conversation/settings/notebook' && [...document.querySelectorAll('[equipo-note]')].some(e=>e.textContent.includes('From oficina/equipo/README.md'))`)) |
| + // Reset saves in place, as every Settings change does: the notebook |
| + // empties, "Saved", no navigation; the conversation then has the new |
| + // coordinator's introduction. |
| + p.check(`(()=>{window.__stay=1;document.querySelector('[data-notebook-reset]').click();return true})()`, "reset") |
| + p.run(browsertest.Wait(`window.__stay===1 && location.pathname==='/conversation/settings/notebook' && !document.querySelector('[equipo-note]') && !!document.querySelector('#notebook [equipo-saved-tick][data-shown]')`)) |
| + p.run(chromedp.Navigate(inst.URL + "/conversation")) |
| p.run(browsertest.Wait(`[...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].filter(e=>e.textContent.includes("I'm your coordinator")).length===2`)) |
| } |
diff --git a/internal/thintest/gallery_test.go b/internal/thintest/gallery_test.go| index 444932b3..f013150f 100644 |
| --- a/internal/thintest/gallery_test.go |
| +++ b/internal/thintest/gallery_test.go |
| @@ -147,6 +147,7 @@ func newGallery(t *testing.T) *gallery { |
| func TestPagesInnerScreens(t *testing.T) { |
| g := newGallery(t) |
| a := g.a |
| + noInlineStyles(t, g) |
| owner := a.inst.Cookie() |
| has := func(page, what string, wants ...string) { |
| t.Helper() |
diff --git a/internal/thintest/housekeeping_browser_test.go b/internal/thintest/housekeeping_browser_test.go| index 13024db1..7a985786 100644 |
| --- a/internal/thintest/housekeeping_browser_test.go |
| +++ b/internal/thintest/housekeeping_browser_test.go |
| @@ -68,7 +68,7 @@ func TestBrowserHousekeeping(t *testing.T) { |
| p.check(`[...document.querySelectorAll('[equipo-hk-action] [equipo-hk-line]')].every(e=>e.textContent.includes('Combined'))`, "action lines") |
| p.check(`[...document.querySelectorAll('[equipo-hk-action] [equipo-hk-meta]')].every(e=>/\d+% alike, \d+ words in common/.test(e.textContent))`, "evidence") |
| p.check(`document.querySelectorAll('[data-detector]').length===2 && !document.querySelector('[data-detector][data-off]')`, "detectors on") |
| - p.check(`document.querySelector('[data-hk-settings-link]').getAttribute('href')==='/conversation/settings#housekeeping'`, "the way to Settings") |
| + p.check(`document.querySelector('[data-hk-settings-link]').getAttribute('href')==='/conversation/settings/housekeeping'`, "the way to Settings") |
| if size.touch { |
| p.check(`[...document.querySelectorAll('[data-hk-undo]')].every(b=>{const r=b.getBoundingClientRect();return r.height>=44&&r.width>0})`, "Undo within reach on touch") |
| } else { |
| @@ -122,7 +122,7 @@ func TestBrowserHousekeeping(t *testing.T) { |
| touch bool |
| }{{1280, 900, false}, {390, 844, true}} { |
| q := openInner(t, r.inst.URL, r.inst.Cookie(), size.w, size.h, size.touch, "light", "no-preference") |
| - q.open("/conversation/settings#housekeeping") |
| + q.open("/conversation/settings/housekeeping") |
| q.check(`!!document.querySelector('[data-hk-settings] [data-hk-pause]') && document.querySelector('[data-hk-activity]').getAttribute('href')==='/housekeeping'`, "the section") |
| q.check(`document.querySelector('[data-hk-quiet-on]').checked && document.querySelector('[data-hk-quiet-from]').value==='22' && document.querySelector('[data-hk-quiet-until]').value==='8'`, "default quiet hours") |
| q.fits("settings") |
| @@ -131,7 +131,7 @@ func TestBrowserHousekeeping(t *testing.T) { |
| } |
| q := openInner(t, r.inst.URL, r.inst.Cookie(), 1280, 900, false, "light", "no-preference") |
| defer q.stop() |
| - q.open("/conversation/settings") |
| + q.open("/conversation/settings/housekeeping") |
| q.check(`(()=>{window.__hkmark=1;document.querySelector('[data-hk-quiet-from]').value='23';document.querySelector('[data-hk-quiet-until]').value='7';return true})()`, "choose hours") |
| q.click(`[data-hk-quiet-save]`) |
| // Saved in the background (Paul: a page post replayed the sliding nav). |
diff --git a/internal/thintest/housekeeping_contract_test.go b/internal/thintest/housekeeping_contract_test.go| index 2050d230..fbc39bd3 100644 |
| --- a/internal/thintest/housekeeping_contract_test.go |
| +++ b/internal/thintest/housekeeping_contract_test.go |
| @@ -135,7 +135,7 @@ func TestContractHousekeepingCombine(t *testing.T) { |
| t.Fatal("no way from the conversation to the view") |
| } |
| // Settings' Housekeeping section: Pause, quiet hours, the activity view. |
| - settings := r.inst.Get(t, "/conversation/settings") |
| + settings := r.inst.Get(t, "/conversation/settings/housekeeping") |
| for _, want := range []string{`id="housekeeping"`, "data-hk-pause", "data-hk-quiet-on", `<option value="22" selected>22:00</option>`, `<option value="8" selected>08:00</option>`, `href="/housekeeping" data-hk-activity`} { |
| if !strings.Contains(settings, want) { |
| t.Fatalf("Settings lacks %q", want) |
diff --git a/internal/thintest/index_browser_test.go b/internal/thintest/index_browser_test.go| index 5cdb3462..d839584c 100644 |
| --- a/internal/thintest/index_browser_test.go |
| +++ b/internal/thintest/index_browser_test.go |
| @@ -37,7 +37,7 @@ func TestBrowserPhoneIndex(t *testing.T) { |
| p.check(`(()=>{const d=document.querySelector('[rst-shell-profile]');d.open=true;const links=[...d.querySelectorAll('a')].map(a=>a.getAttribute('href'));return !links.includes('/settings/thinking') && !!d.querySelector('form[action="/signout"]')})()`, "the profile menu holds more than the person") |
| p.shot("ux1-index-profile-390") |
| p.open("/conversation/settings") |
| - p.check(`['thinking','connections','housekeeping','notebook'].every(id=>!!document.getElementById(id)) && !!document.querySelector('#thinking [data-preview-line]') && !!document.querySelector('#connections [data-prefer]')`, "Settings sections") |
| - p.check(`getComputedStyle(document.querySelector('#notebook [equipo-row-link]'),'::after').cursor==='pointer'`, "Settings rows are not whole-row links") |
| + p.check(`['thinking','connections','housekeeping','notebook','teams'].every(k=>!!document.querySelector('[equipo-settings-nav] [data-settings-link="'+k+'"]'))`, "Settings sections") |
| + p.check(`(()=>{const nav=document.querySelector('[equipo-settings-nav] ul').getBoundingClientRect();return [...document.querySelectorAll('[equipo-settings-link]')].every(a=>a.tagName==='A'&&a.getBoundingClientRect().width>=nav.width-1)})()`, "Settings rows are not whole-row links") |
| p.shot("ux1-settings-390") |
| } |
diff --git a/internal/thintest/inline_style_test.go b/internal/thintest/inline_style_test.go| index fb81552b..0b5fc784 100644 |
| --- a/internal/thintest/inline_style_test.go |
| +++ b/internal/thintest/inline_style_test.go |
| @@ -10,13 +10,14 @@ import ( |
| // it (Paul's staging: avatar hues, meter widths, the mark's motes). |
| var inlineStyle = regexp.MustCompile(`<[^>]*\sstyle=`) |
| -// TestPagesNoInlineStyle: no screen of the gallery renders an inline style |
| +// noInlineStyles: no screen of the gallery renders an inline style |
| // attribute: colours and widths come from classes and data attributes. |
| -func TestPagesNoInlineStyle(t *testing.T) { |
| - g := newGallery(t) |
| +// TestPagesInnerScreens runs it on its gallery (one gallery, one budget). |
| +func noInlineStyles(t *testing.T, g *gallery) { |
| + t.Helper() |
| a := g.a |
| owner := a.inst.Cookie() |
| - paths := []string{"/conversation", "/tasks", "/projects", "/needs-you", "/housekeeping", "/conversation/settings", "/settings/thinking", "/conversation/connections", "/conversation/notebook", "/work"} |
| + paths := []string{"/conversation", "/tasks", "/projects", "/needs-you", "/housekeeping", "/conversation/settings", "/conversation/settings/thinking", "/conversation/settings/connections", "/conversation/settings/housekeeping", "/conversation/settings/notebook", "/work"} |
| for _, id := range []string{g.unchecked, g.stopped, g.noras, g.merging, g.running, g.looking} { |
| if id != "" { |
| paths = append(paths, "/tasks/"+id) |
diff --git a/internal/thintest/settings_browser_test.go b/internal/thintest/settings_browser_test.go| index 26807e5f..186685de 100644 |
| --- a/internal/thintest/settings_browser_test.go |
| +++ b/internal/thintest/settings_browser_test.go |
| @@ -20,8 +20,10 @@ func TestBrowserSettingsStayOnPage(t *testing.T) { |
| touch bool |
| }{{1280, 900, false}, {390, 844, true}} { |
| p := openInner(t, r.inst.URL, r.inst.Cookie(), size.w, size.h, size.touch, "light", "no-preference") |
| - p.open("/conversation/settings") |
| - p.check(`(()=>{window.__page=1;window.__rail=document.querySelector('#rail');window.__swapped=0;addEventListener('pageswap',()=>window.__swapped++);addEventListener('pagereveal',()=>window.__swapped++);return true})()`, "mark") |
| + mark := func() { |
| + t.Helper() |
| + p.check(`(()=>{window.__page=1;window.__rail=document.querySelector('#rail');window.__swapped=0;addEventListener('pageswap',()=>window.__swapped++);addEventListener('pagereveal',()=>window.__swapped++);return true})()`, "mark") |
| + } |
| same := func(what string) { |
| t.Helper() |
| p.check(`window.__page===1 && window.__swapped===0 && document.querySelector('#rail')===window.__rail`, what+": the page or its nav was replaced") |
| @@ -32,6 +34,8 @@ func TestBrowserSettingsStayOnPage(t *testing.T) { |
| } |
| // Thinking words: picking a set saves it. |
| + p.open("/conversation/settings/thinking") |
| + mark() |
| p.check(`(()=>{document.querySelector('#thinking [data-set="terminal"] label').click();return true})()`, "pick Terminal") |
| p.wait(tick("thinking"), "Thinking words saved") |
| same("Thinking words") |
| @@ -44,12 +48,16 @@ func TestBrowserSettingsStayOnPage(t *testing.T) { |
| p.waitFor(func() bool { got, _ := r.client.Thinking(r.ctx); return got.Set == "professional" }, "the second pick saved") |
| same("Thinking words again") |
| - // Prefer: the pressed choice moves in place. |
| - p.check(`(()=>{const b=[...document.querySelectorAll('#connections [data-prefer]')].find(b=>b.getAttribute('aria-pressed')!=='true');window.__want=b.dataset.prefer;b.click();return true})()`, "Prefer") |
| - p.wait(`document.querySelector('#connections [data-prefer="'+window.__want+'"]').getAttribute('aria-pressed')==='true' && `+tick("connections"), "Prefer saved") |
| + // Prefer, on Connections: the pressed choice moves in place. |
| + p.open("/conversation/settings/connections") |
| + mark() |
| + p.check(`(()=>{const b=[...document.querySelectorAll('[data-section="connections"] [data-prefer]')].find(b=>b.getAttribute('aria-pressed')!=='true');window.__want=b.dataset.prefer;b.click();return true})()`, "Prefer") |
| + p.wait(`document.querySelector('[data-section="connections"] [data-prefer="'+window.__want+'"]').getAttribute('aria-pressed')==='true' && !!document.querySelector('[data-section="connections"] [equipo-saved-tick][data-shown]:not([data-gone])')`, "Prefer saved") |
| same("Prefer") |
| // Pause and Resume, then quiet hours. |
| + p.open("/conversation/settings/housekeeping") |
| + mark() |
| p.click(`[data-hk-pause]`) |
| p.wait(`!!document.querySelector('[data-hk-settings][data-paused] [data-hk-resume]') && `+tick("housekeeping"), "paused") |
| same("Pause") |
| @@ -78,3 +86,49 @@ func (p *innerPage) waitFor(cond func() bool, what string) { |
| } |
| p.t.Fatalf("timed out waiting for %s", what) |
| } |
| + |
| +// TestBrowserSettingsMenu: Paul, 2026-11-09: "settings could probably get |
| +// a submenu on mobile and its own menu sidebar on desktop". At 1280 the |
| +// Settings menu is a second sidebar beside the section, the current one |
| +// marked, the app's rail still there, and a section is a link away; at |
| +// 390 /conversation/settings is the menu as full-row drill-ins with |
| +// chevrons, and a section is its own page with Settings in its bar and no |
| +// menu. Light and dark; EQUIPO_BROWSER_ARTIFACTS keeps the shots. |
| +func TestBrowserSettingsMenu(t *testing.T) { |
| + r := newToolRig(t) |
| + for _, scheme := range []string{"light", "dark"} { |
| + // Desktop. |
| + p := openInner(t, r.inst.URL, r.inst.Cookie(), 1280, 900, false, scheme, "no-preference") |
| + p.open("/conversation/settings/thinking") |
| + p.check(`(()=>{const n=document.querySelector('[equipo-settings-nav]').getBoundingClientRect(),b=document.querySelector('[equipo-settings-body]').getBoundingClientRect(),rail=document.querySelector('[rst-shell-rail]').getBoundingClientRect();return n.width>150&&n.right<=b.left&&Math.abs(n.top-b.top)<40&&rail.width>150&&rail.right<=n.left})()`, scheme+" 1280: the menu is not a second sidebar beside the section") |
| + p.check(`(()=>{const c=document.querySelector('[equipo-settings-link][aria-current="page"]'),o=document.querySelector('[equipo-settings-link]:not([aria-current])');return c.dataset.settingsLink==='thinking'&&getComputedStyle(c).backgroundColor!==getComputedStyle(o).backgroundColor&&getComputedStyle(c.querySelector('.icon:last-child')).display==='none'})()`, scheme+" 1280: the current section is not marked") |
| + p.check(`document.querySelector('#rail a[href="/conversation/settings"]').getAttribute('aria-current')==='page'`, scheme+" 1280: the rail does not show Settings") |
| + p.wait(`document.getAnimations().every(a=>a.playState!=='running'||a.effect&&a.effect.getTiming().iterations===Infinity)`, "the slide settled") |
| + p.shot("settings-menu-1280-" + scheme) |
| + p.click(`[data-settings-link="housekeeping"]`) |
| + p.wait(`location.pathname==='/conversation/settings/housekeeping' && document.querySelector('[equipo-settings-link][aria-current="page"]').dataset.settingsLink==='housekeeping' && !!document.querySelector('[data-hk-settings]')`, "Housekeeping from the menu") |
| + p.click(`[data-settings-link="connections"]`) |
| + p.wait(`location.pathname==='/conversation/settings/connections' && !!document.querySelector('[equipo-settings-layout] [data-connections]')`, "Connections from the menu") |
| + p.wait(`document.getAnimations().every(a=>a.playState!=='running'||a.effect&&a.effect.getTiming().iterations===Infinity)`, "the slide settled") |
| + p.shot("settings-connections-1280-" + scheme) |
| + p.stop() |
| + |
| + // Phone. |
| + q := openInner(t, r.inst.URL, r.inst.Cookie(), 390, 844, true, scheme, "no-preference") |
| + q.open("/conversation/settings") |
| + q.check(`(()=>{const ls=[...document.querySelectorAll('[equipo-settings-link]')];const body=document.querySelector('[equipo-settings-body]');return ls.length===5&&ls.every(a=>{const r=a.getBoundingClientRect();return r.height>=44&&r.width>=340&&getComputedStyle(a.querySelector('.icon:last-child')).display!=='none'})&&getComputedStyle(body).display==='none'&&document.documentElement.scrollWidth<=390})()`, scheme+" 390: the menu is not full-row drill-ins") |
| + q.wait(`document.getAnimations().every(a=>a.playState!=='running'||a.effect&&a.effect.getTiming().iterations===Infinity)`, "the slide settled") |
| + q.shot("settings-list-390-" + scheme) |
| + q.click(`[data-settings-link="thinking"]`) |
| + q.wait(`location.pathname==='/conversation/settings/thinking'`, "a section from the menu") |
| + q.check(`(()=>{const back=document.querySelector('[rst-shell-back] a');const nav=document.querySelector('[equipo-settings-nav]');const h=document.querySelector('[equipo-settings-body] h1');return back.getAttribute('href')==='/conversation/settings'&&back.textContent.trim()==='Settings'&&getComputedStyle(nav).display==='none'&&!!h&&h.getBoundingClientRect().top>back.getBoundingClientRect().bottom-1&&document.documentElement.scrollWidth<=390})()`, scheme+" 390: a section has no way back to Settings or still shows the menu") |
| + q.wait(`document.getAnimations().every(a=>a.playState!=='running'||a.effect&&a.effect.getTiming().iterations===Infinity)`, "the slide settled") |
| + q.shot("settings-thinking-390-" + scheme) |
| + q.click(`[rst-shell-back] a`) |
| + q.wait(`location.pathname==='/conversation/settings' && getComputedStyle(document.querySelector('[equipo-settings-nav]')).display!=='none'`, "back to the menu") |
| + q.open("/conversation/settings/housekeeping") |
| + q.wait(`document.getAnimations().every(a=>a.playState!=='running'||a.effect&&a.effect.getTiming().iterations===Infinity)`, "the slide settled") |
| + q.shot("settings-housekeeping-390-" + scheme) |
| + q.stop() |
| + } |
| +} |
diff --git a/internal/thintest/settings_pages_test.go b/internal/thintest/settings_pages_test.go| new file mode 100644 |
| index 00000000..9931864d |
| --- /dev/null |
| +++ b/internal/thintest/settings_pages_test.go |
| @@ -0,0 +1,61 @@ |
| +package thintest |
| + |
| +import ( |
| + "net/http" |
| + "strings" |
| + "testing" |
| +) |
| + |
| +// TestPagesSettingsSections: Paul, 2026-11-09: Settings split into |
| +// sections, each at its own URL with the menu of all of them, the current |
| +// one marked; Connections and the Notebook moved under it; the old URLs |
| +// lead to their sections; the conversation's header leads there too. |
| +func TestPagesSettingsSections(t *testing.T) { |
| + r := newToolRig(t) |
| + owner := r.inst.Cookie() |
| + links := []string{`data-settings-link="thinking"`, `data-settings-link="connections"`, `data-settings-link="housekeeping"`, `data-settings-link="notebook"`, `data-settings-link="teams"`} |
| + for _, tc := range []struct{ path, current, want string }{ |
| + {"/conversation/settings", "thinking", `data-root`}, |
| + {"/conversation/settings/thinking", "thinking", `data-thinking-words`}, |
| + {"/conversation/settings/connections", "connections", `data-connections`}, |
| + {"/conversation/settings/housekeeping", "housekeeping", `data-hk-settings`}, |
| + {"/conversation/settings/notebook", "notebook", `data-notebook-reset`}, |
| + } { |
| + page := r.get(owner, tc.path, 200) |
| + for _, l := range links { |
| + if !strings.Contains(page, l) { |
| + t.Fatalf("%s: the menu lacks %s", tc.path, l) |
| + } |
| + } |
| + if strings.Count(page, `aria-current="page" `) > 0 || !strings.Contains(page, `data-settings-link="`+tc.current+`" aria-current="page"`) { |
| + t.Fatalf("%s: %s is not the one current section", tc.path, tc.current) |
| + } |
| + if !strings.Contains(page, tc.want) { |
| + t.Fatalf("%s lacks %s", tc.path, tc.want) |
| + } |
| + if tc.path != "/conversation/settings" && (!strings.Contains(page, `href="/conversation/settings" rel="up"`) || strings.Contains(page, `data-root`)) { |
| + t.Fatalf("%s: no way back to Settings", tc.path) |
| + } |
| + } |
| + // Usage is not a section yet. |
| + if strings.Contains(r.get(owner, "/conversation/settings", 200), "usage") { |
| + t.Fatal("a usage section appeared") |
| + } |
| + noFollow := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }} |
| + for old, to := range map[string]string{"/conversation/connections": "/conversation/settings/connections", "/conversation/notebook": "/conversation/settings/notebook", "/settings/thinking": "/conversation/settings/thinking"} { |
| + req, _ := http.NewRequest("GET", r.inst.URL+old, nil) |
| + req.AddCookie(owner) |
| + res, err := noFollow.Do(req) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + res.Body.Close() |
| + if res.StatusCode != http.StatusSeeOther || res.Header.Get("Location") != to { |
| + t.Fatalf("%s: %d to %q, want %s", old, res.StatusCode, res.Header.Get("Location"), to) |
| + } |
| + } |
| + chat := r.get(owner, "/conversation", 200) |
| + if !strings.Contains(chat, `href="/conversation/settings/connections" equipo-header-button`) || !strings.Contains(chat, `href="/conversation/settings/notebook" equipo-header-button`) { |
| + t.Fatal("the conversation's header does not lead to the sections") |
| + } |
| +} |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index d7cba776..6bb999c1 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -10764,5 +10764,12 @@ |
| "match": "node", |
| "count": 1, |
| "reason": "The WebKit browser test drives Playwright's WebKit through its own driver script with the machine's node; not the old JavaScript runtime." |
| + }, |
| + { |
| + "path": "internal/equipo/static/connections.js", |
| + "line_sha256": "ca40b28e1ab627a2c338bd562404d7d7bd2554132d17c99fbc10069831182969", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "The DOM's cloneNode method copies a page template in the browser; not Node.js." |
| } |
| ] |