Merge branch 'settings-ux' into main
Settings: one page pattern, a savebar, Teams as a section Every Settings section shares one head, width and group-of-rows card; editable fields save from a savebar fixed to the foot of the screen; Teams joins Settings. The Teams hierarchy browser drive and TestRailRoutes follow the new navigation. internal/equipo's size exemption is 15650. Hosted CI passed on 74d8a6a.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
57 files changed,
+993
−108
.rastrillo/budgets.txt+2 −2docs/mockups/built/2026-11-11/settings-connections-1280.pngbinarydocs/mockups/built/2026-11-11/settings-connections-390.pngbinarydocs/mockups/built/2026-11-11/settings-connections-add-1280.pngbinarydocs/mockups/built/2026-11-11/settings-connections-add-390.pngbinarydocs/mockups/built/2026-11-11/settings-connections-add-before-1280.pngbinarydocs/mockups/built/2026-11-11/settings-connections-add-before-390.pngbinarydocs/mockups/built/2026-11-11/settings-connections-before-1280.pngbinarydocs/mockups/built/2026-11-11/settings-connections-before-390.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-1280.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-390.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-before-1280.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-before-390.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-paused-1280.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-paused-390.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-quiet-off-1280.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-quiet-off-390.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-saved-1280.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-saved-390.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-unsaved-1280.pngbinarydocs/mockups/built/2026-11-11/settings-housekeeping-unsaved-390.pngbinarydocs/mockups/built/2026-11-11/settings-notebook-1280.pngbinarydocs/mockups/built/2026-11-11/settings-notebook-390.pngbinarydocs/mockups/built/2026-11-11/settings-notebook-before-1280.pngbinarydocs/mockups/built/2026-11-11/settings-notebook-before-390.pngbinarydocs/mockups/built/2026-11-11/settings-teams-1280.pngbinarydocs/mockups/built/2026-11-11/settings-teams-390.pngbinarydocs/mockups/built/2026-11-11/settings-teams-add-1280.pngbinarydocs/mockups/built/2026-11-11/settings-teams-add-390.pngbinarydocs/mockups/built/2026-11-11/settings-teams-before-1280.pngbinarydocs/mockups/built/2026-11-11/settings-teams-before-390.pngbinarydocs/mockups/built/2026-11-11/settings-teams-undo-1280.pngbinarydocs/mockups/built/2026-11-11/settings-teams-undo-390.pngbinarydocs/mockups/built/2026-11-11/settings-thinking-1280.pngbinarydocs/mockups/built/2026-11-11/settings-thinking-390.pngbinarydocs/mockups/built/2026-11-11/settings-thinking-before-1280.pngbinarydocs/mockups/built/2026-11-11/settings-thinking-before-390.pngbinarydocs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+18 −0internal/equipo/copy.go+20 −3internal/equipo/render.go+1 −1internal/equipo/settings_hub.go+28 −1internal/equipo/static/equipo.css+99 −12internal/equipo/static/settings.js+281 −34internal/equipo/team_links.go+3 −1internal/equipo/templates/housekeeping_settings.html+22 −8internal/equipo/templates/models.html+2 −2internal/equipo/templates/notebook.html+1 −1internal/equipo/templates/settings_hub.html+2 −2internal/equipo/templates/settings_nav.html+14 −0internal/equipo/templates/teams.html+34 −20internal/equipo/templates/work_parts.html+5 −6internal/equipotest/pages_test.go+11 −0internal/plan3test/teams_navigation_browser_test.go+16 −8internal/thintest/housekeeping_browser_test.go+3 −3internal/thintest/settings_browser_test.go+4 −4internal/thintest/settings_ux_browser_test.go+280 −0internal/thintest/settings_ux_pages_test.go+147 −0
CI passed — run details
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index ceff431a..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. |
| @@ -62,4 +62,4 @@ perf GET /conversation/attachments/{id}/preview skip Composer attachments: an im |
| perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section. |
| time cmd/equipo-runner 60s Mac runners slice B: TestReleaseRunnerHasNoFakeWorker builds the release runner exactly as make release-runner does and the thin package under the testbuild tag (measured 11.9s locally with a warm cache). |
| size internal/headless - 8300 Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090. |
| -size internal/thintest - 10000 Claude's sign-in by a link adds the code contract (signin_contract_test.go: the card, the code route's refusals, the wrong-code card, the kind it becomes and the canary sweep, about 220 lines); measured 9896. The Connections Add page and the Settings rail add their page contracts and the rail's browser drive (connections_add_pages_test.go, settings_rail_pages_test.go, about 230 lines); measured 9676. Claude setup tokens add the token and Check again contracts; measured 9444 with the composer and Mac lines merged. The instant thinking line adds its browser drive (instant_browser_test.go, about 230 lines); measured 9064 with the composer and Mac lines merged. Mac runners add the role, scoping, migration, placement, withdrawal, transfer and publication contracts (about 900 test lines) beside the thin v1 contracts; one package keeps one instance harness. |
| +size internal/thintest - 10500 The Settings UX pass adds the Settings pattern's page contracts and the savebar, Housekeeping groups and Teams browser drives (settings_ux_pages_test.go, settings_ux_browser_test.go, about 430 lines); measured 10390. Claude's sign-in by a link adds the code contract (signin_contract_test.go: the card, the code route's refusals, the wrong-code card, the kind it becomes and the canary sweep, about 220 lines); measured 9896. The Connections Add page and the Settings rail add their page contracts and the rail's browser drive (connections_add_pages_test.go, settings_rail_pages_test.go, about 230 lines); measured 9676. Claude setup tokens add the token and Check again contracts; measured 9444 with the composer and Mac lines merged. The instant thinking line adds its browser drive (instant_browser_test.go, about 230 lines); measured 9064 with the composer and Mac lines merged. Mac runners add the role, scoping, migration, placement, withdrawal, transfer and publication contracts (about 900 test lines) beside the thin v1 contracts; one package keeps one instance harness. |
diff --git a/docs/mockups/built/2026-11-11/settings-connections-1280.png b/docs/mockups/built/2026-11-11/settings-connections-1280.png| new file mode 100644 |
| index 00000000..8b9545aa |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-connections-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-connections-390.png b/docs/mockups/built/2026-11-11/settings-connections-390.png| new file mode 100644 |
| index 00000000..0a09096d |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-connections-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-connections-add-1280.png b/docs/mockups/built/2026-11-11/settings-connections-add-1280.png| new file mode 100644 |
| index 00000000..231174b0 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-connections-add-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-connections-add-390.png b/docs/mockups/built/2026-11-11/settings-connections-add-390.png| new file mode 100644 |
| index 00000000..b47b87dd |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-connections-add-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-connections-add-before-1280.png b/docs/mockups/built/2026-11-11/settings-connections-add-before-1280.png| new file mode 100644 |
| index 00000000..a5f638fa |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-connections-add-before-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-connections-add-before-390.png b/docs/mockups/built/2026-11-11/settings-connections-add-before-390.png| new file mode 100644 |
| index 00000000..cee2ed22 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-connections-add-before-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-connections-before-1280.png b/docs/mockups/built/2026-11-11/settings-connections-before-1280.png| new file mode 100644 |
| index 00000000..9f1759fa |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-connections-before-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-connections-before-390.png b/docs/mockups/built/2026-11-11/settings-connections-before-390.png| new file mode 100644 |
| index 00000000..1400eb02 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-connections-before-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-1280.png b/docs/mockups/built/2026-11-11/settings-housekeeping-1280.png| new file mode 100644 |
| index 00000000..ba4475d9 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-390.png b/docs/mockups/built/2026-11-11/settings-housekeeping-390.png| new file mode 100644 |
| index 00000000..8942ee82 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-before-1280.png b/docs/mockups/built/2026-11-11/settings-housekeeping-before-1280.png| new file mode 100644 |
| index 00000000..b4443670 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-before-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-before-390.png b/docs/mockups/built/2026-11-11/settings-housekeeping-before-390.png| new file mode 100644 |
| index 00000000..649f3295 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-before-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-paused-1280.png b/docs/mockups/built/2026-11-11/settings-housekeeping-paused-1280.png| new file mode 100644 |
| index 00000000..c2e9a846 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-paused-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-paused-390.png b/docs/mockups/built/2026-11-11/settings-housekeeping-paused-390.png| new file mode 100644 |
| index 00000000..9b19dbd3 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-paused-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-quiet-off-1280.png b/docs/mockups/built/2026-11-11/settings-housekeeping-quiet-off-1280.png| new file mode 100644 |
| index 00000000..280b1656 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-quiet-off-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-quiet-off-390.png b/docs/mockups/built/2026-11-11/settings-housekeeping-quiet-off-390.png| new file mode 100644 |
| index 00000000..b396241a |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-quiet-off-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-saved-1280.png b/docs/mockups/built/2026-11-11/settings-housekeeping-saved-1280.png| new file mode 100644 |
| index 00000000..ee50deec |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-saved-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-saved-390.png b/docs/mockups/built/2026-11-11/settings-housekeeping-saved-390.png| new file mode 100644 |
| index 00000000..434c814a |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-saved-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-unsaved-1280.png b/docs/mockups/built/2026-11-11/settings-housekeeping-unsaved-1280.png| new file mode 100644 |
| index 00000000..3b57f51d |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-unsaved-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-housekeeping-unsaved-390.png b/docs/mockups/built/2026-11-11/settings-housekeeping-unsaved-390.png| new file mode 100644 |
| index 00000000..dea35c39 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-housekeeping-unsaved-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-notebook-1280.png b/docs/mockups/built/2026-11-11/settings-notebook-1280.png| new file mode 100644 |
| index 00000000..15b40cbd |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-notebook-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-notebook-390.png b/docs/mockups/built/2026-11-11/settings-notebook-390.png| new file mode 100644 |
| index 00000000..3513bfc2 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-notebook-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-notebook-before-1280.png b/docs/mockups/built/2026-11-11/settings-notebook-before-1280.png| new file mode 100644 |
| index 00000000..004af201 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-notebook-before-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-notebook-before-390.png b/docs/mockups/built/2026-11-11/settings-notebook-before-390.png| new file mode 100644 |
| index 00000000..2951e30c |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-notebook-before-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-teams-1280.png b/docs/mockups/built/2026-11-11/settings-teams-1280.png| new file mode 100644 |
| index 00000000..fe1f5512 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-teams-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-teams-390.png b/docs/mockups/built/2026-11-11/settings-teams-390.png| new file mode 100644 |
| index 00000000..05584b19 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-teams-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-teams-add-1280.png b/docs/mockups/built/2026-11-11/settings-teams-add-1280.png| new file mode 100644 |
| index 00000000..1d962e54 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-teams-add-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-teams-add-390.png b/docs/mockups/built/2026-11-11/settings-teams-add-390.png| new file mode 100644 |
| index 00000000..1d48094b |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-teams-add-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-teams-before-1280.png b/docs/mockups/built/2026-11-11/settings-teams-before-1280.png| new file mode 100644 |
| index 00000000..d16dd54c |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-teams-before-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-teams-before-390.png b/docs/mockups/built/2026-11-11/settings-teams-before-390.png| new file mode 100644 |
| index 00000000..c8571743 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-teams-before-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-teams-undo-1280.png b/docs/mockups/built/2026-11-11/settings-teams-undo-1280.png| new file mode 100644 |
| index 00000000..4aa9ce92 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-teams-undo-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-teams-undo-390.png b/docs/mockups/built/2026-11-11/settings-teams-undo-390.png| new file mode 100644 |
| index 00000000..2111c866 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-teams-undo-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-thinking-1280.png b/docs/mockups/built/2026-11-11/settings-thinking-1280.png| new file mode 100644 |
| index 00000000..f229a4b3 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-thinking-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-thinking-390.png b/docs/mockups/built/2026-11-11/settings-thinking-390.png| new file mode 100644 |
| index 00000000..e7f5898f |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-thinking-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-thinking-before-1280.png b/docs/mockups/built/2026-11-11/settings-thinking-before-1280.png| new file mode 100644 |
| index 00000000..00da6094 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-thinking-before-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/settings-thinking-before-390.png b/docs/mockups/built/2026-11-11/settings-thinking-before-390.png| new file mode 100644 |
| index 00000000..fbd372c4 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/settings-thinking-before-390.png differ |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index 33d02a02..05010eb3 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -5892,6 +5892,24 @@ records remain unchanged. |
| | `runner.verdict.failed` | Failed | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.verdict.skipped` | Not run | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.verdict.unavailable` | Unavailable | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `settings.unsaved` | Unsaved changes | Settings UX pass (Paul, 2026-11-11): the savebar, beside Discard and Save | Runtime; COPY REVIEW REQUIRED | |
| +| `settings.discard` | Discard | Settings UX pass (Paul, 2026-11-11): the savebar | Runtime; COPY REVIEW REQUIRED | |
| +| `housekeeping.settings.status` | Status | Settings UX pass (Paul, 2026-11-11): Housekeeping, the group heading over Pause | Runtime; COPY REVIEW REQUIRED | |
| +| `housekeeping.settings.status_hint` | Pause and Resume apply at once. | Settings UX pass (Paul, 2026-11-11): Housekeeping, the Status group's line | Runtime; COPY REVIEW REQUIRED | |
| +| `housekeeping.settings.on` | Housekeeping is on | Settings UX pass (Paul, 2026-11-11): Housekeeping, the state beside Pause | Runtime; COPY REVIEW REQUIRED | |
| +| `housekeeping.settings.off` | Housekeeping is paused | Settings UX pass (Paul, 2026-11-11): Housekeeping, the state beside Resume | Runtime; COPY REVIEW REQUIRED | |
| +| `housekeeping.settings.off_desc` | Nothing is tidied until you resume. | Settings UX pass (Paul, 2026-11-11): Housekeeping, under the paused state | Runtime; COPY REVIEW REQUIRED | |
| +| `housekeeping.settings.hours` | Hours | Settings UX pass (Paul, 2026-11-11): Housekeeping, the row of From and Until | Runtime; COPY REVIEW REQUIRED | |
| +| `thinking.choose` | Word set | Settings UX pass (Paul, 2026-11-11): Thinking words, the group heading over the sets | Runtime; COPY REVIEW REQUIRED | |
| +| `thinking.choose_hint` | Your choice applies at once. | Settings UX pass (Paul, 2026-11-11): Thinking words, the group's line | Runtime; COPY REVIEW REQUIRED | |
| +| `teams.lede` | Links to the other Equipo teams you use. Only you can see them. | Settings UX pass (Paul, 2026-11-11): Teams, the page's one line | Runtime; COPY REVIEW REQUIRED | |
| +| `teams.none` | No other teams yet. | Settings UX pass (Paul, 2026-11-11): Teams, no remembered teams | Runtime; COPY REVIEW REQUIRED | |
| +| `teams.add_open` | Add a team | Settings UX pass (Paul, 2026-11-11): Teams, the button that opens the add form | Runtime; COPY REVIEW REQUIRED | |
| +| `teams.add_help` | Each team has its own sign-in and members. A link gives no access to it. | Settings UX pass (Paul, 2026-11-11): Teams, help in the add form | Runtime; COPY REVIEW REQUIRED | |
| +| `teams.last_signin_ago` | Last signed in %s | Settings UX pass (Paul, 2026-11-11): Teams, a remembered row; %s is "4 days ago" (work.ago.*), the exact time on hover | Runtime; COPY REVIEW REQUIRED | |
| +| `teams.forget_short` | Forget | Settings UX pass (Paul, 2026-11-11): Teams, the quiet action on a remembered row | Runtime; COPY REVIEW REQUIRED | |
| +| `teams.forgotten` | %s forgotten. | Settings UX pass (Paul, 2026-11-11): Teams, in the row's place before Undo; %s is the team's name | Runtime; COPY REVIEW REQUIRED | |
| +| `teams.undo` | Undo | Settings UX pass (Paul, 2026-11-11): Teams, after Forget | Runtime; COPY REVIEW REQUIRED | |
| ## Task 21 |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 71b9c514..f7c13859 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -130,17 +130,34 @@ var pageCopy = map[string]string{ |
| "api.authorization_pending": "Approve this device in your browser.", |
| "teams.title": "Teams", |
| "teams.add": "Remember a team", |
| - "teams.forget": "Forget this link", |
| "teams.remembered": "Your remembered teams", |
| - "teams.directory_help": "Add links to other Equipo instances you have signed in to. Only you can see this directory. Each instance has its own sign-in and membership. Links do not give access or share accounts.", |
| "teams.last_signin_unknown": "Last sign-in unknown", |
| - "teams.last_signin": "Last signed in", |
| "teams.remote_unavailable": "Remote status unavailable", |
| "teams.counts_unknown": "Counts unavailable", |
| "teams.origin": "Instance address", |
| "teams.name": "Team name", |
| "teams.current": "Current team", |
| "teams.parent_task": "Task", |
| + // Settings UX pass (Paul, 2026-11-11: "proper UX and aren't just |
| + // random forms"). Each entry is pending review on its own. |
| + "settings.unsaved": "Unsaved changes", // COPY REVIEW REQUIRED |
| + "settings.discard": "Discard", // COPY REVIEW REQUIRED |
| + "housekeeping.settings.status": "Status", // COPY REVIEW REQUIRED |
| + "housekeeping.settings.status_hint": "Pause and Resume apply at once.", // COPY REVIEW REQUIRED |
| + "housekeeping.settings.on": "Housekeeping is on", // COPY REVIEW REQUIRED |
| + "housekeeping.settings.off": "Housekeeping is paused", // COPY REVIEW REQUIRED |
| + "housekeeping.settings.off_desc": "Nothing is tidied until you resume.", // COPY REVIEW REQUIRED |
| + "housekeeping.settings.hours": "Hours", // COPY REVIEW REQUIRED |
| + "thinking.choose": "Word set", // COPY REVIEW REQUIRED |
| + "thinking.choose_hint": "Your choice applies at once.", // COPY REVIEW REQUIRED |
| + "teams.lede": "Links to the other Equipo teams you use. Only you can see them.", // COPY REVIEW REQUIRED |
| + "teams.none": "No other teams yet.", // COPY REVIEW REQUIRED |
| + "teams.add_open": "Add a team", // COPY REVIEW REQUIRED |
| + "teams.add_help": "Each team has its own sign-in and members. A link gives no access to it.", // COPY REVIEW REQUIRED |
| + "teams.last_signin_ago": "Last signed in %s", // COPY REVIEW REQUIRED |
| + "teams.forget_short": "Forget", // COPY REVIEW REQUIRED |
| + "teams.forgotten": "%s forgotten.", // COPY REVIEW REQUIRED |
| + "teams.undo": "Undo", // COPY REVIEW REQUIRED |
| "account_setup.title": "Connect a model account", |
| "account_setup.label": "Account label", |
diff --git a/internal/equipo/render.go b/internal/equipo/render.go| index 895db5d1..efc0642e 100644 |
| --- a/internal/equipo/render.go |
| +++ b/internal/equipo/render.go |
| @@ -37,7 +37,7 @@ 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", "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"} }, |
| + Funcs(template.FuncMap{"chatMarkdown": chatmarkdown.Render, "fileSize": fileSize, "loadingLine": loadingLine, "split": strings.Split, "since": sinceMillis, "elapsed": elapsedText, "short": short, "agoData": agoData, "agoText": agoText, "hostOf": hostOf, "deref": deref, "agoFormats": agoFormats, "projectAllows": library.ProjectAllowed, "asset": assets.Path, "copy": copyText, "taskGroups": func() []string { return []string{"needs-person", "running", "queued", "finished"} }, |
| "kindKey": func(k ProjectKind) string { return "kind." + string(k) }, |
| "ownerKey": func(k string) string { return "owner." + k }, |
| "roleKey": func(k Role) string { return "role." + string(k) }, |
diff --git a/internal/equipo/settings_hub.go b/internal/equipo/settings_hub.go| index 7cfcc017..3bdf0195 100644 |
| --- a/internal/equipo/settings_hub.go |
| +++ b/internal/equipo/settings_hub.go |
| @@ -4,6 +4,7 @@ import ( |
| "net/http" |
| "net/url" |
| "strings" |
| + "time" |
| ) |
| // Settings (Paul, 2026-11-09: "settings could probably get a submenu on |
| @@ -29,7 +30,7 @@ func crossedSettings(r *http.Request) bool { |
| return false |
| } |
| in := func(p string) bool { |
| - return p == "/conversation/settings" || strings.HasPrefix(p, "/conversation/settings/") |
| + return p == "/conversation/settings" || strings.HasPrefix(p, "/conversation/settings/") || p == "/teams" |
| } |
| return in(from.Path) != in(r.URL.Path) |
| } |
| @@ -121,3 +122,29 @@ func movedTo(path string) http.HandlerFunc { |
| http.Redirect(w, r, path, http.StatusSeeOther) |
| } |
| } |
| + |
| +// agoText is a quiet relative time, "4 days ago", for a template. |
| +func agoText(v any) string { |
| + ms := sinceMillis(v) |
| + if ms == 0 { |
| + return "" |
| + } |
| + return ago(time.Now(), time.UnixMilli(ms)) |
| +} |
| + |
| +// hostOf is an instance address as a person reads it: its host, without |
| +// the scheme. |
| +func hostOf(origin string) string { |
| + if u, err := url.Parse(origin); err == nil && u.Host != "" { |
| + return u.Host |
| + } |
| + return origin |
| +} |
| + |
| +// deref is the number behind a known count. |
| +func deref(n *int) int { |
| + if n == nil { |
| + return 0 |
| + } |
| + return *n |
| +} |
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css| index a7207efa..be277d20 100644 |
| --- a/internal/equipo/static/equipo.css |
| +++ b/internal/equipo/static/equipo.css |
| @@ -998,14 +998,6 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-hk-empty] { margin: var(--rst-sp-3) 0; color: var(--rst-text-muted); } |
| @media (pointer: coarse) { [equipo-hk-list] [equipo-link] { min-block-size: 2.75rem; padding-inline: var(--rst-sp-2); } } |
| [equipo-card-line][data-digest] a { font-size: var(--rst-fs-sm); color: var(--rst-text-muted); text-underline-offset: 2px; } |
| -/* Housekeeping in Settings: Pause, then quiet hours on one line. */ |
| -[equipo-hk-settings] form { margin-block: var(--rst-sp-3); } |
| -[equipo-hk-settings] fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; } |
| -[equipo-hk-settings] legend { font-weight: 500; padding: 0; } |
| -[equipo-hk-settings] label[equipo-hk-check] { display: flex; flex-direction: row; gap: var(--rst-sp-2); align-items: center; justify-content: flex-start; margin-block: var(--rst-sp-2); } |
| -[equipo-hk-settings] label[equipo-hk-check] input { inline-size: auto; margin: 0; } |
| -[equipo-hk-hours] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-2) var(--rst-sp-4); margin-block-end: var(--rst-sp-3); } |
| -[equipo-hk-hours] label { display: inline-flex; align-items: center; gap: var(--rst-sp-2); } |
| [equipo-hk-to-settings] { margin: var(--rst-sp-1) 0 0; font-size: var(--rst-fs-sm); } |
| [equipo-hk-to-settings] a { color: var(--rst-text-muted); text-underline-offset: 2px; } |
| /* The phone's home screen (Paul, f2602d3: "Vertical alignment of header |
| @@ -1034,10 +1026,6 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-setting-row] [equipo-desc] { margin: 0; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| [equipo-setting-row][data-placeholder] { color: var(--rst-text-muted); } |
| [equipo-settings-section] [equipo-conn-prefer] { margin-block-start: var(--rst-sp-3); } |
| -[equipo-hk-hours] label { white-space: nowrap; flex: none; } |
| -[equipo-hk-hours] select { inline-size: auto; } |
| -[equipo-hk-settings] [equipo-hk-quiet] [equipo-desc] { margin: var(--rst-sp-1) 0 0; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| -[equipo-hk-settings] [equipo-hk-pause-form] { margin-block: var(--rst-sp-3); } |
| /* ── The composer (Paul, 2026-11-08, after Eleven's): a round + on the |
| left, a pill that grows to about six lines, and inside it on the right |
| @@ -1217,3 +1205,102 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| } |
| /* The Notebook page keeps its columns (a later rule makes the project page's notes a grid). */ |
| [equipo-notebook] [equipo-notes] { display: block; } |
| +/* The Settings pattern (Paul, 2026-11-11: "make sure all the settings |
| + screens have proper UX and aren't just random forms"). One content |
| + width and one heading scale for every section; a section is groups, |
| + each a heading and one line over a card of rows, the label on the |
| + left and the control on the right. */ |
| +[equipo-settings-body] { max-inline-size: 46rem; } |
| +[equipo-sp-head] { margin: 0 0 var(--rst-sp-6); } |
| +[equipo-sp-head] h1 { margin: 0; font-size: 1.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; } |
| +[equipo-sp-head] p { margin: var(--rst-sp-2) 0 0; max-inline-size: 62ch; color: var(--rst-text-muted); line-height: 1.5; } |
| +[equipo-sp-group] { display: block; margin: 0 0 var(--rst-sp-6); padding: 0; border: 0; min-inline-size: 0; } |
| +[equipo-sp-group-head] { margin-block-end: var(--rst-sp-3); } |
| +[equipo-sp-group-head] h2 { display: flex; align-items: center; margin: 0; font-size: var(--rst-fs-base); font-weight: 600; line-height: 1.3; } |
| +[equipo-sp-group-head] p { margin: .2rem 0 0; max-inline-size: 64ch; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); line-height: 1.45; } |
| +[equipo-sp-card] { list-style: none; margin: 0; padding: 0; overflow: clip; border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); background: var(--rst-surface); } |
| +[equipo-sp-row] { position: relative; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--rst-sp-2) var(--rst-sp-4); min-block-size: 3.5rem; margin: 0; padding: var(--rst-sp-3) var(--rst-sp-4); border: 0; min-inline-size: 0; } |
| +[equipo-sp-row][hidden] { display: none; } |
| +/* A line between rows: above every shown row after the first shown. */ |
| +[equipo-sp-card] > [equipo-sp-row]:not([hidden]) ~ [equipo-sp-row] { border-block-start: 1px solid var(--rst-line); } |
| +[equipo-sp-label] { display: grid; gap: .15rem; min-inline-size: 0; margin: 0; } |
| +label[equipo-sp-label] { cursor: pointer; } |
| +[equipo-sp-title] { display: flex; align-items: center; gap: var(--rst-sp-2); margin: 0; font-weight: 500; } |
| +[equipo-sp-desc] { margin: 0; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +[equipo-sp-desc] a { color: inherit; text-underline-offset: 2px; } |
| +[equipo-sp-desc] a:hover { color: var(--rst-text); } |
| +[equipo-sp-control] { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--rst-sp-2) var(--rst-sp-3); margin: 0; } |
| +/* The state dot is Connections' own: filled with a halo when on, a |
| + hollow ring when paused. */ |
| +[equipo-sp-dot] { flex: none; inline-size: .5rem; block-size: .5rem; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px var(--rst-line-strong, var(--rst-text-muted)); } |
| +[equipo-sp-dot][data-active] { background: var(--rst-tone-positive-fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rst-tone-positive-fg) 18%, transparent); } |
| +[equipo-sp-row]:disabled [equipo-sp-title] { color: var(--rst-text-faint); } |
| +[equipo-sp-empty] { margin: 0; padding: var(--rst-sp-4); border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); background: var(--rst-surface); color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| +[equipo-sp-group-head] [equipo-saved-tick] { font-weight: 500; } |
| +/* Quiet hours: From and Until side by side, off with the switch. */ |
| +[equipo-hk-hours] label { display: inline-flex; align-items: center; gap: var(--rst-sp-2); white-space: nowrap; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +[equipo-hk-hours] select { inline-size: auto; } |
| +[equipo-hk-hours] select:disabled { opacity: .55; cursor: not-allowed; } |
| +@media (max-width: 559.98px) { |
| + [equipo-sp-row]:has([equipo-hk-hours]) { grid-template-columns: minmax(0, 1fr); } |
| + [equipo-sp-row] [equipo-hk-hours] { justify-content: flex-start; } |
| +} |
| +/* Thinking words: the preview, then the sets as one group. */ |
| +[equipo-thinking-words] [equipo-thinking-preview] { margin-block-end: var(--rst-sp-6); } |
| +[equipo-thinking-words] [equipo-thinking-form] fieldset { margin: 0; } |
| +/* The savebar: fixed to the foot of the screen under the content |
| + column, Save on the right where the content ends; on a phone the |
| + whole width, above the safe area. */ |
| +[equipo-settings-body]:has([equipo-savebar]) { padding-block-end: 5rem; } |
| +[equipo-savebar] { container-type: inline-size; position: fixed; z-index: 30; inset-inline: 0; inset-block-end: 0; padding-block-end: env(safe-area-inset-bottom, 0px); background: color-mix(in srgb, var(--rst-surface) 94%, transparent); backdrop-filter: blur(10px); border-block-start: 1px solid var(--rst-line); box-shadow: 0 -8px 20px -16px rgb(0 0 0 / .35); } |
| +[equipo-savebar-in] { box-sizing: border-box; display: flex; align-items: center; gap: var(--rst-sp-3); max-inline-size: 64rem; margin-inline: auto; padding: var(--rst-sp-3) var(--rst-sp-4); } |
| +[equipo-savebar-in] > :first-child { flex: 1; } |
| +@media (min-width: 800px) { |
| + [equipo-savebar] { inset-inline-start: 17rem; } |
| + /* The bar's content is the section's own width, so Save sits under |
| + the right edge of the cards. */ |
| + [equipo-savebar-in] { padding-inline-end: calc(var(--rst-sp-4) + max(0px, min(64rem, 100cqi) - 2 * var(--rst-sp-4) - 46rem)); } |
| +} |
| +[equipo-savebar-note] { display: flex; align-items: center; gap: .3rem; margin: 0; min-inline-size: 0; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +[equipo-savebar-note] [data-savebar-saved] { display: inline-flex; align-items: center; gap: .3rem; color: var(--rst-tone-positive-fg); font-weight: 500; } |
| +[equipo-savebar-note] [hidden] { display: none; } |
| +[equipo-savebar-note] .icon { inline-size: 1em; block-size: 1em; margin: 0; } |
| +[equipo-savebar] [rst-btn][hidden] { display: none; } |
| +[equipo-savebar] [rst-btn]:disabled { cursor: default; } |
| +@media (pointer: coarse) { [equipo-savebar] [rst-btn] { min-block-size: 2.75rem; } } |
| +/* Teams: the current team as a header row, the remembered ones as a |
| + list whose rows open the team, Forget a quiet action with Undo, and |
| + Add a team behind its button. */ |
| +[equipo-team-row] { grid-template-columns: auto minmax(0, 1fr) auto; } |
| +[equipo-team-mark] { display: inline-grid; place-items: center; inline-size: 2rem; block-size: 2rem; border-radius: var(--rst-radius); background: var(--rst-surface-2); color: var(--rst-text-muted); } |
| +[equipo-team-mark] .icon { margin: 0; } |
| +[equipo-team-row] [equipo-row-link] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| +[equipo-team-row]:has([equipo-row-link]):hover { background: var(--rst-tint-hover); } |
| +[equipo-team-row]:has([equipo-row-link]:focus-visible) { box-shadow: inset 0 0 0 2px var(--rst-focus-edge); } |
| +[equipo-team-facts] { display: flex; flex-wrap: wrap; gap: 0 var(--rst-sp-2); } |
| +[equipo-team-facts] > * + *::before { content: "·"; margin-inline-end: var(--rst-sp-2); color: var(--rst-text-faint); } |
| +[equipo-team-facts] time { position: relative; z-index: 1; cursor: help; } |
| +[equipo-team-needs] { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem; border-radius: var(--rst-radius-pill); background: var(--rst-accent-soft); color: var(--rst-text); font-size: var(--rst-fs-sm); text-decoration: none; } |
| +[equipo-team-needs] b { font-variant-numeric: tabular-nums; } |
| +[equipo-team-forget] { font-size: var(--rst-fs-sm); } |
| +@media (hover: hover) { |
| + [equipo-team-row] [equipo-team-forget] { opacity: .7; } |
| + [equipo-team-row]:hover [equipo-team-forget], [equipo-team-forget]:focus-visible { opacity: 1; } |
| +} |
| +[equipo-team-gone] { grid-template-columns: minmax(0, 1fr) auto; background: var(--rst-surface-2); } |
| +[equipo-team-gone] [equipo-sp-label] { font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +[equipo-team-add] { margin-block-start: var(--rst-sp-3); } |
| +[equipo-team-add] > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; } |
| +[equipo-team-add] > summary::-webkit-details-marker { display: none; } |
| +[equipo-team-add] > summary .icon { margin-inline-end: var(--rst-sp-1); } |
| +[equipo-team-add-form] { display: grid; gap: var(--rst-sp-4); margin-block-start: var(--rst-sp-3); padding: var(--rst-sp-4); border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); background: var(--rst-surface); } |
| +[equipo-team-field] { display: grid; gap: var(--rst-sp-1); min-inline-size: 0; font-size: var(--rst-fs-sm); font-weight: 500; } |
| +[equipo-team-field] input { box-sizing: border-box; } |
| +[equipo-team-field][data-field="address"] input { inline-size: min(100%, 26rem); } |
| +[equipo-team-field][data-field="name"] input { inline-size: min(100%, 18rem); } |
| +[equipo-team-add-form] [equipo-sp-desc] { max-inline-size: 60ch; } |
| +[equipo-team-add-actions] { margin: 0; } |
| +@media (max-width: 559.98px) { |
| + [equipo-team-facts] { flex-direction: column; } |
| + [equipo-team-facts] > * + *::before { content: none; } |
| +} |
diff --git a/internal/equipo/static/settings.js b/internal/equipo/static/settings.js| index 906e77ea..067ecf08 100644 |
| --- a/internal/equipo/static/settings.js |
| +++ b/internal/equipo/static/settings.js |
| @@ -1,27 +1,40 @@ |
| // Settings save in the background (Paul: choosing an option made the |
| // sliding nav play again, because each change posted and came back to |
| -// the page). A change posts with fetch, the page is read again, and only |
| -// what changed is put back in place (the Prefer control, the Housekeeping |
| -// section, a form's revision), with a quiet "Saved" tick by the section's |
| -// heading. No navigation, no reload. Without script the forms post as |
| -// before. |
| +// the page). Two kinds of control, never mixed in one group (Paul, |
| +// 2026-11-11): |
| +// |
| +// - At once (Pause, Prefer, a word set, Reset): the form posts with |
| +// fetch, the page is read again, only what changed is put back in |
| +// place, and a quiet "Saved" tick shows by the group's heading. |
| +// - Editable fields ([data-savebar-form]): Save in the bar at the foot |
| +// of the screen is off until something changes; then "Unsaved changes" |
| +// and Discard show beside it, and leaving the page asks first. Save |
| +// posts in the background and says "Saved" in the bar. |
| +// |
| +// No navigation, no reload. Without script every form posts as before. |
| (function () { |
| "use strict"; |
| var root = document.querySelector("[data-settings-live]"); |
| - if (!root || !window.fetch) return; |
| - var swaps = ["[equipo-conn-prefer]", "[data-hk-settings]", "[equipo-notebook]"]; |
| + if (!root || !window.fetch || !window.URLSearchParams) return; |
| + var swaps = ["[equipo-conn-prefer]", "[data-hk-status]", "[equipo-notebook]"]; |
| var template = document.querySelector("template[equipo-saved-template]"); |
| - root.addEventListener("submit", function (event) { |
| - var form = event.target; |
| - if (!form.matches("form[method=post]")) return; |
| - event.preventDefault(); |
| - save(form, event.submitter); |
| - }); |
| - function save(form, submitter) { |
| - var body = new URLSearchParams(new FormData(form, submitter || undefined)); |
| - var section = form.closest("[equipo-settings-section]") || root; |
| - section.setAttribute("aria-busy", "true"); |
| - fetch(form.action, { method: "POST", credentials: "same-origin", headers: { "Accept": "application/json" }, body: body }) |
| + var leaving = false; |
| + |
| + // body is a form's fields, the ones a switch has turned off included: |
| + // the server reads the hours whether or not quiet hours are on. |
| + function body(form, submitter) { |
| + var data = new FormData(form, submitter || undefined); |
| + for (var i = 0; i < form.elements.length; i++) { |
| + var el = form.elements[i]; |
| + if (!el.name || !el.matches(":disabled") || el.type === "submit" || el.type === "button" || el.type === "reset") continue; |
| + if ((el.type === "checkbox" || el.type === "radio") && !el.checked) continue; |
| + data.append(el.name, el.value); |
| + } |
| + return new URLSearchParams(data); |
| + } |
| + |
| + function post(form, submitter) { |
| + return fetch(form.action, { method: "POST", credentials: "same-origin", headers: { "Accept": "application/json" }, body: body(form, submitter) }) |
| .then(function (r) { |
| if (!r.ok) throw new Error("save"); |
| return fetch(location.pathname + location.search, { credentials: "same-origin", headers: { "Accept": "text/html" } }); |
| @@ -30,35 +43,71 @@ |
| if (!r.ok) throw new Error("read"); |
| return r.text(); |
| }) |
| - .then(function (html) { |
| - refresh(form, new DOMParser().parseFromString(html, "text/html")); |
| - section.removeAttribute("aria-busy"); |
| - // The section itself may have been put back (the notebook). |
| - tick((section.id && document.getElementById(section.id)) || section); |
| + .then(function (html) { return new DOMParser().parseFromString(html, "text/html"); }); |
| + } |
| + |
| + // fallback is the server's own answer, as without script. |
| + function fallback(form) { |
| + leaving = true; |
| + HTMLFormElement.prototype.submit.call(form); |
| + } |
| + |
| + root.addEventListener("submit", function (event) { |
| + var form = event.target; |
| + if (!form.matches("form[method=post]")) return; |
| + event.preventDefault(); |
| + if (form.matches("[data-savebar-form]")) save(form); |
| + else apply(form, event.submitter); |
| + }); |
| + |
| + // apply is a control that takes effect at once. |
| + function apply(form, submitter) { |
| + var group = form.closest("[equipo-sp-group]") || form.closest("[equipo-settings-section]") || root; |
| + var id = group.id; |
| + group.setAttribute("aria-busy", "true"); |
| + post(form, submitter) |
| + .then(function (doc) { |
| + refresh(form, doc); |
| + group.removeAttribute("aria-busy"); |
| + // The group itself may have been put back (Status, the notebook). |
| + var now = (id && document.getElementById(id)) || group; |
| + now.removeAttribute("aria-busy"); |
| + tick(now); |
| }) |
| .catch(function () { |
| - // The server's own answer, as without script. |
| - section.removeAttribute("aria-busy"); |
| - HTMLFormElement.prototype.submit.call(form); |
| + group.removeAttribute("aria-busy"); |
| + fallback(form); |
| }); |
| } |
| - // refresh puts back the part of the page the change touched. |
| + |
| + // refresh puts back the part of the page the change touched, and moves |
| + // every form's revision on, so a form with unsaved changes keeps them |
| + // and still saves over the new record. |
| function refresh(form, doc) { |
| for (var i = 0; i < swaps.length; i++) { |
| var mine = form.closest(swaps[i]), fresh = doc.querySelector(swaps[i]); |
| if (mine && fresh) { |
| mine.replaceWith(document.importNode(fresh, true)); |
| - return; |
| + break; |
| } |
| } |
| - // A form that stays (Thinking words): its revision moves on. |
| - var next = doc.querySelector('form[action="' + form.getAttribute("action") + '"] input[name=revision]'); |
| - var mine = form.querySelector("input[name=revision]"); |
| - if (next && mine) mine.value = next.value; |
| + revisions(doc); |
| + } |
| + |
| + function revisions(doc) { |
| + var seen = {}; |
| + root.querySelectorAll("form[method=post]").forEach(function (f) { |
| + var action = f.getAttribute("action"), n = seen[action] || 0; |
| + seen[action] = n + 1; |
| + var next = doc.querySelectorAll('form[action="' + action + '"]')[n]; |
| + var a = f.querySelector("input[name=revision]"), b = next && next.querySelector("input[name=revision]"); |
| + if (a && b) a.value = a.defaultValue = b.value; |
| + }); |
| } |
| - function tick(section) { |
| + |
| + function tick(group) { |
| if (!template) return; |
| - var head = section.querySelector("h2, h1") || section; |
| + var head = group.querySelector("h2, h1") || group; |
| var t = head.querySelector("[equipo-saved-tick]"); |
| if (!t) { |
| t = template.content.firstElementChild.cloneNode(true); |
| @@ -69,4 +118,202 @@ |
| clearTimeout(t.timer); |
| t.timer = setTimeout(function () { t.setAttribute("data-gone", ""); }, 2400); |
| } |
| + |
| + // A switch that turns other fields on and off: data-enables names the |
| + // fieldset it governs. |
| + function enables(form) { |
| + form.querySelectorAll("[data-enables]").forEach(function (sw) { |
| + var target = document.getElementById(sw.dataset.enables); |
| + if (target) target.disabled = !sw.checked; |
| + }); |
| + } |
| + |
| + // The savebar forms. |
| + var bars = []; |
| + root.querySelectorAll("[data-savebar-form]").forEach(function (form) { |
| + var bar = { |
| + form: form, |
| + save: form.querySelector("[data-savebar-save]"), |
| + discard: form.querySelector("[data-savebar-discard]"), |
| + unsaved: form.querySelector("[data-savebar-unsaved]"), |
| + saved: form.querySelector("[data-savebar-saved]"), |
| + busy: false, |
| + timer: 0 |
| + }; |
| + form._bar = bar; |
| + bar.base = state(form); |
| + bars.push(bar); |
| + enables(form); |
| + show(bar); |
| + form.addEventListener("input", function () { changed(bar); }); |
| + form.addEventListener("change", function (e) { |
| + if (e.target.matches("[data-enables]")) enables(form); |
| + changed(bar); |
| + }); |
| + // Discard is the form's reset: back to what was last saved. |
| + form.addEventListener("reset", function () { |
| + setTimeout(function () { |
| + enables(form); |
| + changed(bar); |
| + }); |
| + }); |
| + }); |
| + |
| + // state is what a person can change in the form, for "has it changed". |
| + function state(form) { |
| + var out = []; |
| + for (var i = 0; i < form.elements.length; i++) { |
| + var el = form.elements[i]; |
| + if (!el.name || el.type === "hidden" || el.type === "submit" || el.type === "button" || el.type === "reset") continue; |
| + out.push(el.name + "=" + ((el.type === "checkbox" || el.type === "radio") ? el.checked : el.value)); |
| + } |
| + return out.join("&"); |
| + } |
| + |
| + function dirty(bar) { return state(bar.form) !== bar.base; } |
| + |
| + function changed(bar) { |
| + if (dirty(bar)) { |
| + clearTimeout(bar.timer); |
| + bar.saved.hidden = true; |
| + } |
| + show(bar); |
| + } |
| + |
| + function show(bar) { |
| + var d = dirty(bar); |
| + bar.save.disabled = !d || bar.busy; |
| + bar.discard.hidden = !d || bar.busy; |
| + bar.unsaved.hidden = !d; |
| + bar.form.toggleAttribute("data-dirty", d); |
| + } |
| + |
| + function save(form) { |
| + var bar = form._bar; |
| + if (!bar || bar.busy || !dirty(bar)) return; |
| + bar.busy = true; |
| + bar.save.setAttribute("aria-busy", "true"); |
| + show(bar); |
| + post(form) |
| + .then(function (doc) { |
| + revisions(doc); |
| + // What was saved is now what Discard goes back to. |
| + for (var i = 0; i < form.elements.length; i++) { |
| + var el = form.elements[i]; |
| + if (el.type === "checkbox" || el.type === "radio") el.defaultChecked = el.checked; |
| + else if (el.tagName === "SELECT") for (var j = 0; j < el.options.length; j++) el.options[j].defaultSelected = el.options[j].selected; |
| + else if (el.type !== "hidden") el.defaultValue = el.value; |
| + } |
| + bar.base = state(form); |
| + bar.busy = false; |
| + bar.save.removeAttribute("aria-busy"); |
| + show(bar); |
| + bar.saved.hidden = false; |
| + clearTimeout(bar.timer); |
| + bar.timer = setTimeout(function () { bar.saved.hidden = true; }, 2400); |
| + tick(form); |
| + }) |
| + .catch(function () { |
| + bar.busy = false; |
| + bar.save.removeAttribute("aria-busy"); |
| + fallback(form); |
| + }); |
| + } |
| + |
| + // Leaving with unsaved changes asks first. |
| + window.addEventListener("beforeunload", function (e) { |
| + if (leaving) return; |
| + for (var i = 0; i < bars.length; i++) { |
| + if (dirty(bars[i])) { |
| + e.preventDefault(); |
| + e.returnValue = ""; |
| + return; |
| + } |
| + } |
| + }); |
| +})(); |
| + |
| +// Teams (Paul, 2026-11-11): Forget is a quiet action with Undo. The row |
| +// goes at once with "Studio forgotten. Undo" in its place; the link is |
| +// forgotten a few seconds later, or as the page is left. Undo before |
| +// then keeps it, last sign-in and all. Without script Forget posts. |
| +(function () { |
| + "use strict"; |
| + var list = document.querySelector("[data-team-list]"); |
| + var undo = document.querySelector("template[data-team-undo-template]"); |
| + if (!list || !undo || !window.fetch || !window.URLSearchParams) return; |
| + var WAIT = 6000; |
| + var pending = []; |
| + |
| + list.addEventListener("submit", function (e) { |
| + var form = e.target; |
| + if (!form.matches("[data-team-forget-form]")) return; |
| + e.preventDefault(); |
| + var row = form.closest("[data-team-row]"); |
| + row.insertAdjacentHTML("afterend", undo.innerHTML); |
| + var note = row.nextElementSibling; |
| + note.querySelector("[data-team-gone-text]").textContent = (list.dataset.forgotten || "%s").replace("%s", row.dataset.teamName || ""); |
| + row.hidden = true; |
| + var p = { row: row, form: form, note: note }; |
| + p.timer = setTimeout(function () { commit(p); }, WAIT); |
| + pending.push(p); |
| + var button = note.querySelector("[data-team-undo]"); |
| + button.addEventListener("click", function () { |
| + clearTimeout(p.timer); |
| + pending.splice(pending.indexOf(p), 1); |
| + note.remove(); |
| + row.hidden = false; |
| + var link = row.querySelector("a"); |
| + if (link) link.focus(); |
| + }); |
| + button.focus(); |
| + }); |
| + |
| + function commit(p) { |
| + var at = pending.indexOf(p); |
| + if (at < 0) return; |
| + pending.splice(at, 1); |
| + fetch(p.form.action, { method: "POST", credentials: "same-origin", keepalive: true, headers: { "Accept": "application/json" }, body: new URLSearchParams(new FormData(p.form)) }) |
| + .then(function (r) { |
| + if (!r.ok) throw new Error("forget"); |
| + p.note.remove(); |
| + p.row.remove(); |
| + // The last one gone: say there are none, as the page would. |
| + if (!list.querySelector("[data-team-row], [data-team-forgotten]")) { |
| + var none = document.createElement("p"); |
| + none.setAttribute("equipo-sp-empty", ""); |
| + none.setAttribute("data-empty-state", "teams.none"); |
| + none.textContent = list.dataset.none || ""; |
| + list.replaceWith(none); |
| + } |
| + }) |
| + .catch(function () { HTMLFormElement.prototype.submit.call(p.form); }); |
| + } |
| + |
| + // Leaving the page forgets what is waiting: Undo is no longer there. |
| + window.addEventListener("pagehide", function () { |
| + pending.slice().forEach(function (p) { |
| + clearTimeout(p.timer); |
| + commit(p); |
| + }); |
| + }); |
| +})(); |
| + |
| +// Add a team: the name from the address where it says one ("studio" in |
| +// studio.example.com), until the person types their own. |
| +(function () { |
| + "use strict"; |
| + var origin = document.querySelector("[data-team-origin]"); |
| + var name = document.querySelector("[data-team-add] [data-team-name]"); |
| + if (!origin || !name) return; |
| + var guessed = ""; |
| + origin.addEventListener("change", function () { |
| + if (name.value && name.value !== guessed) return; |
| + var host = ""; |
| + try { host = new URL(origin.value).hostname; } catch (e) { return; } |
| + var parts = host.split(".").filter(function (p) { return p && !/^(www|app|equipo)$/i.test(p); }); |
| + if (parts.length < 2 || /^\d+$/.test(parts[0])) return; |
| + guessed = parts[0].charAt(0).toUpperCase() + parts[0].slice(1); |
| + name.value = guessed; |
| + }); |
| })(); |
diff --git a/internal/equipo/team_links.go b/internal/equipo/team_links.go| index 72f68c69..e4d0a1f2 100644 |
| --- a/internal/equipo/team_links.go |
| +++ b/internal/equipo/team_links.go |
| @@ -12,7 +12,9 @@ func (a *application) teamLinkHandler() *setup.TeamLinkHandler { |
| return &setup.TeamLinkHandler{Store: a.store, Invalid: ErrInvalid, Failure: a.failure, |
| Actor: library.SessionActor(ErrForbidden), |
| Render: func(w http.ResponseWriter, r *http.Request, v setup.TeamLinkView) { |
| - data, err := a.page(r, "teams") |
| + // Teams is a Settings section (Paul, 2026-11-11): the |
| + // Settings nav beside it, the same width and headings. |
| + data, err := a.settingsPage(r, "teams", false) |
| if err != nil { |
| a.failure(w, r, err) |
| return |
diff --git a/internal/equipo/templates/housekeeping_settings.html b/internal/equipo/templates/housekeeping_settings.html| index b56cd67e..5291e0d7 100644 |
| --- a/internal/equipo/templates/housekeeping_settings.html |
| +++ b/internal/equipo/templates/housekeeping_settings.html |
| @@ -1,10 +1,24 @@ |
| -{{define "housekeeping-settings"}}<div equipo-hk-settings data-hk-settings{{if .Paused}} data-paused{{end}}> |
| -<ol equipo-rows><li equipo-row equipo-setting-row><span equipo-mono data-size="s" aria-hidden="true">{{icon "list-checks"}}</span><div equipo-row-body><p equipo-row-title><a equipo-row-link href="/housekeeping" data-hk-activity>{{copy "housekeeping.settings.activity"}}</a></p><p equipo-desc>{{copy "housekeeping.settings.lede"}}</p></div></li></ol> |
| -<form method="post" action="/settings/housekeeping/pause" equipo-hk-pause-form><input type="hidden" name="revision" value="{{.Revision}}">{{if .Paused}}<p equipo-hk-paused role="status">{{copy "housekeeping.paused"}}</p><input type="hidden" name="paused" value="0"><button rst-btn type="submit" data-hk-resume>{{copy "housekeeping.resume"}}</button>{{else}}<input type="hidden" name="paused" value="1"><button rst-btn type="submit" data-hk-pause>{{copy "housekeeping.pause"}}</button>{{end}}</form> |
| -<form method="post" action="/settings/housekeeping/quiet" equipo-form equipo-hk-quiet data-hk-quiet><input type="hidden" name="revision" value="{{.Revision}}"> |
| -<fieldset><legend>{{copy "housekeeping.settings.quiet"}}</legend><p equipo-desc>{{copy "housekeeping.settings.quiet_hint"}}</p> |
| -<label equipo-hk-check><input type="checkbox" name="on" value="1"{{if .QuietOn}} checked{{end}} data-hk-quiet-on>{{copy "housekeeping.settings.quiet_on"}}</label> |
| -<span equipo-hk-hours><label>{{copy "housekeeping.settings.from"}}<select rst-input name="from" data-hk-quiet-from>{{$f := .From}}{{range .Hours}}<option value="{{.Value}}"{{if eq .Value $f}} selected{{end}}>{{.Label}}</option>{{end}}</select></label> |
| +{{/* Settings' Housekeeping: two groups of the Settings pattern |
| + (settings_nav.html). Status applies at once: the state in words and |
| + Pause or Resume beside it. Quiet hours are editable fields saved from |
| + the savebar; the hours are off while the switch is (settings.js). */}} |
| +{{define "housekeeping-settings"}}<div equipo-hk-settings data-hk-settings> |
| +{{template "hk-status" .}} |
| +<form method="post" action="/settings/housekeeping/quiet" equipo-sp-group id="hk-quiet" aria-labelledby="hk-quiet-h" data-hk-quiet data-savebar-form><input type="hidden" name="revision" value="{{.Revision}}"> |
| +<div equipo-sp-group-head><h2 id="hk-quiet-h">{{copy "housekeeping.settings.quiet"}}</h2><p>{{copy "housekeeping.settings.quiet_hint"}}</p></div> |
| +<div equipo-sp-card> |
| +<div equipo-sp-row><label equipo-sp-label for="hk-quiet-on"><span equipo-sp-title>{{copy "housekeeping.settings.quiet_on"}}</span></label><span equipo-sp-control><label rst-switch><input type="checkbox" id="hk-quiet-on" name="on" value="1"{{if .QuietOn}} checked{{end}} data-hk-quiet-on data-enables="hk-hours"><span rst-switch-track aria-hidden="true"></span><span equipo-visually-hidden>{{copy "housekeeping.settings.quiet_on"}}</span></label></span></div> |
| +<fieldset equipo-sp-row id="hk-hours" aria-labelledby="hk-hours-h" data-hk-hours><span equipo-sp-label><span equipo-sp-title id="hk-hours-h">{{copy "housekeeping.settings.hours"}}</span></span> |
| +<span equipo-sp-control equipo-hk-hours><label>{{copy "housekeeping.settings.from"}}<select rst-input name="from" data-hk-quiet-from>{{$f := .From}}{{range .Hours}}<option value="{{.Value}}"{{if eq .Value $f}} selected{{end}}>{{.Label}}</option>{{end}}</select></label> |
| <label>{{copy "housekeeping.settings.until"}}<select rst-input name="until" data-hk-quiet-until>{{$u := .Until}}{{range .Hours}}<option value="{{.Value}}"{{if eq .Value $u}} selected{{end}}>{{.Label}}</option>{{end}}</select></label></span></fieldset> |
| -<button rst-btn="primary" type="submit" data-hk-quiet-save>{{copy "form.save"}}</button></form> |
| +</div> |
| +{{template "savebar"}} |
| +</form> |
| </div>{{end}} |
| +{{define "hk-status"}}<section equipo-sp-group id="hk-status" aria-labelledby="hk-status-h" data-hk-status{{if .Paused}} data-paused{{end}}> |
| +<div equipo-sp-group-head><h2 id="hk-status-h">{{copy "housekeeping.settings.status"}}</h2><p>{{copy "housekeeping.settings.status_hint"}}</p></div> |
| +<div equipo-sp-card><div equipo-sp-row> |
| +<div equipo-sp-label><p equipo-sp-title><span equipo-sp-dot{{if not .Paused}} data-active{{end}} aria-hidden="true"></span>{{if .Paused}}{{copy "housekeeping.settings.off"}}{{else}}{{copy "housekeeping.settings.on"}}{{end}}</p><p equipo-sp-desc>{{if .Paused}}{{copy "housekeeping.settings.off_desc"}} {{end}}<a href="/housekeeping" data-hk-activity>{{copy "housekeeping.settings.activity"}}</a></p></div> |
| +<form method="post" action="/settings/housekeeping/pause" equipo-sp-control><input type="hidden" name="revision" value="{{.Revision}}">{{if .Paused}}<input type="hidden" name="paused" value="0"><button rst-btn type="submit" data-hk-resume>{{copy "housekeeping.resume"}}</button>{{else}}<input type="hidden" name="paused" value="1"><button rst-btn type="submit" data-hk-pause>{{copy "housekeeping.pause"}}</button>{{end}}</form> |
| +</div></div> |
| +</section>{{end}} |
diff --git a/internal/equipo/templates/models.html b/internal/equipo/templates/models.html| index a2edf2b4..a7773ea6 100644 |
| --- a/internal/equipo/templates/models.html |
| +++ b/internal/equipo/templates/models.html |
| @@ -74,8 +74,8 @@ |
| <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{{if .Models.Adding}} data-adding{{end}} data-cursor="{{.Models.Cursor}}" data-connected="{{copy "chat.connections.connected_big"}}" data-connected-next="{{copy "chat.connections.connected_next"}}"> |
| -{{if .Models.Adding}}<header equipo-conn-page-head><h1>{{copy "chat.connections.add"}}</h1><p>{{copy "chat.connections.chooser_lede"}}</p></header> |
| -{{else}}<header equipo-conn-page-head><h1>{{copy "chat.connections.title"}}</h1>{{if .Models.Rows}}<p>{{copy "chat.connections.lede"}}</p>{{end}}</header>{{end}} |
| +{{if .Models.Adding}}{{template "settings-head" (dict "Title" "chat.connections.add" "Lede" "chat.connections.chooser_lede")}} |
| +{{else}}{{template "settings-head" (dict "Title" "chat.connections.title" "Lede" (and .Models.Rows "chat.connections.lede"))}}{{end}} |
| {{if .Models.Offline}}<p equipo-offline role="status">{{copy "chat.connections.offline"}}</p>{{end}} |
| <div data-connections-live> |
| {{if .Models.Adding}}{{range .Models.Ended}}{{template "conn-note" (dict "Row" . "Add" $.Models.Adding)}}{{end}} |
diff --git a/internal/equipo/templates/notebook.html b/internal/equipo/templates/notebook.html| index 38c57fd8..9a45187a 100644 |
| --- a/internal/equipo/templates/notebook.html |
| +++ b/internal/equipo/templates/notebook.html |
| @@ -6,7 +6,7 @@ |
| <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> |
| +{{template "settings-head" (dict "Title" "chat.notebook.title" "Lede" "chat.notebook.lede")}} |
| {{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> |
diff --git a/internal/equipo/templates/settings_hub.html b/internal/equipo/templates/settings_hub.html| index 964b16ae..4e35d8ab 100644 |
| --- a/internal/equipo/templates/settings_hub.html |
| +++ b/internal/equipo/templates/settings_hub.html |
| @@ -6,9 +6,9 @@ |
| <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-settings-section id="{{.Settings.Section}}"> |
| -{{if eq .Settings.Section "thinking"}}<div equipo-page-head><h1>{{copy "thinking.title"}}</h1></div> |
| +{{if eq .Settings.Section "thinking"}}{{template "settings-head" (dict "Title" "thinking.title" "Lede" "thinking.lede")}} |
| {{template "thinking-form" (dict "Thinking" .Settings.Thinking "From" "settings")}} |
| -{{else if eq .Settings.Section "housekeeping"}}<div equipo-page-head><h1>{{copy "settings.housekeeping"}}</h1></div> |
| +{{else if eq .Settings.Section "housekeeping"}}{{template "settings-head" (dict "Title" "settings.housekeeping" "Lede" "housekeeping.settings.lede")}} |
| {{with .HousekeepingSettings}}{{template "housekeeping-settings" .}}{{end}} |
| {{end}} |
| </section> |
diff --git a/internal/equipo/templates/settings_nav.html b/internal/equipo/templates/settings_nav.html| index 02bae4f3..a078a431 100644 |
| --- a/internal/equipo/templates/settings_nav.html |
| +++ b/internal/equipo/templates/settings_nav.html |
| @@ -2,3 +2,17 @@ |
| {{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}} |
| {{define "settings-rail"}}<nav rst-shell-nav equipo-settings-rail{{if .RailArriving}} data-arriving{{end}} aria-label="{{copy "nav.settings"}}"><a href="/conversation" equipo-settings-leave data-settings-leave>{{icon "chevron-left"}}<span>{{copy "brand"}}</span></a><p equipo-nav-group>{{copy "nav.settings"}}</p>{{range .SettingsNav}}<a href="{{.Href}}" data-rail-settings="{{.Key}}"{{if and .Current (not $.Models.Adding)}} aria-current="page"{{end}}>{{icon .Icon}}<span>{{copy .CopyKey}}</span></a>{{if eq .Key "connections"}}<a href="/conversation/settings/connections/add" equipo-settings-sub data-rail-settings="connections-add"{{if $.Models.Adding}} aria-current="page"{{end}}>{{icon "plus"}}<span>{{copy "chat.connections.add"}}</span></a>{{end}}{{end}}</nav>{{end}} |
| +{{/* The one Settings page pattern (Paul, 2026-11-11: "make sure all the |
| + settings screens have proper UX and aren't just random forms"): |
| + settings-head is every section's title and its one line; a section |
| + is groups ([equipo-sp-group]), each a heading, a line, and a card of |
| + rows with the label on the left and the control on the right. A |
| + group either applies each control at once (a Saved tick by its |
| + heading) or holds editable fields saved together from the savebar, |
| + never both. */}} |
| +{{define "settings-head"}}<header equipo-sp-head><h1>{{copy .Title}}</h1>{{with .Lede}}<p>{{copy .}}</p>{{end}}</header>{{end}} |
| +{{/* savebar: the bar fixed to the foot of the screen for a form of |
| + editable fields, Save on the right. settings.js disables Save until |
| + something changes, shows Unsaved changes and Discard, warns before |
| + leaving, and saves in place; without script Save just submits. */}} |
| +{{define "savebar"}}<div equipo-savebar data-savebar><div equipo-savebar-in><p equipo-savebar-note aria-live="polite"><span data-savebar-unsaved hidden>{{copy "settings.unsaved"}}</span><span data-savebar-saved hidden>{{icon "check"}}{{copy "settings.saved"}}</span></p><button type="reset" rst-btn data-quiet data-savebar-discard hidden>{{copy "settings.discard"}}</button><button rst-btn="primary" type="submit" data-savebar-save>{{copy "form.save"}}</button></div></div>{{end}} |
diff --git a/internal/equipo/templates/teams.html b/internal/equipo/templates/teams.html| index a212fdc7..bdd4c42b 100644 |
| --- a/internal/equipo/templates/teams.html |
| +++ b/internal/equipo/templates/teams.html |
| @@ -1,27 +1,41 @@ |
| {{define "view"}}page teams{{end}} |
| {{define "content"}} |
| -<h1>{{copy "teams.title"}}</h1> |
| -<section equipo-card> |
| -<h2>{{copy "teams.current"}}</h2> |
| -<a equipo-current-team href="/work">{{icon "users"}}<span equipo-secondary>{{.TeamName}}</span></a> |
| -<p>{{copy "nav.needs-you"}}: {{if ne .Teams.CurrentNeeds nil}}<span equipo-value>{{.Teams.CurrentNeeds}}</span>{{else}}<span equipo-value>{{copy "teams.counts_unknown"}}</span>{{end}}</p> |
| +<div equipo-settings-layout data-section="teams"> |
| +{{template "settings-nav" .}} |
| +<section equipo-settings-body equipo-settings-section id="teams" data-teams> |
| +{{template "settings-head" (dict "Title" "teams.title" "Lede" "teams.lede")}} |
| +<section equipo-sp-group aria-labelledby="teams-current-h"> |
| +<div equipo-sp-group-head><h2 id="teams-current-h">{{copy "teams.current"}}</h2></div> |
| +<div equipo-sp-card><div equipo-sp-row equipo-team-row data-team-current> |
| +<span equipo-team-mark aria-hidden="true">{{icon "users"}}</span> |
| +<div equipo-sp-label><p equipo-sp-title><a equipo-row-link equipo-current-team href="/work">{{.TeamName}}</a></p><p equipo-sp-desc>{{hostOf .Origin}}</p></div> |
| +<span equipo-sp-control>{{with .Teams.CurrentNeeds}}{{if gt (deref .) 0}}<a equipo-team-needs href="/tasks?needs=you" data-team-needs>{{copy "nav.needs-you"}} <b>{{deref .}}</b></a>{{end}}{{else}}<span equipo-sp-desc data-team-needs-unknown>{{copy "teams.counts_unknown"}}</span>{{end}}</span> |
| +</div></div> |
| </section> |
| -<h2>{{copy "teams.remembered"}}</h2> |
| -<p>{{copy "teams.directory_help"}}</p> |
| {{$request := .Teams.RequestID}}{{$origin := .Origin}} |
| -{{range .Teams.Links}} |
| -<section equipo-card equipo-team-link> |
| -<a href="{{if eq .Origin $origin}}/work{{else}}{{.Origin}}{{end}}" rel="noreferrer">{{icon "users"}}<span equipo-secondary>{{.Name}}</span></a> |
| -<p equipo-secondary>{{.Origin}}</p> |
| -<p>{{if .LastSignedInAt}}{{copy "teams.last_signin"}}: <time equipo-value datetime="{{.LastSignedInAt.Format "2006-01-02T15:04:05Z07:00"}}">{{.LastSignedInAt.Format "2006-01-02 15:04 UTC"}}</time>{{else}}{{copy "teams.last_signin_unknown"}}{{end}}</p> |
| -{{if ne .Origin $origin}}<p>{{copy "teams.remote_unavailable"}}</p>{{end}} |
| -<form method="post" action="/teams/links/{{.ID}}/forget"><input type="hidden" name="request_id" value="{{$request}}-{{.ID}}"><input type="hidden" name="revision" value="{{.Revision}}"><button rst-btn type="submit">{{copy "teams.forget"}}</button></form> |
| -</section> |
| -{{end}} |
| -<form equipo-form method="post" action="/teams/links"> |
| +<section equipo-sp-group aria-labelledby="teams-list-h"> |
| +<div equipo-sp-group-head><h2 id="teams-list-h">{{copy "teams.remembered"}}</h2></div> |
| +{{if .Teams.Links}}<ul equipo-sp-card role="list" data-team-list data-forgotten="{{copy "teams.forgotten"}}" data-none="{{copy "teams.none"}}"> |
| +{{range .Teams.Links}}<li equipo-sp-row equipo-team-row data-team-row data-team-name="{{.Name}}"> |
| +<span equipo-team-mark aria-hidden="true">{{icon "users"}}</span> |
| +<div equipo-sp-label><p equipo-sp-title><a equipo-row-link href="{{if eq .Origin $origin}}/work{{else}}{{.Origin}}{{end}}" rel="noreferrer">{{.Name}}</a></p> |
| +<p equipo-sp-desc equipo-team-facts><span>{{hostOf .Origin}}</span>{{if .LastSignedInAt}}<time datetime="{{.LastSignedInAt.Format "2006-01-02T15:04:05Z07:00"}}" title="{{.LastSignedInAt.UTC.Format "2006-01-02 15:04 UTC"}}">{{printf (copy "teams.last_signin_ago") (agoText .LastSignedInAt)}}</time>{{else}}<span>{{copy "teams.last_signin_unknown"}}</span>{{end}}{{if ne .Origin $origin}}<span>{{copy "teams.remote_unavailable"}}</span>{{end}}</p></div> |
| +<form method="post" action="/teams/links/{{.ID}}/forget" equipo-sp-control data-team-forget-form><input type="hidden" name="request_id" value="{{$request}}-{{.ID}}"><input type="hidden" name="revision" value="{{.Revision}}"><button type="submit" rst-btn data-quiet equipo-team-forget data-team-forget aria-label="{{copy "teams.forget_short"}} {{.Name}}">{{copy "teams.forget_short"}}</button></form> |
| +</li>{{end}} |
| +</ul> |
| +<template data-team-undo-template><li equipo-sp-row equipo-team-gone data-team-forgotten><p equipo-sp-label role="status" data-team-gone-text></p><span equipo-sp-control><button type="button" rst-btn data-quiet data-team-undo>{{copy "teams.undo"}}</button></span></li></template> |
| +{{else}}<p equipo-sp-empty data-empty-state="teams.none">{{copy "teams.none"}}</p>{{end}} |
| +<details equipo-team-add data-team-add> |
| +<summary rst-btn>{{icon "plus"}}<span>{{copy "teams.add_open"}}</span></summary> |
| +<form method="post" action="/teams/links" equipo-team-add-form> |
| <input type="hidden" name="request_id" value="{{.Teams.RequestID}}"><input type="hidden" name="revision" value="0"> |
| -<label>{{copy "teams.name"}}<input rst-input name="name" maxlength="160" required></label> |
| -<label>{{copy "teams.origin"}}<input rst-input type="url" name="origin" required></label> |
| -<button rst-btn type="submit">{{copy "teams.add"}}</button> |
| +<label equipo-team-field data-field="address"><span>{{copy "teams.origin"}}</span><input rst-input type="url" name="origin" inputmode="url" autocomplete="url" placeholder="https://" required data-team-origin></label> |
| +<label equipo-team-field data-field="name"><span>{{copy "teams.name"}}</span><input rst-input name="name" maxlength="160" required data-team-name></label> |
| +<p equipo-sp-desc>{{copy "teams.add_help"}}</p> |
| +<p equipo-team-add-actions><button rst-btn="primary" type="submit" data-team-remember>{{copy "teams.add"}}</button></p> |
| </form> |
| +</details> |
| +</section> |
| +</section> |
| +</div> |
| {{end}} |
diff --git a/internal/equipo/templates/work_parts.html b/internal/equipo/templates/work_parts.html| index 6d172253..cc256722 100644 |
| --- a/internal/equipo/templates/work_parts.html |
| +++ b/internal/equipo/templates/work_parts.html |
| @@ -33,16 +33,15 @@ |
| <div equipo-d-actions>{{with .Card}}<form method="post" action="/conversation/cards/{{.ID}}/answer"><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="task" value="{{$t.ID}}">{{range $.Task.Decision.Choices}}<button equipo-btn{{if .Primary}} data-primary{{end}} type="submit" name="choice" value="{{.Value}}" data-merge-choice="{{.Value}}">{{.Label}}</button>{{end}}</form>{{end}}{{if .Fold}}<form method="post" action="/tasks/{{$t.ID}}/duplicate"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="of" value="{{$t.Dup.ID}}"><button equipo-btn data-primary type="submit" data-task-duplicate>{{copy "work.decide.fold"}}</button></form>{{end}}{{if .Recover}}<form method="post" action="/conversation/tasks/{{$t.ID}}/recover"><input type="hidden" name="from" value="{{$.From}}"><button equipo-btn data-primary type="submit" data-task-recover>{{copy "work.recover"}}</button></form>{{end}}{{if .Retry}}<form method="post" action="/conversation/tasks/{{$t.ID}}/retry"><input type="hidden" name="from" value="{{$.From}}"><button {{if .Fold}}equipo-link{{else}}equipo-btn data-primary{{end}} type="submit" data-task-retry>{{copy "work.retry"}}</button></form>{{end}}{{if .Talk}}<a equipo-btn href="/conversation">{{copy "work.decide.talk"}}</a>{{end}}{{if .Cancel}}<form method="post" action="/conversation/tasks/{{$t.ID}}/cancel"><input type="hidden" name="from" value="{{$.From}}"><button equipo-link type="submit" data-task-cancel>{{copy "work.decide.cancel"}}</button></form>{{end}}{{with .Hint}}<span equipo-quiet>{{.}}</span>{{end}}</div> |
| </div>{{end}}{{end}} |
| {{define "project-facts"}}{{with .StackLine}}<span>{{if $.PhoneStack}}{{icon "phone"}}{{else}}{{icon "code"}}{{end}}{{.}}</span>{{end}}<span>{{icon "git"}}{{if eq (len .Repos) 1}}{{copy "work.project.one_repo"}}{{else}}{{printf (copy "work.project.repos") (len .Repos)}}{{end}}</span>{{with .ChecksLine}}<span data-tone="{{if $.Checks.Here}}positive{{else}}warning{{end}}" data-checks-fact>{{if $.Checks.Here}}{{icon "check-circle"}}{{else}}{{icon "help-circle"}}{{end}}{{.}}</span>{{end}}{{end}} |
| -{{define "thinking-form"}}{{with .Thinking}}<div equipo-thinking-words data-thinking-words="{{.JSON}}"{{if not $.From}} data-settings-live{{end}}>{{if not $.From}}<template equipo-saved-template><span equipo-saved-tick role="status">{{icon "check"}}<span>{{copy "settings.saved"}}</span></span></template>{{end}} |
| -{{if not $.From}}<div equipo-page-head><h1>{{copy "thinking.title"}}</h1></div>{{end}} |
| -<p equipo-lede>{{copy "thinking.lede"}}</p> |
| +{{define "thinking-form"}}{{with .Thinking}}<div equipo-thinking-words data-thinking-words="{{.JSON}}"> |
| {{if .Saved}}<p equipo-saved role="status">{{copy "thinking.saved"}}</p>{{end}} |
| <div equipo-thinking-preview aria-hidden="true"><p equipo-quiet>{{copy "thinking.preview"}}</p><p equipo-activity-line data-preview-line><span data-preview-phrase></span></p></div> |
| -<form method="post" action="/settings/thinking" equipo-thinking-form> |
| +<form method="post" action="/settings/thinking" equipo-thinking-form equipo-sp-group aria-labelledby="thinking-set-h"> |
| <input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="from" value="{{$.From}}"> |
| -<fieldset><legend equipo-visually-hidden>{{copy "thinking.title"}}</legend> |
| +<div equipo-sp-group-head><h2 id="thinking-set-h">{{copy "thinking.choose"}}</h2><p>{{copy "thinking.choose_hint"}}</p></div> |
| +<fieldset><legend equipo-visually-hidden>{{copy "thinking.choose"}}</legend> |
| <ol equipo-rows>{{$cur := .Set}}{{range .Sets}}<li equipo-row equipo-set-row data-set="{{.ID}}"><label><input type="radio" name="set" value="{{.ID}}"{{if eq .ID $cur}} checked{{end}}><span equipo-set-name>{{.Name}}</span><span equipo-desc>{{.Description}}</span>{{with index .Phrases "think"}}<span equipo-set-sample>{{range $i, $p := .}}{{if lt $i 3}}{{if $i}} · {{end}}{{$p}}{{end}}{{end}}</span>{{end}}</label></li>{{end}}</ol> |
| </fieldset> |
| -<button equipo-btn data-primary type="submit">{{copy "thinking.use"}}</button> |
| +<noscript><button equipo-btn data-primary type="submit">{{copy "thinking.use"}}</button></noscript> |
| </form> |
| </div>{{end}}{{end}} |
diff --git a/internal/equipotest/pages_test.go b/internal/equipotest/pages_test.go| index 3a035b9f..0de1ac6e 100644 |
| --- a/internal/equipotest/pages_test.go |
| +++ b/internal/equipotest/pages_test.go |
| @@ -118,6 +118,17 @@ func TestRailRoutes(t *testing.T) { |
| t.Fatal("not phone index") |
| } |
| } |
| + // Teams is a Settings section (Paul, 2026-11-11): one position at |
| + // each of three levels, the app rail's Settings, the Settings |
| + // rail's Teams and the in-page Settings menu's Teams. |
| + if path == "/teams" { |
| + want = 3 |
| + for _, mark := range []string{`id="nav-settings-hub" href="/conversation/settings" aria-current="page"`, `data-rail-settings="teams" aria-current="page"`, `data-settings-link="teams" aria-current="page"`} { |
| + if !strings.Contains(body, mark) { |
| + t.Fatalf("/teams is not placed in Settings: no %s", mark) |
| + } |
| + } |
| + } |
| if currentCount != want { |
| t.Fatalf("ambiguous navigation position: %s: %d", path, currentCount) |
| } |
diff --git a/internal/plan3test/teams_navigation_browser_test.go b/internal/plan3test/teams_navigation_browser_test.go| index f8148530..fdcf750a 100644 |
| --- a/internal/plan3test/teams_navigation_browser_test.go |
| +++ b/internal/plan3test/teams_navigation_browser_test.go |
| @@ -53,20 +53,28 @@ func TestTeamsHierarchyBrowser(t *testing.T) { |
| _, err := cdp.Call(ctx, target, emulation.SetScriptExecutionDisabled, emulation.SetScriptExecutionDisabledParams{Value: true}) |
| return err |
| })) |
| - run("desktop sidebar", chromedp.EmulateViewport(1280, 900), chromedp.Navigate(rig.Origin+"/conversation")) |
| - if !harness.Evaluate[bool](rig, `document.querySelector('#nav-teams').getBoundingClientRect().width>0 && document.querySelector('[equipo-team-heading]').contains(document.querySelector('#nav-teams'))`) { |
| - t.Fatal("desktop Teams link hidden") |
| + // Teams left the sidebar's team heading for Settings in 2e53061 |
| + // ("old pages out of the nav"; equipotest pins the heading without |
| + // it). On a desktop the Settings rail lists it. |
| + run("desktop Settings", chromedp.EmulateViewport(1280, 900), chromedp.Navigate(rig.Origin+"/conversation/settings")) |
| + if !harness.Evaluate[bool](rig, `(()=>{const a=document.querySelector('[equipo-settings-rail] a[data-rail-settings="teams"]');return !!a && a.getAttribute('href')==='/teams' && a.getBoundingClientRect().width>0 && !document.querySelector('#nav-teams')})()`) { |
| + t.Fatal("desktop Settings rail lacks a visible Teams link") |
| } |
| run("phone directory", chromedp.EmulateViewport(390, 844), chromedp.Navigate(rig.Origin+"/teams")) |
| if !harness.Evaluate[bool](rig, `document.querySelector('[equipo-current-team]').getBoundingClientRect().width>0 && document.documentElement.scrollWidth<=innerWidth`) { |
| t.Fatal("phone directory hidden or overflowing") |
| } |
| - run("open current team", chromedp.Click(chromedp.CSS(`[equipo-current-team]`)), chromedp.WaitVisible(chromedp.CSS(`#nav-journey`))) |
| - if !harness.Evaluate[bool](rig, `document.querySelector('[rst-shell-back] a').getAttribute('href')==='/teams' && document.querySelector('[rst-shell-back]').getBoundingClientRect().height>0`) { |
| - t.Fatal("team index lacks visible Teams parent") |
| + run("open current team", chromedp.Click(chromedp.CSS(`[equipo-current-team]`)), chromedp.WaitVisible(chromedp.CSS(`#nav-tasks`))) |
| + // The phone home screen hides its back strip on purpose (index |
| + // browser test: no strip above the home screen); its parent is still |
| + // Teams. |
| + if !harness.Evaluate[bool](rig, `document.querySelector('[rst-shell-back] a').getAttribute('href')==='/teams'`) { |
| + t.Fatal("team index parent is not Teams") |
| } |
| - run("open Journey", chromedp.Click(chromedp.CSS(`#nav-journey`)), chromedp.WaitVisible(chromedp.CSS(`main a[href="/tasks/`+task.ID+`"]`))) |
| - if !harness.Evaluate[bool](rig, `document.querySelector('[rst-shell-back] a').getAttribute('href')==='/work#nav-journey'`) { |
| + // Journey is an old page out of the nav since 2e53061; it is still |
| + // served for its links and its parent is still the team. |
| + run("open Journey", chromedp.Navigate(rig.Origin+"/journey"), chromedp.WaitVisible(chromedp.CSS(`main a[href="/tasks/`+task.ID+`"]`))) |
| + if !harness.Evaluate[bool](rig, `document.querySelector('[rst-shell-back] a').getAttribute('href').startsWith('/work')`) { |
| t.Fatal("page parent is not team") |
| } |
| run("open task", chromedp.Click(chromedp.CSS(`main a[href="/tasks/`+task.ID+`"]`)), chromedp.WaitVisible(chromedp.CSS(`main a[href="/tasks/`+task.ID+`/thread"]`))) |
diff --git a/internal/thintest/housekeeping_browser_test.go b/internal/thintest/housekeeping_browser_test.go| index 7a985786..85449e4f 100644 |
| --- a/internal/thintest/housekeeping_browser_test.go |
| +++ b/internal/thintest/housekeeping_browser_test.go |
| @@ -132,8 +132,8 @@ 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/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]`) |
| + q.check(`(()=>{window.__hkmark=1;for(const [s,v] of [['[data-hk-quiet-from]','23'],['[data-hk-quiet-until]','7']]){const e=document.querySelector(s);e.value=v;e.dispatchEvent(new Event('change',{bubbles:true}))}return true})()`, "choose hours") |
| + q.click(`[data-savebar-save]`) |
| // Saved in the background (Paul: a page post replayed the sliding nav). |
| q.wait(`window.__hkmark===1 && document.querySelector('#housekeeping [equipo-saved-tick][data-shown]') && document.querySelector('[data-hk-quiet-from]').value==='23' && document.querySelector('[data-hk-quiet-until]').value==='7'`, "quiet hours saved") |
| if h := r.housekeeping(); h.Quiet != (wire.QuietHours{From: 23, Until: 7}) { |
| @@ -141,7 +141,7 @@ func TestBrowserHousekeeping(t *testing.T) { |
| } |
| q.check(`(()=>{window.__hkmark=1;return true})()`, "mark") |
| q.click(`[data-hk-pause]`) |
| - q.wait(`window.__hkmark===1 && document.querySelector('[data-hk-settings][data-paused] [data-hk-resume]')`, "paused") |
| + q.wait(`window.__hkmark===1 && document.querySelector('[data-hk-status][data-paused] [data-hk-resume]')`, "paused") |
| q.stayed("Pause from Settings") |
| if h := r.housekeeping(); !h.Paused { |
| t.Fatal("Pause from Settings did not take") |
diff --git a/internal/thintest/settings_browser_test.go b/internal/thintest/settings_browser_test.go| index 3d87543c..b60b3eff 100644 |
| --- a/internal/thintest/settings_browser_test.go |
| +++ b/internal/thintest/settings_browser_test.go |
| @@ -59,15 +59,15 @@ func TestBrowserSettingsStayOnPage(t *testing.T) { |
| 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") |
| + p.wait(`!!document.querySelector('[data-hk-status][data-paused] [data-hk-resume]') && `+tick("housekeeping"), "paused") |
| same("Pause") |
| if h := r.housekeeping(); !h.Paused { |
| t.Fatalf("%d: Pause did not take", size.w) |
| } |
| p.click(`[data-hk-resume]`) |
| - p.wait(`!!document.querySelector('[data-hk-settings]:not([data-paused]) [data-hk-pause]')`, "resumed") |
| - p.check(`(()=>{document.querySelector('[data-hk-quiet-from]').value='21';document.querySelector('[data-hk-quiet-until]').value='6';return true})()`, "hours") |
| - p.click(`[data-hk-quiet-save]`) |
| + p.wait(`!!document.querySelector('[data-hk-status]:not([data-paused]) [data-hk-pause]')`, "resumed") |
| + p.check(`(()=>{for(const [s,v] of [['[data-hk-quiet-from]','21'],['[data-hk-quiet-until]','6']]){const e=document.querySelector(s);e.value=v;e.dispatchEvent(new Event('change',{bubbles:true}))}return true})()`, "hours") |
| + p.click(`[data-savebar-save]`) |
| p.waitFor(func() bool { return r.housekeeping().Quiet.From == 21 && !r.housekeeping().Paused }, "quiet hours saved") |
| p.wait(tick("housekeeping"), "quiet hours tick") |
| same("quiet hours") |
diff --git a/internal/thintest/settings_ux_browser_test.go b/internal/thintest/settings_ux_browser_test.go| new file mode 100644 |
| index 00000000..be9ba845 |
| --- /dev/null |
| +++ b/internal/thintest/settings_ux_browser_test.go |
| @@ -0,0 +1,280 @@ |
| +//go:build browser |
| + |
| +package thintest |
| + |
| +import ( |
| + "context" |
| + "os" |
| + "path/filepath" |
| + "strconv" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/equipo" |
| + "amadan.net/oficina/equipo/internal/wire" |
| + "github.com/chromedp/chromedp" |
| +) |
| + |
| +// The Settings UX pass (Paul, 2026-11-11: "Can we make sure all the |
| +// settings screens have proper UX and aren't just random forms? The |
| +// "Save" button should probably be fixed to the bottom of the screen, |
| +// bottom right?"). |
| + |
| +// settingsShot writes docs/mockups/built/2026-11-11/settings-<name>-<width>.png |
| +// when EQUIPO_CONN_SHOTS is set, as connShot does for Connections. |
| +func settingsShot(t *testing.T, p *innerPage, name string, width int64) { |
| + t.Helper() |
| + if os.Getenv("EQUIPO_CONN_SHOTS") == "" { |
| + return |
| + } |
| + dir := filepath.Join("..", "..", "docs", "mockups", "built", "2026-11-11") |
| + if err := os.MkdirAll(dir, 0755); err != nil { |
| + t.Fatal(err) |
| + } |
| + p.wait(`document.getAnimations().every(a=>a.playState!=='running'||a.effect&&a.effect.getTiming().iterations===Infinity)`, "the page settled") |
| + var shot []byte |
| + p.do(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| + var err error |
| + shot, err = chromedp.FullScreenshot(90)(ctx, target) |
| + return err |
| + })) |
| + if err := os.WriteFile(filepath.Join(dir, "settings-"+name+"-"+strconv.FormatInt(width, 10)+".png"), shot, 0644); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +var settingsSizes = []struct { |
| + w, h int64 |
| + touch bool |
| +}{{1280, 900, false}, {390, 844, true}} |
| + |
| +// setField changes a field the way a person does: its value, then the |
| +// change event. |
| +func setField(selector, value string) string { |
| + return `(()=>{const e=document.querySelector(` + jsString(selector) + `);e.value=` + jsString(value) + `;e.dispatchEvent(new Event('change',{bubbles:true}));return true})()` |
| +} |
| + |
| +// leaveWarns is whether leaving now would ask first. |
| +const leaveWarns = `(()=>{const e=new Event('beforeunload',{cancelable:true});dispatchEvent(e);return e.defaultPrevented})()` |
| + |
| +// TestBrowserSettingsSaveBar: on a screen with editable fields Save sits |
| +// in a bar fixed to the foot of the screen, on the right where the cards |
| +// end (the whole width on a phone); it is off until something changes, |
| +// then says Unsaved changes with Discard beside it, and leaving asks |
| +// first. Discard goes back; Save saves in place, says Saved, and the |
| +// page is never reloaded. Quiet hours' times are off while the switch |
| +// is, also when the page is opened again. |
| +func TestBrowserSettingsSaveBar(t *testing.T) { |
| + r := newToolRig(t) |
| + for _, size := range settingsSizes { |
| + p := openInner(t, r.inst.URL, r.inst.Cookie(), size.w, size.h, size.touch, "light", "no-preference") |
| + w := strconv.FormatInt(size.w, 10) |
| + p.open("/conversation/settings/housekeeping") |
| + p.wait(`!!document.querySelector('[data-savebar-save]')`, "the savebar") |
| + // The bar: fixed at the foot, Save on its right under the cards' edge. |
| + p.check(`(()=>{const b=document.querySelector('[data-savebar]').getBoundingClientRect(),s=document.querySelector('[data-savebar-save]').getBoundingClientRect(),card=document.querySelector('#hk-quiet [equipo-sp-card]').getBoundingClientRect();const pos=getComputedStyle(document.querySelector('[data-savebar]')).position;const rail=document.querySelector('[rst-shell-rail]').getBoundingClientRect();return pos==='fixed'&&Math.abs(b.bottom-innerHeight)<1&&Math.abs(s.right-card.right)<=2&&(innerWidth<800?Math.abs(b.left)<1&&Math.abs(b.width-innerWidth)<1:Math.abs(b.left-rail.right)<=1)})()`, w+": the savebar is not fixed at the foot with Save under the cards' right edge") |
| + p.check(`document.querySelector('[data-savebar-save]').disabled && document.querySelector('[data-savebar-unsaved]').hidden && document.querySelector('[data-savebar-discard]').hidden`, w+": Save is on, or Unsaved changes shows, before any change") |
| + p.check(`!`+leaveWarns, w+": leaving warns with nothing changed") |
| + settingsShot(t, p, "housekeeping", size.w) |
| + p.check(`(()=>{window.__nav=performance.getEntriesByType('navigation').length;window.__href=location.href;return true})()`, "mark") |
| + |
| + // The switch off: the hours go off with it, and the bar wakes. |
| + p.click(`#hk-quiet [rst-switch]`) |
| + p.wait(`!document.querySelector('[data-hk-quiet-on]').checked`, "switched off") |
| + p.check(`document.querySelector('#hk-hours').disabled && document.querySelector('[data-hk-quiet-from]').matches(':disabled') && document.querySelector('[data-hk-quiet-until]').matches(':disabled')`, w+": the hours are not off with the switch") |
| + p.check(`!document.querySelector('[data-savebar-save]').disabled && !document.querySelector('[data-savebar-unsaved]').hidden && document.querySelector('[data-savebar-unsaved]').checkVisibility() && document.querySelector('[data-savebar-discard]').checkVisibility()`, w+": no Unsaved changes, Discard and Save after a change") |
| + p.check(leaveWarns, w+": leaving with unsaved changes does not ask") |
| + settingsShot(t, p, "housekeeping-unsaved", size.w) |
| + |
| + // Discard: back to what was saved, nothing to warn about. |
| + p.click(`[data-savebar-discard]`) |
| + p.wait(`document.querySelector('[data-hk-quiet-on]').checked && !document.querySelector('#hk-hours').disabled && document.querySelector('[data-savebar-save]').disabled && document.querySelector('[data-savebar-unsaved]').hidden`, "discarded") |
| + p.check(`!`+leaveWarns, w+": leaving warns after Discard") |
| + |
| + // Save: new hours, in place. |
| + from := map[int64]string{1280: "20", 390: "19"}[size.w] |
| + p.check(setField(`[data-hk-quiet-from]`, from), "From") |
| + p.check(`!document.querySelector('[data-savebar-save]').disabled`, w+": Save stays off after a change") |
| + p.click(`[data-savebar-save]`) |
| + p.wait(`!document.querySelector('[data-savebar-saved]').hidden && document.querySelector('[data-savebar-save]').disabled && document.querySelector('[data-savebar-unsaved]').hidden`, "Saved in the bar") |
| + p.stayed(w + ": Save") |
| + p.check(`!`+leaveWarns, w+": leaving warns after Save") |
| + want, _ := strconv.Atoi(from) |
| + p.waitFor(func() bool { return r.housekeeping().Quiet == wire.QuietHours{From: want, Until: 8} }, "the hours saved") |
| + settingsShot(t, p, "housekeeping-saved", size.w) |
| + // What Discard goes back to is now what was saved. |
| + p.check(setField(`[data-hk-quiet-until]`, "9"), "Until") |
| + p.click(`[data-savebar-discard]`) |
| + p.wait(`document.querySelector('[data-hk-quiet-until]').value==='8' && document.querySelector('[data-hk-quiet-from]').value===`+jsString(from), "discarded to the saved hours") |
| + |
| + // Quiet hours off, saved: opened again, the times are off. |
| + p.click(`#hk-quiet [rst-switch]`) |
| + p.click(`[data-savebar-save]`) |
| + p.waitFor(func() bool { q := r.housekeeping().Quiet; return q.From == q.Until }, "quiet hours off") |
| + p.wait(`document.querySelector('[data-savebar-save]').disabled`, "saved") |
| + p.open("/conversation/settings/housekeeping") |
| + p.check(`!document.querySelector('[data-hk-quiet-on]').checked && document.querySelector('#hk-hours').disabled && document.querySelector('[data-savebar-save]').disabled`, w+": quiet hours off, but the times are on when the page opens") |
| + settingsShot(t, p, "housekeeping-quiet-off", size.w) |
| + // And on again for the next size. |
| + p.click(`#hk-quiet [rst-switch]`) |
| + p.click(`[data-savebar-save]`) |
| + p.waitFor(func() bool { q := r.housekeeping().Quiet; return q.From != q.Until }, "quiet hours on") |
| + p.wait(`document.querySelector('[data-savebar-save]').disabled`, "saved") |
| + p.stop() |
| + } |
| +} |
| + |
| +// TestBrowserSettingsHousekeepingGroups: Pause belongs with the state it |
| +// changes, in the Status group, and applies at once with a tick; Quiet |
| +// hours are their own group with the savebar. Every control sits on one |
| +// right edge (on a phone the hours drop under their label). |
| +func TestBrowserSettingsHousekeepingGroups(t *testing.T) { |
| + r := newToolRig(t) |
| + for _, size := range settingsSizes { |
| + p := openInner(t, r.inst.URL, r.inst.Cookie(), size.w, size.h, size.touch, "light", "no-preference") |
| + w := strconv.FormatInt(size.w, 10) |
| + p.open("/conversation/settings/housekeeping") |
| + p.check(`(()=>{const st=document.querySelector('[data-hk-status]');const row=st.querySelector('[equipo-sp-row]');const pause=row.querySelector('[data-hk-pause]');const t=row.querySelector('[equipo-sp-title]');return st.querySelector('h2').textContent==='Status'&&t.textContent.trim()==='Housekeeping is on'&&!!pause&&Math.abs(pause.getBoundingClientRect().top+pause.getBoundingClientRect().height/2-(row.getBoundingClientRect().top+row.getBoundingClientRect().height/2))<4&&!st.querySelector('[data-savebar]')})()`, w+": Pause is not beside Housekeeping is on in the Status group") |
| + p.check(`(()=>{const q=document.querySelector('#hk-quiet');return q.querySelector('h2').textContent.startsWith('Quiet hours')&&!!q.querySelector('[data-savebar]')&&!q.querySelector('[data-hk-pause],[data-hk-resume]')})()`, w+": Quiet hours are not their own group with the savebar") |
| + p.check(`(()=>{const e=s=>document.querySelector(s).getBoundingClientRect().right;const xs=[e('[data-hk-pause]'),e('#hk-quiet [rst-switch]')];if(innerWidth>=560)xs.push(e('[data-hk-quiet-until]'));return Math.max(...xs)-Math.min(...xs)<=2})()`, w+": the controls are not on one right edge") |
| + p.check(`(()=>{const a=document.querySelector('[equipo-sp-head] h1'),b=document.querySelector('#hk-status h2'),c=document.querySelector('#hk-quiet h2');return a.getBoundingClientRect().left===b.getBoundingClientRect().left&&b.getBoundingClientRect().left===c.getBoundingClientRect().left})()`, w+": the headings do not share a left edge") |
| + p.fits("housekeeping") |
| + p.check(`(()=>{window.__nav=performance.getEntriesByType('navigation').length;window.__href=location.href;return true})()`, "mark") |
| + // Unsaved hours survive a Pause, and save over the new revision. |
| + p.check(setField(`[data-hk-quiet-until]`, "7"), "Until") |
| + p.click(`[data-hk-pause]`) |
| + p.wait(`!!document.querySelector('[data-hk-status][data-paused] [data-hk-resume]') && !!document.querySelector('#hk-status [equipo-saved-tick][data-shown]:not([data-gone])')`, "paused at once") |
| + p.check(`document.querySelector('#hk-status [equipo-sp-title]').textContent.trim()==='Housekeeping is paused' && document.querySelector('[data-hk-quiet-until]').value==='7' && !document.querySelector('[data-savebar-save]').disabled`, w+": Pause lost the unsaved hours or did not say paused") |
| + p.stayed(w + ": Pause") |
| + settingsShot(t, p, "housekeeping-paused", size.w) |
| + p.click(`[data-savebar-save]`) |
| + p.waitFor(func() bool { h := r.housekeeping(); return h.Paused && h.Quiet.Until == 7 }, "the hours saved after Pause") |
| + p.click(`[data-hk-resume]`) |
| + p.wait(`!!document.querySelector('[data-hk-status]:not([data-paused]) [data-hk-pause]')`, "resumed") |
| + p.waitFor(func() bool { return !r.housekeeping().Paused }, "resumed on the server") |
| + p.check(setField(`[data-hk-quiet-until]`, "8"), "Until back") |
| + p.click(`[data-savebar-save]`) |
| + p.waitFor(func() bool { return r.housekeeping().Quiet.Until == 8 }, "Until back saved") |
| + p.stop() |
| + } |
| +} |
| + |
| +// TestBrowserSettingsTeams: Teams is a Settings section like the others. |
| +// The current team is one header row; remembered teams are a list whose |
| +// rows open the team, "Last signed in" words with the time on hover; |
| +// Forget is quiet, with Undo before it takes; Add a team is a button that |
| +// opens a compact form, the address first and the name from it. |
| +func TestBrowserSettingsTeams(t *testing.T) { |
| + r := newToolRig(t) |
| + owner := equipo.Actor{Address: Owner} |
| + for i, size := range settingsSizes { |
| + studio, err := r.inst.Store.RememberTeam(r.ctx, owner, equipo.TeamLink{Origin: "https://studio" + strconv.Itoa(i) + ".example.com", Name: "Studio"}, equipo.Mutation{RequestID: "teams-ux-" + strconv.Itoa(i)}) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + p := openInner(t, r.inst.URL, r.inst.Cookie(), size.w, size.h, size.touch, "light", "no-preference") |
| + w := strconv.FormatInt(size.w, 10) |
| + p.open("/teams") |
| + p.check(`(()=>{const h=document.querySelector('[equipo-sp-head]');return h.querySelector('h1').textContent==='Teams'&&h.querySelectorAll('p').length===1&&!!document.querySelector('[equipo-current-team][href="/work"]')})()`, w+": Teams has no Settings head or current team row") |
| + if size.w > 800 { |
| + p.check(`document.querySelector('[equipo-settings-rail]').checkVisibility() && document.querySelector('[equipo-settings-rail] [aria-current="page"]').dataset.railSettings==='teams'`, "1280: Teams is not a section in the Settings rail") |
| + } |
| + row := `[data-team-row][data-team-name="Studio"]` |
| + p.check(`(()=>{const row=document.querySelector(`+jsString(row)+`);const a=row.querySelector('[equipo-row-link]');const r=row.getBoundingClientRect();const hit=document.elementFromPoint(r.left+r.width*0.45,r.bottom-6);return a.getAttribute('href')==='https://studio`+strconv.Itoa(i)+`.example.com'&&(hit===a||a.contains(hit))&&getComputedStyle(row.querySelector('[data-team-forget]')).backgroundColor!==getComputedStyle(document.querySelector('[data-team-add] > summary')).backgroundColor})()`, w+": the row does not open the team, or Forget is not quiet") |
| + p.check(`(()=>{const add=document.querySelector('[data-team-add]');return !add.open&&!add.querySelector('[data-team-origin]').checkVisibility()})()`, w+": the add form shows before Add a team") |
| + p.fits("teams") |
| + settingsShot(t, p, "teams", size.w) |
| + p.check(`(()=>{window.__nav=performance.getEntriesByType('navigation').length;window.__href=location.href;return true})()`, "mark") |
| + |
| + // Forget, then Undo: the row back, the link kept. |
| + p.click(row + ` [data-team-forget]`) |
| + p.wait(`document.querySelector(`+jsString(row)+`).hidden && document.querySelector('[data-team-forgotten]').textContent.includes('Studio forgotten.') && document.activeElement===document.querySelector('[data-team-undo]')`, "forgotten, with Undo") |
| + settingsShot(t, p, "teams-undo", size.w) |
| + p.click(`[data-team-undo]`) |
| + p.wait(`!document.querySelector(`+jsString(row)+`).hidden && !document.querySelector('[data-team-forgotten]')`, "undone") |
| + links, err := r.inst.Store.TeamLinks(r.ctx, owner) |
| + if err != nil || !hasLink(links, studio.ID) { |
| + t.Fatalf("%s: Undo did not keep the link: %v %v", w, links, err) |
| + } |
| + // Forget for good: it goes after the wait. |
| + p.click(row + ` [data-team-forget]`) |
| + p.waitForLong(func() bool { |
| + l, err := r.inst.Store.TeamLinks(r.ctx, owner) |
| + return err == nil && !hasLink(l, studio.ID) |
| + }, "forgotten for good") |
| + p.wait(`!document.querySelector(`+jsString(row)+`) && !document.querySelector('[data-team-forgotten]') && document.querySelector('[data-empty-state="teams.none"]').textContent==='No other teams yet.'`, "the row gone, none left") |
| + p.stayed(w + ": Forget") |
| + |
| + // Add a team: compact, address first, the name from it. |
| + p.click(`[data-team-add] > summary`) |
| + p.wait(`document.querySelector('[data-team-origin]').checkVisibility()`, "the add form") |
| + p.check(`(()=>{const f=[...document.querySelectorAll('[equipo-team-add-form] input:not([type=hidden])')];const card=document.querySelector('[equipo-team-add-form]').getBoundingClientRect();return f[0].name==='origin'&&f[1].name==='name'&&(innerWidth<800||f.every(i=>i.getBoundingClientRect().width<card.width*0.75))})()`, w+": the address is not first, or the fields are full-bleed") |
| + p.check(setField(`[data-team-origin]`, "https://design.example.org"), "address") |
| + p.check(`document.querySelector('[data-team-add] [data-team-name]').value==='Design'`, w+": the name is not filled in from the address") |
| + p.fits("the add form") |
| + settingsShot(t, p, "teams-add", size.w) |
| + p.click(`[data-team-remember]`) |
| + p.wait(`location.pathname==='/teams' && !!document.querySelector('[data-team-row][data-team-name="Design"]')`, "the new team") |
| + links, _ = r.inst.Store.TeamLinks(r.ctx, owner) |
| + for _, l := range links { |
| + if l.Name == "Design" { |
| + if err := r.inst.Store.ForgetTeam(r.ctx, owner, l.ID, equipo.Mutation{RequestID: "teams-ux-design-" + w, Revision: l.Revision}); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + } |
| + p.stop() |
| + } |
| +} |
| + |
| +func hasLink(links []equipo.TeamLink, id string) bool { |
| + for _, l := range links { |
| + if l.ID == id { |
| + return true |
| + } |
| + } |
| + return false |
| +} |
| + |
| +// waitForLong polls a server-side condition for up to fifteen seconds. |
| +func (p *innerPage) waitForLong(cond func() bool, what string) { |
| + p.t.Helper() |
| + for range 3 { |
| + for i := 0; i < 100; i++ { |
| + if cond() { |
| + return |
| + } |
| + time.Sleep(50 * time.Millisecond) |
| + } |
| + } |
| + p.t.Fatalf("timed out waiting for %s", what) |
| +} |
| + |
| +// TestBrowserSettingsShots: every Settings screen at 1280 and 390, one |
| +// head and one content width, nothing wider than the screen, and the |
| +// after shots. |
| +func TestBrowserSettingsShots(t *testing.T) { |
| + r := newToolRig(t) |
| + if _, err := r.inst.Store.RememberTeam(r.ctx, equipo.Actor{Address: Owner}, equipo.TeamLink{Origin: "https://studio.example.com", Name: "Studio"}, equipo.Mutation{RequestID: "shots-team"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, size := range settingsSizes { |
| + p := openInner(t, r.inst.URL, r.inst.Cookie(), size.w, size.h, size.touch, "light", "no-preference") |
| + var width float64 |
| + for _, s := range []struct{ name, path string }{{"thinking", "/conversation/settings/thinking"}, {"connections", "/conversation/settings/connections"}, {"connections-add", "/conversation/settings/connections/add"}, {"housekeeping", "/conversation/settings/housekeeping"}, {"notebook", "/conversation/settings/notebook"}, {"teams", "/teams"}} { |
| + p.open(s.path) |
| + p.check(`document.querySelectorAll('[equipo-settings-body] h1').length===1 && !!document.querySelector('[equipo-settings-body] [equipo-sp-head] h1') && getComputedStyle(document.querySelector('[equipo-sp-head] h1')).fontSize==='24px'`, s.name+": not one Settings head") |
| + got := eval[float64](p, `document.querySelector('[equipo-settings-body]').getBoundingClientRect().width`) |
| + if width == 0 { |
| + width = got |
| + } else if got != width { |
| + t.Fatalf("%d %s: content width %v, the others %v", size.w, s.name, got, width) |
| + } |
| + p.fits(s.name) |
| + if s.name != "housekeeping" && s.name != "teams" { |
| + settingsShot(t, p, s.name, size.w) |
| + } |
| + } |
| + p.stop() |
| + } |
| +} |
diff --git a/internal/thintest/settings_ux_pages_test.go b/internal/thintest/settings_ux_pages_test.go| new file mode 100644 |
| index 00000000..94805536 |
| --- /dev/null |
| +++ b/internal/thintest/settings_ux_pages_test.go |
| @@ -0,0 +1,147 @@ |
| +package thintest |
| + |
| +import ( |
| + "net/http" |
| + "net/url" |
| + "regexp" |
| + "strconv" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/equipo" |
| +) |
| + |
| +// TestPagesSettingsPattern: Paul, 2026-11-11: "Can we make sure all the |
| +// settings screens have proper UX and aren't just random forms?" Every |
| +// Settings section, Teams included, opens with the one Settings head (a |
| +// title and one line) beside the Settings menu, current; Housekeeping is |
| +// a Status group (the state in words with Pause beside it) and a Quiet |
| +// hours group of fields with the savebar, never the two mixed; without |
| +// script Save is a plain submit and the forms still post. |
| +func TestPagesSettingsPattern(t *testing.T) { |
| + r := newToolRig(t) |
| + owner := r.inst.Cookie() |
| + for _, tc := range []struct{ path, current, head string }{ |
| + {"/conversation/settings/thinking", "thinking", "Thinking words"}, |
| + {"/conversation/settings/connections", "connections", "Connections"}, |
| + {"/conversation/settings/connections/add", "connections", "Add a connection"}, |
| + {"/conversation/settings/housekeeping", "housekeeping", "Housekeeping"}, |
| + {"/conversation/settings/notebook", "notebook", "Notebook"}, |
| + {"/teams", "teams", "Teams"}, |
| + } { |
| + page := r.get(owner, tc.path, 200) |
| + if !strings.Contains(page, `<header equipo-sp-head><h1>`+tc.head+`</h1><p>`) || strings.Count(page, "<h1>") != 1 { |
| + t.Errorf("%s: not one Settings head %q with its line", tc.path, tc.head) |
| + } |
| + if !strings.Contains(page, `data-settings-link="`+tc.current+`" aria-current="page"`) || !strings.Contains(page, `data-rail-settings="`+tc.current+`"`) { |
| + t.Errorf("%s: the Settings menu and rail do not mark %s", tc.path, tc.current) |
| + } |
| + } |
| + |
| + hk := r.get(owner, "/conversation/settings/housekeeping", 200) |
| + status := between(t, hk, `<section equipo-sp-group id="hk-status"`, `</section>`) |
| + for _, want := range []string{`<h2 id="hk-status-h">Status</h2>`, "Housekeeping is on", `action="/settings/housekeeping/pause"`, `data-hk-pause`, `data-hk-activity`} { |
| + if !strings.Contains(status, want) { |
| + t.Errorf("Status lacks %s", want) |
| + } |
| + } |
| + quiet := between(t, hk, `<form method="post" action="/settings/housekeeping/quiet"`, `</form>`) |
| + for _, want := range []string{`data-savebar-form`, `<h2 id="hk-quiet-h">Quiet hours</h2>`, `rst-switch`, `data-enables="hk-hours"`, `<fieldset equipo-sp-row id="hk-hours"`, `data-savebar`, `<button rst-btn="primary" type="submit" data-savebar-save>Save</button>`, `data-savebar-discard hidden`, `data-savebar-unsaved hidden`} { |
| + if !strings.Contains(quiet, want) { |
| + t.Errorf("Quiet hours lacks %s", want) |
| + } |
| + } |
| + // Never mixed: no Pause in the savebar's group, no savebar in Status. |
| + if strings.Contains(quiet, "data-hk-pause") || strings.Contains(status, "data-savebar") || strings.Count(hk, "data-savebar-form") != 1 { |
| + t.Error("a group mixes controls that apply at once with fields saved from the bar") |
| + } |
| + // Without script Save is a plain post that comes back here. |
| + rev := regexp.MustCompile(`name="revision" value="(\d+)"`).FindStringSubmatch(quiet)[1] |
| + if code, to := r.post(owner, "/settings/housekeeping/quiet", url.Values{"revision": {rev}, "on": {"1"}, "from": {"21"}, "until": {"7"}}); code != http.StatusSeeOther || to != "/conversation/settings/housekeeping" { |
| + t.Fatalf("Save without script: %d to %q", code, to) |
| + } |
| + if q := r.housekeeping().Quiet; q.From != 21 || q.Until != 7 { |
| + t.Fatalf("quiet hours without script: %+v", q) |
| + } |
| + // Quiet hours off: the switch is off and the hours are drawn anyway, |
| + // for settings.js to turn off with it. |
| + h := r.housekeeping() |
| + if _, err := r.client.SetQuiet(r.ctx, h.Paused, 3, 3, h.Revision); err != nil { |
| + t.Fatal(err) |
| + } |
| + off := r.get(owner, "/conversation/settings/housekeeping", 200) |
| + if strings.Contains(between(t, off, `id="hk-quiet-on"`, `>`), "checked") || !strings.Contains(off, `data-hk-quiet-from`) { |
| + t.Error("quiet hours off: the switch is on, or the hours are gone") |
| + } |
| + |
| + // Thinking words apply at once: no Save, the old button only without script. |
| + thinking := r.get(owner, "/conversation/settings/thinking", 200) |
| + if !strings.Contains(thinking, `<h2 id="thinking-set-h">Word set</h2><p>Your choice applies at once.</p>`) || !strings.Contains(thinking, `<noscript><button equipo-btn data-primary type="submit">Use these words</button></noscript>`) || strings.Contains(thinking, "data-savebar") { |
| + t.Error("Thinking words is not one group that applies at once") |
| + } |
| +} |
| + |
| +// TestPagesSettingsTeams: Teams as a Settings section (Paul, 2026-11-11: |
| +// "Teams UI is all over the place too"): the current team one header row |
| +// with its address and no zero count; each remembered team a row that |
| +// opens it, its address and "Last signed in" in words with the exact time |
| +// on hover, Forget a quiet button; Add a team a button over a compact |
| +// form, the address first, the long explanation as help beside it. |
| +func TestPagesSettingsTeams(t *testing.T) { |
| + r := newToolRig(t) |
| + owner := r.inst.Cookie() |
| + link, err := r.inst.Store.RememberTeam(r.ctx, equipo.Actor{Address: Owner}, equipo.TeamLink{Origin: "https://studio.example.com", Name: "Studio"}, equipo.Mutation{RequestID: "pages-teams"}) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + at := time.Now().Add(-4*24*time.Hour - time.Hour).UTC() |
| + if _, err := r.inst.DB.Writer().Exec("UPDATE team_links SET last_signed_in_at = ? WHERE id = ?", at, link.ID); err != nil { |
| + t.Fatal(err) |
| + } |
| + page := r.get(owner, "/teams", 200) |
| + current := between(t, page, `data-team-current`, `</section>`) |
| + host := strings.TrimPrefix(strings.TrimPrefix(r.inst.URL, "http://"), "https://") |
| + if !strings.Contains(current, `<a equipo-row-link equipo-current-team href="/work">`) || !strings.Contains(current, `<p equipo-sp-desc>`+host+`</p>`) || strings.Contains(current, "data-team-needs>") { |
| + t.Error("the current team is not one row with its address and no zero count") |
| + } |
| + row := between(t, page, `data-team-name="Studio"`, `</li>`) |
| + for _, want := range []string{ |
| + `<a equipo-row-link href="https://studio.example.com" rel="noreferrer">Studio</a>`, |
| + `<span>studio.example.com</span>`, |
| + `title="` + at.Format("2006-01-02 15:04") + ` UTC">Last signed in 4 days ago</time>`, |
| + `<button type="submit" rst-btn data-quiet equipo-team-forget data-team-forget aria-label="Forget Studio">Forget</button>`, |
| + } { |
| + if !strings.Contains(row, want) { |
| + t.Errorf("the remembered row lacks %s", want) |
| + } |
| + } |
| + add := between(t, page, `<details equipo-team-add data-team-add>`, `</details>`) |
| + if !strings.Contains(add, `<summary rst-btn>`) || strings.Index(add, `name="origin"`) > strings.Index(add, `name="name"`) || !strings.Contains(add, "Each team has its own sign-in") { |
| + t.Error("Add a team is not a button over a compact form, the address first, with its help") |
| + } |
| + if strings.Contains(page, "Add links to other Equipo instances") || strings.Contains(page, "Forget this link") { |
| + t.Error("the old paragraph or Forget this link is still on the page") |
| + } |
| + // Without script Forget still posts and comes back to Teams. |
| + if code, to := r.post(owner, "/teams/links/"+link.ID+"/forget", url.Values{"request_id": {"pages-forget"}, "revision": {strconv.FormatInt(link.Revision, 10)}}); code != http.StatusSeeOther || to != "/teams" { |
| + t.Fatalf("Forget without script: %d to %q", code, to) |
| + } |
| + if after := r.get(owner, "/teams", 200); strings.Contains(after, `data-team-name="Studio"`) || !strings.Contains(after, "No other teams yet.") { |
| + t.Error("Forget without script did not forget, or no empty line") |
| + } |
| +} |
| + |
| +// between is the part of page from start up to the first end after it. |
| +func between(t *testing.T, page, start, end string) string { |
| + t.Helper() |
| + i := strings.Index(page, start) |
| + if i < 0 { |
| + t.Fatalf("no %s", start) |
| + } |
| + j := strings.Index(page[i:], end) |
| + if j < 0 { |
| + t.Fatalf("no %s after %s", end, start) |
| + } |
| + return page[i : i+j] |
| +} |