Merge branch 'team-panel' into main
Team panel: compact specialist rows and a drawer per specialist Sidebar rows are two lines at most, in plain words; a row opens that specialist's drawer (activity, files, connection, an Ask box, recent work). The rail browser drive expects the merge Equipo makes on its own; the drawer's edge is an inset hairline. Hosted CI passed on 766d422.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 files changed,
+1,787
−137
.rastrillo/budgets.txt+2 −2docs/mockups/built/2026-11-11/team-panel-engineering-1280.pngbinarydocs/mockups/built/2026-11-11/team-panel-engineering-390.pngbinarydocs/mockups/built/2026-11-11/team-panel-page-1280-dark.pngbinarydocs/mockups/built/2026-11-11/team-panel-rail-1280.pngbinarydocs/mockups/built/2026-11-11/team-panel-rail-390.pngbinarydocs/mockups/built/2026-11-11/team-panel-review-1280.pngbinarydocs/mockups/built/2026-11-11/team-panel-review-390.pngbinarydocs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+34 −0internal/browsertest/browser.go+9 −1internal/equipo/activity/activity.go+460 −0internal/equipo/app.go+1 −0internal/equipo/chat/team.go+32 −0internal/equipo/chat_navigation_test.go+15 −10internal/equipo/copy.go+35 −0internal/equipo/handlers.go+1 −0internal/equipo/rail.go+15 −28internal/equipo/render.go+1 −1internal/equipo/static/equipo.css+123 −36internal/equipo/static/nav-stream.js+22 −30internal/equipo/static/team-panel.js+150 −0internal/equipo/team_activity.go+92 −0internal/equipo/team_activity_test.go+147 −0internal/equipo/team_panel.go+222 −0internal/equipo/templates/chrome.html+3 −7internal/equipo/templates/team.html+50 −0internal/equipotest/perf_test.go+1 −1internal/headless/browser_review_test.go+10 −4internal/thintest/inner_browser_test.go+18 −15internal/thintest/pages_test.go+2 −2internal/thintest/team_panel_browser_test.go+146 −0internal/thintest/team_panel_test.go+147 −0scripts/runner-reference-allowlist.json+49 −0
CI passed — run details
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index ce857bfb..fd98b6ce 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 16000 - Projects UX merged onto the Connections countdown and the Settings pattern: measured 15942 with all three. Projects UX adds the Projects page order (starred, active, quiet folded), the auto-star rules and their receipt, whole-word descriptions and the star action (project_order.go, about 200 lines), the Mac decision and Ask about this; measured 15815. 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/equipo 16350 - The team panel merged onto Projects UX, the Settings pattern and the Connections countdown: measured 16280 with all four. The team panel adds the compact specialist rows, the drawer page and its view (team_panel.go, team.html, team-panel.js, about 420 lines), the activity wording (team_activity.go) and their CSS and copy; the command reading went to its own package (internal/equipo/activity); measured 15788. Projects UX merged onto the Connections countdown and the Settings pattern: measured 15942 with all three. Projects UX adds the Projects page order (starred, active, quiet folded), the auto-star rules and their receipt, whole-word descriptions and the star action (project_order.go, about 200 lines), the Mac decision and Ask about this; measured 15815. 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 - 10850 Projects UX merged onto the Settings UX pass: measured 10768 with both. Projects UX adds the Projects page contracts (order, quiet fold, filter, stars and Undo, the coordinator's star, repository counts, whole words), the decision cards' Mac and Ask about this contracts and their browser drive (projects_pages_test.go, projects_browser_test.go, about 330 lines); measured 10321. 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. |
| +size internal/thintest - 11150 The team panel merged onto Projects UX and the Settings UX pass: measured 11064 with all three. The team panel adds its page contract and the drawer's browser drive at 1280 and 390 (team_panel_test.go, team_panel_browser_test.go, about 300 lines); measured 10235. Projects UX merged onto the Settings UX pass: measured 10768 with both. Projects UX adds the Projects page contracts (order, quiet fold, filter, stars and Undo, the coordinator's star, repository counts, whole words), the decision cards' Mac and Ask about this contracts and their browser drive (projects_pages_test.go, projects_browser_test.go, about 330 lines); measured 10321. 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/team-panel-engineering-1280.png b/docs/mockups/built/2026-11-11/team-panel-engineering-1280.png| new file mode 100644 |
| index 00000000..af2432a6 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/team-panel-engineering-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/team-panel-engineering-390.png b/docs/mockups/built/2026-11-11/team-panel-engineering-390.png| new file mode 100644 |
| index 00000000..aea3c431 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/team-panel-engineering-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/team-panel-page-1280-dark.png b/docs/mockups/built/2026-11-11/team-panel-page-1280-dark.png| new file mode 100644 |
| index 00000000..e65bbc3a |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/team-panel-page-1280-dark.png differ |
diff --git a/docs/mockups/built/2026-11-11/team-panel-rail-1280.png b/docs/mockups/built/2026-11-11/team-panel-rail-1280.png| new file mode 100644 |
| index 00000000..41e89dc5 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/team-panel-rail-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/team-panel-rail-390.png b/docs/mockups/built/2026-11-11/team-panel-rail-390.png| new file mode 100644 |
| index 00000000..5a73ca83 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/team-panel-rail-390.png differ |
diff --git a/docs/mockups/built/2026-11-11/team-panel-review-1280.png b/docs/mockups/built/2026-11-11/team-panel-review-1280.png| new file mode 100644 |
| index 00000000..ec64fd14 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/team-panel-review-1280.png differ |
diff --git a/docs/mockups/built/2026-11-11/team-panel-review-390.png b/docs/mockups/built/2026-11-11/team-panel-review-390.png| new file mode 100644 |
| index 00000000..58812041 |
| Binary files /dev/null and b/docs/mockups/built/2026-11-11/team-panel-review-390.png differ |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index f6e21c99..abf314f0 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -5951,6 +5951,40 @@ records remain unchanged. |
| | `work.decide.mac_set_up` | Set up a Mac | Tasks and Needs you (projects-ux) | COPY REVIEW REQUIRED | |
| | `work.ask_about` | Ask about this | Tasks and Needs you (projects-ux) | COPY REVIEW REQUIRED | |
| | `work.ask_about.draft` | About ā%sā (task %s): | Tasks and Needs you (projects-ux) | COPY REVIEW REQUIRED | |
| +| `team.activity.read_files` | Reading files | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.edit_files` | Editing files | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.search_code` | Searching the code | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.list` | Looking through %s | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.list_files` | Looking through the files | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.format` | Formatting the code | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.test` | Running the tests | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.build` | Building the project | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.checks` | Running the checks | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.install` | Installing dependencies | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.diff` | Looking over the changes | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.history` | Reading the history | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.status` | Checking what changed | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.commit` | Committing the changes | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.git` | Working with Git | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.script` | Running %s | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity.command` | Running a command | Team panel: sidebar rows and drawer (activity line) | Runtime; COPY REVIEW REQUIRED | |
| +| `team.close` | Close | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.working_on` | Working on | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.activity` | Activity | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.command` | Command | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.files` | Files touched | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.edited` | edited | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.runs_on` | Runs on | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.connection` | Connection | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.model` | Model | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.model_pending` | Known when the step ends | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.ask` | Ask %s | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.ask_send` | Ask | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.ask_about` | About %s | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.ask_waits` | %s answers once this step ends, from its last finished round. | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.ask_failed` | That question did not go through. Try again. | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.recent` | Recent work | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| +| `team.recent_empty` | Nothing yet. | Team panel: specialist drawer | Runtime; COPY REVIEW REQUIRED | |
| ## Task 21 |
diff --git a/internal/browsertest/browser.go b/internal/browsertest/browser.go| index 9eb319ba..237127e8 100644 |
| --- a/internal/browsertest/browser.go |
| +++ b/internal/browsertest/browser.go |
| @@ -15,8 +15,16 @@ import ( |
| ) |
| func Wait(expression string) chromedp.Action[chromedp.Void] { |
| + return WaitWithin(expression, 5*time.Second) |
| +} |
| + |
| +// WaitWithin is Wait with its own window, for a change that waits on |
| +// work the test asked to take time (a step told to sleep), not on the |
| +// page: 5 s is room for the page to react, not for the work and the |
| +// page together on a loaded machine. |
| +func WaitWithin(expression string, window time.Duration) chromedp.Action[chromedp.Void] { |
| return chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - ctx, cancel := context.WithTimeout(ctx, 5*time.Second) |
| + ctx, cancel := context.WithTimeout(ctx, window) |
| defer cancel() |
| tick := time.NewTicker(20 * time.Millisecond) |
| defer tick.Stop() |
diff --git a/internal/equipo/activity/activity.go b/internal/equipo/activity/activity.go| new file mode 100644 |
| index 00000000..642bdffc |
| --- /dev/null |
| +++ b/internal/equipo/activity/activity.go |
| @@ -0,0 +1,460 @@ |
| +// Package activity reads what a specialist started during a step (a |
| +// wire.ActivityLine) for a person: a verb and, for a file, its path. A |
| +// shell command arrives as kind "run" with its first line, wrapped or |
| +// not (Codex sends `/bin/bash -lc "cat ios/..."`); Meaning unwraps it, |
| +// takes its first meaningful part and maps the common tools. The verbs |
| +// are copy keys' last parts (internal/equipo words them); anything it |
| +// does not know is "command", so raw shell never reaches a person. |
| +package activity |
| + |
| +import ( |
| + "path" |
| + "strings" |
| + "unicode" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// Meaning is a line's verb (a copy key's last part) and its |
| +// subject: a path for files, a word for searches, "" for neither. |
| +func Meaning(a wire.ActivityLine) (key, subject string) { |
| + s := strings.TrimSpace(a.Subject) |
| + if s == "" { |
| + return "working", "" |
| + } |
| + switch a.Kind { |
| + case wire.ActivityRead: |
| + return "read", s |
| + case wire.ActivityEdit: |
| + return "edit", s |
| + case wire.ActivitySearch: |
| + return "search", s |
| + case wire.ActivityRun: |
| + return commandMeaning(s, 0) |
| + } |
| + return "working", "" |
| +} |
| + |
| +// Name is a path's base name when it is plain enough to show. |
| +func Name(p string) string { |
| + p = strings.TrimSpace(p) |
| + if p == "" || strings.ContainsAny(p, "$`(){}<>|;&*?[]=~!#%\\\"'\n") { |
| + return "" |
| + } |
| + base := path.Base(strings.TrimSuffix(p, "/")) |
| + if base == "/" || strings.HasPrefix(base, "-") { |
| + return "" |
| + } |
| + return clipRunes(base, 60) |
| +} |
| + |
| +// Word is a search term worth quoting: a word or a short phrase. |
| +func Word(s string) bool { |
| + if s == "" || len(s) > 40 || strings.HasPrefix(s, "-") { |
| + return false |
| + } |
| + for _, r := range s { |
| + if !unicode.IsLetter(r) && !unicode.IsDigit(r) && !strings.ContainsRune("_.:- ", r) { |
| + return false |
| + } |
| + } |
| + return true |
| +} |
| + |
| +func clipRunes(s string, n int) string { |
| + r := []rune(s) |
| + if len(r) <= n { |
| + return s |
| + } |
| + return string(r[:n-1]) + "ā¦" |
| +} |
| + |
| +// commandMeaning reads a command's first meaningful part. |
| +func commandMeaning(cmd string, depth int) (key, subject string) { |
| + words := shellWords(cmd) |
| + // A shell wrapper: its script is what runs. |
| + if len(words) > 0 && depth < 3 && isShell(words[0]) { |
| + for i := 1; i < len(words); i++ { |
| + w := words[i] |
| + if strings.HasPrefix(w, "-") && !strings.HasPrefix(w, "--") && strings.Contains(w, "c") { |
| + if i+1 < len(words) && !isOperator(words[i+1]) { |
| + return commandMeaning(words[i+1], depth+1) |
| + } |
| + return "command", "" |
| + } |
| + } |
| + } |
| + var fallback []string |
| + for _, part := range splitCommands(words) { |
| + part = stripPrefixes(part) |
| + if len(part) == 0 { |
| + continue |
| + } |
| + switch path.Base(part[0]) { |
| + case "cd", "pushd", "popd", "export", "set", "source", ".", "true", ":", "unset", "alias": |
| + continue |
| + case "echo", "printf": |
| + if fallback == nil { |
| + fallback = part |
| + } |
| + continue |
| + } |
| + return toolMeaning(part) |
| + } |
| + if fallback != nil { |
| + return toolMeaning(fallback) |
| + } |
| + return "command", "" |
| +} |
| + |
| +func isShell(w string) bool { |
| + switch path.Base(w) { |
| + case "sh", "bash", "zsh", "dash", "ksh": |
| + return true |
| + } |
| + return false |
| +} |
| + |
| +// shellWords splits a command into words the way a shell would, roughly: |
| +// quotes group, a backslash escapes, and the operators && || ; | stand as |
| +// words of their own. |
| +func shellWords(s string) []string { |
| + var out []string |
| + var cur strings.Builder |
| + in, quote := false, rune(0) |
| + flush := func() { |
| + if in { |
| + out = append(out, cur.String()) |
| + cur.Reset() |
| + in = false |
| + } |
| + } |
| + rs := []rune(s) |
| + for i := 0; i < len(rs); i++ { |
| + r := rs[i] |
| + switch { |
| + case quote != 0: |
| + if r == quote { |
| + quote = 0 |
| + } else if r == '\\' && quote == '"' && i+1 < len(rs) { |
| + i++ |
| + cur.WriteRune(rs[i]) |
| + } else { |
| + cur.WriteRune(r) |
| + } |
| + case r == '\'' || r == '"': |
| + quote, in = r, true |
| + case r == '\\' && i+1 < len(rs): |
| + i++ |
| + cur.WriteRune(rs[i]) |
| + in = true |
| + case unicode.IsSpace(r): |
| + flush() |
| + case r == ';' || r == '|' || r == '&': |
| + flush() |
| + op := string(r) |
| + if i+1 < len(rs) && (rs[i+1] == '|' || rs[i+1] == '&') && r != ';' { |
| + op += string(rs[i+1]) |
| + i++ |
| + } |
| + out = append(out, op) |
| + default: |
| + cur.WriteRune(r) |
| + in = true |
| + } |
| + } |
| + flush() |
| + return out |
| +} |
| + |
| +func isOperator(w string) bool { |
| + switch w { |
| + case "&&", "||", ";", "|", "&", "|&": |
| + return true |
| + } |
| + return false |
| +} |
| + |
| +// splitCommands cuts words at the operators. |
| +func splitCommands(words []string) [][]string { |
| + var out [][]string |
| + var cur []string |
| + for _, w := range words { |
| + if isOperator(w) { |
| + out = append(out, cur) |
| + cur = nil |
| + continue |
| + } |
| + cur = append(cur, w) |
| + } |
| + return append(out, cur) |
| +} |
| + |
| +// stripPrefixes drops what only sets the scene for a command: variable |
| +// assignments, env, sudo, nice, time, timeout and the shell's keywords. |
| +func stripPrefixes(w []string) []string { |
| + for len(w) > 0 { |
| + head := w[0] |
| + switch { |
| + case strings.Contains(head, "=") && !strings.HasPrefix(head, "-") && !strings.Contains(head[:strings.Index(head, "=")], "/"): |
| + w = w[1:] |
| + case head == "env" || head == "sudo" || head == "command" || head == "exec" || head == "time" || head == "do" || head == "then" || head == "else" || head == "!": |
| + w = w[1:] |
| + case head == "nice": |
| + w = w[1:] |
| + if len(w) > 1 && w[0] == "-n" { |
| + w = w[2:] |
| + } else if len(w) > 0 && strings.HasPrefix(w[0], "-") { |
| + w = w[1:] |
| + } |
| + case head == "timeout": |
| + w = w[1:] |
| + for len(w) > 0 && strings.HasPrefix(w[0], "-") { |
| + w = w[1:] |
| + } |
| + if len(w) > 0 { |
| + w = w[1:] |
| + } |
| + default: |
| + return w |
| + } |
| + } |
| + return w |
| +} |
| + |
| +// args are a command's operands: its words after the flags, skipping the |
| +// values of the flags that take one. |
| +func args(words []string, valued ...string) []string { |
| + var out []string |
| + takes := map[string]bool{} |
| + for _, v := range valued { |
| + takes[v] = true |
| + } |
| + for i := 0; i < len(words); i++ { |
| + w := words[i] |
| + if w == "--" { |
| + return append(out, words[i+1:]...) |
| + } |
| + if strings.HasPrefix(w, "-") && len(w) > 1 { |
| + if takes[w] { |
| + i++ |
| + } |
| + continue |
| + } |
| + out = append(out, w) |
| + } |
| + return out |
| +} |
| + |
| +func has(words []string, flags ...string) bool { |
| + for _, w := range words { |
| + for _, f := range flags { |
| + if w == f || (strings.HasPrefix(f, "--") && strings.HasPrefix(w, f+"=")) { |
| + return true |
| + } |
| + } |
| + } |
| + return false |
| +} |
| + |
| +func first(words []string) string { |
| + if len(words) == 0 { |
| + return "" |
| + } |
| + return words[0] |
| +} |
| + |
| +// toolMeaning maps one command to its verb. |
| +func toolMeaning(w []string) (key, subject string) { |
| + name, rest := path.Base(w[0]), w[1:] |
| + switch name { |
| + case "cat", "bat", "less", "more", "nl", "wc", "file", "stat", "xxd", "od", "strings", "head", "tail": |
| + return "read", first(args(rest, "-n", "-c", "-l", "--lines", "--bytes")) |
| + case "sed": |
| + if hasPrefix(rest, "-i") || has(rest, "--in-place") { |
| + return "edit", last(args(rest, "-e", "-f", "--expression", "--file", "-l")) |
| + } |
| + a := args(rest, "-e", "-f", "--expression", "--file", "-l") |
| + if !has(rest, "-e", "-f", "--expression", "--file") && len(a) > 0 { |
| + a = a[1:] |
| + } |
| + return "read", first(a) |
| + case "awk", "gawk": |
| + a := args(rest, "-F", "-v", "-f") |
| + if len(a) > 1 { |
| + return "read", a[1] |
| + } |
| + return "read", "" |
| + case "rg", "grep", "egrep", "fgrep", "ag", "ack": |
| + if name == "rg" && has(rest, "--files") { |
| + return "list", first(args(rest, "-g", "--glob", "-t", "--type")) |
| + } |
| + a := args(rest, "-e", "-f", "-g", "--glob", "-t", "--type", "-T", "--type-not", "-A", "-B", "-C", "-m", "--max-count", "-M", "--context") |
| + return "search", first(a) |
| + case "find", "fd", "ls", "tree", "du": |
| + return "list", first(args(rest, "-name", "-iname", "-path", "-type", "-maxdepth", "-mindepth", "-e", "-d", "-L", "-I", "--max-depth")) |
| + case "apply_patch", "patch": |
| + return "edit", "" |
| + case "tee", "touch": |
| + return "edit", first(args(rest)) |
| + case "mv", "cp", "rm", "mkdir", "ln", "chmod": |
| + return "edit", "" |
| + case "gofmt", "goimports", "prettier", "swiftformat", "black", "rustfmt": |
| + if has(rest, "-w", "--write") || name == "black" || name == "swiftformat" || name == "rustfmt" { |
| + return "format", "" |
| + } |
| + return "checks", "" |
| + case "go": |
| + switch first(args(rest)) { |
| + case "test": |
| + return "test", "" |
| + case "build", "run", "install", "generate": |
| + return "build", "" |
| + case "vet": |
| + return "checks", "" |
| + case "fmt": |
| + return "format", "" |
| + case "mod", "get": |
| + return "install", "" |
| + } |
| + return "command", "" |
| + case "xcodebuild": |
| + if has(rest, "test", "test-without-building") { |
| + return "test", "" |
| + } |
| + return "build", "" |
| + case "swift": |
| + switch first(args(rest)) { |
| + case "test": |
| + return "test", "" |
| + case "build": |
| + return "build", "" |
| + case "package": |
| + return "install", "" |
| + } |
| + return "command", "" |
| + case "npm", "pnpm", "yarn", "bun": |
| + a := args(rest) |
| + sub := first(a) |
| + if sub == "run" || sub == "run-script" { |
| + a = a[1:] |
| + sub = first(a) |
| + } |
| + switch sub { |
| + case "test", "t", "tests", "e2e": |
| + return "test", "" |
| + case "build": |
| + return "build", "" |
| + case "install", "i", "ci", "add": |
| + return "install", "" |
| + case "lint", "check", "typecheck", "format:check": |
| + return "checks", "" |
| + } |
| + if name == "yarn" && sub == "" { |
| + return "install", "" |
| + } |
| + return "command", "" |
| + case "npx", "bunx", "pnpx": |
| + switch path.Base(first(args(rest))) { |
| + case "jest", "vitest", "mocha", "playwright", "ava", "tap": |
| + return "test", "" |
| + case "tsc", "eslint", "stylelint", "biome": |
| + return "checks", "" |
| + case "prettier": |
| + return "format", "" |
| + } |
| + return "command", "" |
| + case "jest", "vitest", "mocha", "pytest", "tox", "rspec", "phpunit": |
| + return "test", "" |
| + case "eslint", "tsc", "staticcheck", "golangci-lint", "swiftlint", "ruff", "flake8", "mypy", "shellcheck", "govulncheck": |
| + return "checks", "" |
| + case "cargo": |
| + switch first(args(rest)) { |
| + case "test", "nextest": |
| + return "test", "" |
| + case "build", "run": |
| + return "build", "" |
| + case "check", "clippy", "fmt": |
| + return "checks", "" |
| + } |
| + return "command", "" |
| + case "make", "gmake", "just": |
| + switch first(args(rest, "-C", "-f", "-j")) { |
| + case "test", "tests", "unit", "e2e": |
| + return "test", "" |
| + case "ci", "check", "checks", "lint", "vet", "verify": |
| + return "checks", "" |
| + case "", "build", "all", "install": |
| + return "build", "" |
| + } |
| + return "command", "" |
| + case "python", "python3", "node", "ruby", "deno", "perl", "php": |
| + if has(rest, "-m") { |
| + for i, x := range rest { |
| + if x == "-m" && i+1 < len(rest) { |
| + switch rest[i+1] { |
| + case "pytest", "unittest", "tox": |
| + return "test", "" |
| + case "pip": |
| + return "install", "" |
| + } |
| + } |
| + } |
| + return "command", "" |
| + } |
| + if has(rest, "-c", "-e", "-pi", "-p", "-i") { |
| + return "command", "" |
| + } |
| + return "script", first(args(rest)) |
| + case "git": |
| + return gitMeaning(rest) |
| + } |
| + if strings.HasPrefix(w[0], "./") || strings.HasSuffix(name, ".sh") || strings.HasSuffix(name, ".py") { |
| + return "script", w[0] |
| + } |
| + return "command", "" |
| +} |
| + |
| +func hasPrefix(words []string, prefix string) bool { |
| + for _, w := range words { |
| + if strings.HasPrefix(w, prefix) && !strings.HasPrefix(w, "--") { |
| + return true |
| + } |
| + } |
| + return false |
| +} |
| + |
| +func last(words []string) string { |
| + if len(words) == 0 { |
| + return "" |
| + } |
| + return words[len(words)-1] |
| +} |
| + |
| +// gitMeaning maps git's subcommands. |
| +func gitMeaning(rest []string) (key, subject string) { |
| + // Global options come before the subcommand; -C and -c take a value. |
| + for len(rest) > 0 && strings.HasPrefix(rest[0], "-") { |
| + if (rest[0] == "-C" || rest[0] == "-c") && len(rest) > 1 { |
| + rest = rest[1:] |
| + } |
| + rest = rest[1:] |
| + } |
| + switch first(rest) { |
| + case "diff", "show", "range-diff": |
| + return "diff", "" |
| + case "log", "blame", "shortlog", "reflog": |
| + return "history", "" |
| + case "status": |
| + return "status", "" |
| + case "add", "commit": |
| + return "commit", "" |
| + case "grep": |
| + return "search", first(args(rest[1:], "-e", "-f", "-A", "-B", "-C", "-m")) |
| + case "ls-files": |
| + return "list", "" |
| + case "apply", "am": |
| + return "edit", "" |
| + } |
| + return "git", "" |
| +} |
diff --git a/internal/equipo/app.go b/internal/equipo/app.go| index eaa8a51b..5cbdba01 100644 |
| --- a/internal/equipo/app.go |
| +++ b/internal/equipo/app.go |
| @@ -274,6 +274,7 @@ func RouterWithStore(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logg |
| r.Post("/tasks/{id}/steps/{key}/selection", a.confirmPlanSelection) |
| r.Get("/work", a.index) |
| r.Get("/nav/rail", a.railFragment) |
| + r.Get("/team/{specialist}", a.teamPage) |
| for _, path := range []string{"/needs-you", "/journey", "/connections"} { |
| r.Get(path, a.taskList) |
| } |
diff --git a/internal/equipo/chat/team.go b/internal/equipo/chat/team.go| new file mode 100644 |
| index 00000000..4890cf03 |
| --- /dev/null |
| +++ b/internal/equipo/chat/team.go |
| @@ -0,0 +1,32 @@ |
| +package chat |
| + |
| +import ( |
| + "context" |
| + |
| + "gorm.io/gorm" |
| +) |
| + |
| +// StepModels is the model each of the person's own steps ran on, as its |
| +// harness reported it with the attempt's usage (the newest row wins). A |
| +// step that has not reported usage yet, or that ran on someone else's |
| +// runner, is absent: the model is unknown, never guessed. |
| +func (s *Store) StepModels(ctx context.Context, person string, steps []string) (map[string]string, error) { |
| + out := map[string]string{} |
| + if len(steps) == 0 { |
| + return out, nil |
| + } |
| + err := s.read(ctx, func(tx *gorm.DB) error { |
| + if err := s.authority.CurrentPerson(ctx, tx); err != nil { |
| + return err |
| + } |
| + var rows []usageRecord |
| + if err := tx.Select("step_id", "model", "recorded_at", "id").Where("person = ? AND step_id IN ? AND model <> ''", person, steps).Order("recorded_at, id").Find(&rows).Error; err != nil { |
| + return err |
| + } |
| + for _, r := range rows { |
| + out[r.StepID] = r.Model |
| + } |
| + return nil |
| + }) |
| + return out, err |
| +} |
diff --git a/internal/equipo/chat_navigation_test.go b/internal/equipo/chat_navigation_test.go| index e2e5ac8c..0a6c358d 100644 |
| --- a/internal/equipo/chat_navigation_test.go |
| +++ b/internal/equipo/chat_navigation_test.go |
| @@ -9,23 +9,28 @@ import ( |
| "time" |
| ) |
| -// The sidebar's specialist lines say what the thin core's steps are |
| -// doing: idle, or the living mark and a clock with a dropdown holding the |
| -// task, its stage and attempt, the last activity lines and the queue. |
| -// Counts are quiet (nothing at zero) and "Unavailable" only when they |
| -// could not be read. Order: Conversation, Projects, Tasks, Needs you. |
| +// The sidebar's specialist rows say what the thin core's steps are |
| +// doing, compactly (the team panel, 2026-11-11): idle is the one muted |
| +// word; working is the living mark and a clock, then one line with the |
| +// task's title and what it is doing in plain words. The attempt shows |
| +// only above 1; there is no inner card, stage chip or raw line. Each row |
| +// is a link to its specialist's drawer. Counts are quiet (nothing at |
| +// zero) and "Unavailable" only when they could not be read. Order: |
| +// Conversation, Projects, Tasks, Needs you. |
| func TestChatNavigationStatus(t *testing.T) { |
| - task := wire.Task{ID: "tkabc", Title: "Swipe back", Project: "Woodstar"} |
| + task := wire.Task{ID: "tkabc", Title: "Swipe from the edge to go back doesn't work", Project: "Woodstar"} |
| started := time.Now().Add(-90 * time.Second) |
| - step := wire.Step{ID: "st1", Attempt: 2, StartedAt: &started} |
| - queued := wire.Task{ID: "tkq", Title: "Timeline jumps"} |
| + first := wire.Step{ID: "st1", Attempt: 1, StartedAt: &started} |
| + second := wire.Step{ID: "st2", Attempt: 2, StartedAt: &started} |
| + now := humaneActivity(wire.ActivityLine{Kind: wire.ActivityRun, Subject: `/bin/bash -lc "cat ios/Woodstar/NavigationStack.swift"`}) |
| for _, tc := range []struct { |
| rail railView |
| want []string |
| not []string |
| }{ |
| - {railView{Tasks: railCount{0, true}, Projects: railCount{0, true}, Needs: railCount{0, true}, Specialists: []railSpecialist{{Key: "engineering", Icon: "code", CopyKey: "nav.engineering"}}}, []string{`data-state="idle"`, "<span equipo-spec-state>idle</span>", `tabindex="-1"`}, []string{"data-count", "equipo-spec-panel"}}, |
| - {railView{Tasks: railCount{2, true}, Needs: railCount{1, true}, Specialists: []railSpecialist{{Key: "engineering", Icon: "code", CopyKey: "nav.engineering", Task: &task, Step: &step, More: 1, Stage: "In progress", Lines: []string{"Reading live.js", "Editing live.js"}, Queue: []wire.Task{queued}}}}, []string{`data-state="working"`, "equipo-mark", `data-since="` + strconv.FormatInt(started.UnixMilli(), 10) + `"`, `<a equipo-nav-task href="/tasks/tkabc">Swipe back</a>`, "<span>Woodstar</span><span>In progress</span><span>attempt 2</span>", `<li data-now="now"><span>Editing live.js</span></li>`, "1 more</p>", `1 waiting: <a href="/tasks/tkq">Timeline jumps</a>`, "<small equipo-count data-count>2</small>", "<small equipo-count data-count data-attention>1</small>"}, nil}, |
| + {railView{Tasks: railCount{0, true}, Projects: railCount{0, true}, Needs: railCount{0, true}, Specialists: []railSpecialist{{Key: "engineering", Icon: "code", CopyKey: "nav.engineering"}}}, []string{`<a equipo-spec id="nav-engineering" href="/team/engineering" data-team-open data-specialist="engineering" data-state="idle">`, "<span equipo-spec-state>idle</span>"}, []string{"data-count", "equipo-spec-now", "equipo-mark", "tabindex"}}, |
| + {railView{Tasks: railCount{2, true}, Needs: railCount{1, true}, Specialists: []railSpecialist{{Key: "review", Icon: "check-circle", CopyKey: "nav.review", Task: &task, Step: &first, Now: now}}}, []string{`href="/team/review" data-team-open data-specialist="review" data-state="working"`, "equipo-mark", `data-since="` + strconv.FormatInt(started.UnixMilli(), 10) + `"`, `<span equipo-spec-now data-step="st1" title="Swipe from the edge to go back doesn't work Ā· Reading NavigationStack.swift"><span equipo-nav-task>Swipe from the edge to go back doesn't work</span><span equipo-spec-doing>Reading NavigationStack.swift</span></span>`, "<small equipo-count data-count>2</small>", "<small equipo-count data-count data-attention>1</small>"}, []string{"attempt", "In review", "Woodstar", "/bin/bash", "cat ios", "equipo-spec-panel", "<details", "<li"}}, |
| + {railView{Specialists: []railSpecialist{{Key: "engineering", Icon: "code", CopyKey: "nav.engineering", Task: &task, Step: &second, Now: now}}}, []string{"<span equipo-spec-attempt>attempt 2</span>"}, nil}, |
| {railView{}, []string{"<small equipo-count data-count>Unavailable</small>"}, nil}, |
| } { |
| data := pageData{Nav: railItems, Rail: tc.rail} |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index ce305701..203d7287 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -1507,6 +1507,41 @@ var pageCopy = map[string]string{ |
| "specialist.model": "Model", |
| "specialist.concurrent": "Runs at once", |
| "specialist.instructions": "Instructions", |
| + // The team panel (the sidebar's specialists and each one's drawer). |
| + "team.activity.read_files": "Reading files", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.edit_files": "Editing files", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.search_code": "Searching the code", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.list": "Looking through %s", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.list_files": "Looking through the files", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.format": "Formatting the code", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.test": "Running the tests", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.build": "Building the project", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.checks": "Running the checks", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.install": "Installing dependencies", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.diff": "Looking over the changes", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.history": "Reading the history", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.status": "Checking what changed", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.commit": "Committing the changes", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.git": "Working with Git", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.script": "Running %s", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.activity.command": "Running a command", // COPY REVIEW REQUIRED: team panel activity line |
| + "team.close": "Close", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.working_on": "Working on", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.activity": "Activity", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.command": "Command", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.files": "Files touched", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.edited": "edited", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.runs_on": "Runs on", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.connection": "Connection", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.model": "Model", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.model_pending": "Known when the step ends", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.ask": "Ask %s", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.ask_send": "Ask", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.ask_about": "About %s", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.ask_waits": "%s answers once this step ends, from its last finished round.", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.ask_failed": "That question did not go through. Try again.", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.recent": "Recent work", // COPY REVIEW REQUIRED: team panel drawer |
| + "team.recent_empty": "Nothing yet.", // COPY REVIEW REQUIRED: team panel drawer |
| } |
| func copyText(key string) string { |
diff --git a/internal/equipo/handlers.go b/internal/equipo/handlers.go| index 035b2559..a6c7c988 100644 |
| --- a/internal/equipo/handlers.go |
| +++ b/internal/equipo/handlers.go |
| @@ -68,6 +68,7 @@ type pageData struct { |
| Work SpecialistWorkView |
| library.NavigationView |
| Rail railView |
| + Team teamPanel |
| Connections []ConnectionView |
| Choices []ProjectConnectionView |
| Recovery *team.RecoverySnapshot |
diff --git a/internal/equipo/rail.go b/internal/equipo/rail.go| index 93cae661..30f6e715 100644 |
| --- a/internal/equipo/rail.go |
| +++ b/internal/equipo/rail.go |
| @@ -26,19 +26,16 @@ var railItems = []NavItem{ |
| } |
| // railSpecialist is one specialist the thin core runs: idle, or working |
| -// on a task, with what it did last and what waits for it. |
| +// on a task. The row is compact (the team panel, 2026-11-11): the |
| +// specialist, its living mark and clock, then the task's title and what |
| +// it is doing now in plain words. Its drawer (team_panel.go) has the rest. |
| type railSpecialist struct { |
| Key, Icon, CopyKey string |
| - // Task is the task its newest running step works on, Step that step; |
| - // More counts the others running. |
| - Task *wire.Task |
| - Step *wire.Step |
| - More int |
| - Stage string |
| - // Lines are the step's last three activity lines, oldest first. |
| - Lines []string |
| - // Queue are the tasks whose newest step waits for this specialist. |
| - Queue []wire.Task |
| + // Task is the task its newest running step works on, Step that step. |
| + Task *wire.Task |
| + Step *wire.Step |
| + // Now is the step's newest activity line in plain words. |
| + Now string |
| } |
| // railCount is a quiet count: shown only above zero, "Unavailable" when |
| @@ -69,7 +66,7 @@ func (a *application) rail(ctx context.Context, person string) railView { |
| v.Cursor = top |
| } |
| tasks, err := c.Tasks(ctx, person) |
| - working, queued := map[string][]wire.Task{}, map[string][]wire.Task{} |
| + working := map[string][]wire.Task{} |
| if err == nil { |
| n := 0 |
| for _, k := range tasks.Items { |
| @@ -79,11 +76,8 @@ func (a *application) rail(ctx context.Context, person string) railView { |
| n++ |
| if s := len(k.Steps); s > 0 { |
| st := k.Steps[s-1] |
| - switch st.State { |
| - case wire.StepRunning: |
| + if st.State == wire.StepRunning { |
| working[st.Specialist] = append(working[st.Specialist], k) |
| - case wire.StepQueued: |
| - queued[st.Specialist] = append(queued[st.Specialist], k) |
| } |
| } |
| } |
| @@ -107,21 +101,14 @@ func (a *application) rail(ctx context.Context, person string) railView { |
| v.Projects = railCount{len(p.Items), true} |
| } |
| for _, s := range specialistRail { |
| - line := railSpecialist{Key: s.specialist, Icon: s.icon, CopyKey: s.copyKey, Queue: queued[s.specialist]} |
| + line := railSpecialist{Key: s.specialist, Icon: s.icon, CopyKey: s.copyKey} |
| if ks := working[s.specialist]; len(ks) > 0 { |
| k := ks[0] |
| st := k.Steps[len(k.Steps)-1] |
| - line.Task, line.Step, line.More = &k, &st, len(ks)-1 |
| - line.Stage = copyText("work.stage." + k.Stage) |
| - acts := st.Activity |
| - if len(acts) > 3 { |
| - acts = acts[len(acts)-3:] |
| - } |
| - for _, x := range acts { |
| - line.Lines = append(line.Lines, activityText(x)) |
| - } |
| - if len(line.Lines) == 0 { |
| - line.Lines = []string{copyText("work.activity.working")} |
| + line.Task, line.Step = &k, &st |
| + line.Now = copyText("work.activity.working") |
| + if n := len(st.Activity); n > 0 { |
| + line.Now = humaneActivity(st.Activity[n-1]) |
| } |
| } |
| v.Specialists = append(v.Specialists, line) |
diff --git a/internal/equipo/render.go b/internal/equipo/render.go| index efc0642e..4311f51e 100644 |
| --- a/internal/equipo/render.go |
| +++ b/internal/equipo/render.go |
| @@ -34,7 +34,7 @@ var assets = rastrillo.NewAssets(appFS) |
| var pages = map[string]*template.Template{} |
| func init() { |
| - for _, name := range []string{"person_devices", "person_device", "teams", "onboarding", "invite", "playbooks", "playbook_form", "playbook_diff", "specialist_form", "template_library", "template_diff", "conversation", "chat", "thread", "plan", "coordinator", "preferences", "index", "empty", "projects", "project", "project_form", "people", "settings", "specialist", "errors", "signin_page", "form_error", "runners", "tasks", "task", "task_form", "question", "merge", "connections", "recovery", "recovery_form", "rendered_approval", "notebook", "housekeeping", "work_tasks", "work_task", "work_projects", "work_project", "models", "work_needs", "settings_hub"} { |
| + for _, name := range []string{"person_devices", "person_device", "teams", "onboarding", "invite", "playbooks", "playbook_form", "playbook_diff", "specialist_form", "template_library", "template_diff", "conversation", "chat", "thread", "plan", "coordinator", "preferences", "index", "empty", "projects", "project", "project_form", "people", "settings", "specialist", "errors", "signin_page", "form_error", "runners", "tasks", "task", "task_form", "question", "merge", "connections", "recovery", "recovery_form", "rendered_approval", "notebook", "housekeeping", "work_tasks", "work_task", "work_projects", "work_project", "models", "work_needs", "settings_hub", "team"} { |
| 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, "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"} }, |
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css| index 0d2918d0..88a6c737 100644 |
| --- a/internal/equipo/static/equipo.css |
| +++ b/internal/equipo/static/equipo.css |
| @@ -350,7 +350,7 @@ html:has([equipo-conversation]) { overflow: hidden; scrollbar-gutter: auto; } |
| you, and the sidebar's specialists. From docs/mockups/tasks.html. No |
| coloured left borders: hairlines and tints only. */ |
| [equipo-inner] { --equipo-ease: cubic-bezier(.22, .8, .24, 1); container: work / inline-size; max-inline-size: 66rem; } |
| -[equipo-inner] a, [equipo-inner] summary, [equipo-inner] button, [equipo-spec] > summary { cursor: pointer; } |
| +[equipo-inner] a, [equipo-inner] summary, [equipo-inner] button { cursor: pointer; } |
| /* The living mark: the thinking line's sparkle, scaled to where it sits. */ |
| [equipo-mark] { display: inline-block; inline-size: 1em; block-size: 1em; margin: 0; vertical-align: -.12em; } |
| [equipo-mark][data-size="s"] { font-size: .85em; } |
| @@ -658,33 +658,27 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-note2] { padding: var(--rst-sp-3) var(--rst-sp-4); border: 1px solid var(--rst-line); border-radius: var(--rst-radius); background: color-mix(in oklab, var(--rst-surface), var(--rst-accent-soft) 16%); box-shadow: var(--rst-shadow-lift); font-size: var(--rst-fs-sm); } |
| [equipo-note2] p { margin: 0; line-height: 1.5; } |
| [equipo-cap] { margin-block-start: var(--rst-sp-2) !important; font-size: var(--rst-fs-xs); color: var(--rst-text-muted); } |
| -/* The sidebar's specialists: the living mark, a timer and a dropdown. */ |
| -[equipo-spec] { margin: 0; } |
| -[equipo-spec] > summary { font-size: var(--rst-fs-sm); list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: var(--rst-sp-2); padding: 0.35rem 0.55rem; border-radius: var(--rst-radius); color: var(--rst-text-muted); } |
| -[equipo-spec] > summary::-webkit-details-marker { display: none; } |
| -[equipo-spec] > summary > span:nth-of-type(1) { min-inline-size: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--rst-text); } |
| -[equipo-spec] > summary .icon { inline-size: 1em; block-size: 1em; margin: 0; } |
| -[equipo-spec][data-state="working"] > summary:hover { background: var(--rst-tint-hover); } |
| -[equipo-spec][data-state="idle"] > summary { cursor: default; pointer-events: none; } |
| -[equipo-spec-state] { display: inline-flex; align-items: center; gap: .4em; font-size: var(--rst-fs-xs); color: var(--rst-text-muted); white-space: nowrap; } |
| +/* The sidebar's specialists (the team panel, 2026-11-11): each a compact |
| + row that links to its drawer. Line one is the specialist, its living |
| + mark and clock; line two, while it works, the task's title and what |
| + it is doing in plain words. Idle is one muted word. */ |
| +[rst-shell-sidebar] [rst-shell-nav] > a[equipo-spec] { display: grid; grid-template-columns: 1em minmax(0, 1fr) auto .75em; align-items: center; column-gap: var(--rst-sp-2); row-gap: 1px; padding-block: .4rem; color: var(--rst-text-muted); } |
| +[equipo-spec] > .icon { inline-size: 1em; block-size: 1em; margin: 0; } |
| +[equipo-spec] > .icon:last-of-type { inline-size: .75em; block-size: .75em; color: var(--rst-text-faint); transition: transform .2s var(--equipo-ease, ease), color .2s ease; } |
| +[equipo-spec]:hover > .icon:last-of-type, [equipo-spec]:focus-visible > .icon:last-of-type { color: var(--rst-text-muted); transform: translateX(2px); } |
| +[equipo-spec-name] { min-inline-size: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--rst-text); } |
| +[equipo-spec-state] { display: inline-flex; align-items: center; gap: .4em; font-size: var(--rst-fs-xs); color: var(--rst-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; } |
| [equipo-spec][data-state="idle"] [equipo-spec-state] { color: var(--rst-text-faint); } |
| -[equipo-spec] > summary > .icon:last-child { color: var(--rst-text-faint); transition: transform .25s var(--equipo-ease, ease); } |
| -[equipo-spec][open] > summary > .icon:last-child { transform: rotate(180deg); } |
| -[equipo-spec][data-state="idle"] > summary > .icon:last-child { visibility: hidden; } |
| -[equipo-spec-panel] { margin: var(--rst-sp-1) 0.55rem var(--rst-sp-2) calc(0.55rem + 1em + var(--rst-sp-2)); padding: var(--rst-sp-2) var(--rst-sp-3); border: 1px solid var(--rst-line); border-radius: var(--rst-radius); background: color-mix(in oklab, var(--rst-surface), var(--rst-accent-soft) 35%); font-size: var(--rst-fs-xs); color: var(--rst-text-muted); animation: equipo-open .25s cubic-bezier(.22, .8, .24, 1); } |
| -@keyframes equipo-open { from { opacity: 0; transform: translateY(-.25rem); } } |
| -[rst-shell-nav] [equipo-spec-panel] a[equipo-nav-task] { display: block; padding: 0; color: var(--rst-text); font-size: var(--rst-fs-sm); font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| -[rst-shell-nav] [equipo-spec-panel] a[equipo-nav-task]:hover { text-decoration: underline; text-underline-offset: 2px; background: none; } |
| -[equipo-spec-where] { margin: 2px 0 var(--rst-sp-2); display: flex; flex-wrap: wrap; gap: 0 var(--rst-sp-2); } |
| -[equipo-spec-lines] { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; } |
| -[equipo-spec-lines] li { display: flex; gap: var(--rst-sp-2); align-items: baseline; min-inline-size: 0; color: var(--rst-text-faint); } |
| -[equipo-spec-lines] li > span { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| -[equipo-spec-lines] li:last-child { color: var(--rst-text); } |
| -[equipo-spec-lines] li:last-child > span { font-weight: 500; } |
| -[equipo-spec-lines] li:last-child::after { content: attr(data-now); } |
| -[equipo-spec-lines] li[data-new] { animation: equipo-rise .3s ease-out both; } |
| -[equipo-spec-queue] { margin: var(--rst-sp-2) 0 0; padding-block-start: var(--rst-sp-2); border-block-start: 1px solid var(--rst-line); } |
| -[rst-shell-nav] [equipo-spec-queue] a { display: inline; padding: 0; color: var(--rst-text-muted); } |
| +[equipo-spec-attempt] { color: var(--rst-text-muted); } |
| +[equipo-spec-state] [data-spec-star] { display: inline-flex; font-size: .9em; } |
| +[equipo-spec-state] [equipo-sparkle] { margin: 0; inline-size: 1em; block-size: 1em; } |
| +[equipo-spec-now] { grid-column: 2 / -1; grid-row: 2; display: flex; align-items: baseline; gap: .4em; min-inline-size: 0; font-size: var(--rst-fs-xs); line-height: 1.4; color: var(--rst-text-muted); } |
| +/* The title gives way first, down to a few words: what it is doing is |
| + the live part. The row's title attribute carries both in full. */ |
| +[equipo-spec-now] > [equipo-nav-task] { flex: 1 1 0; min-inline-size: 5.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rst-text); opacity: .82; } |
| +[equipo-spec-doing] { flex: 0 1 auto; max-inline-size: 72%; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| +[equipo-spec-doing]::before { content: "\00B7"; margin-inline-end: .4em; color: var(--rst-text-faint); } |
| +[equipo-spec-doing][data-new] { animation: equipo-rise .3s ease-out both; } |
| [equipo-count][data-attention] { color: var(--rst-tone-warning-fg); font-weight: 600; } |
| /* Phone width: stack by container, so the desk and the phone agree. */ |
| @container work (max-width: 600px) { |
| @@ -714,19 +708,20 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| /* Reduced motion: everything still, nothing missing. Timers keep |
| counting: they are content. */ |
| @media (prefers-reduced-motion: reduce) { |
| - [equipo-mark] svg, [equipo-mark] path, [equipo-mark] circle, [equipo-mark] i, [equipo-spec-panel], [equipo-tl] > li, [equipo-spec-lines] li, [equipo-row], [equipo-details] > summary .icon, [equipo-spec] > summary > .icon:last-child { animation: none !important; transition: none !important; } |
| + [equipo-mark] svg, [equipo-mark] path, [equipo-mark] circle, [equipo-mark] i, [equipo-tl] > li, [equipo-spec-doing], [equipo-row], [equipo-details] > summary .icon, [equipo-spec] > .icon, [equipo-team-raw] > summary .icon, dialog[equipo-drawer], dialog[equipo-drawer]::backdrop { animation: none !important; transition: none !important; } |
| [equipo-mark] [data-sat="1"], [equipo-mark] [data-sat="2"] { opacity: .7; transform: scale(.8) rotate(45deg); } |
| [equipo-mark] [data-mote] { display: none; } |
| } |
| -/* On the phone index the specialists are a bordered list like the |
| - sections above them, and each opens in place. */ |
| +/* On the phone index the specialists are rows like the sections above |
| + them; each opens its drawer. */ |
| @media (max-width: 799.98px) { |
| - [rst-shell-sidebar~="index"] [equipo-spec] { background: var(--rst-surface); border: 1px solid var(--rst-line); border-block-start-width: 0; } |
| [rst-shell-sidebar~="index"] [equipo-nav-group] + [equipo-spec] { border-block-start-width: 1px; border-start-start-radius: var(--rst-radius); border-start-end-radius: var(--rst-radius); } |
| [rst-shell-sidebar~="index"] [equipo-spec]:has(+ [equipo-nav-group]) { border-end-start-radius: var(--rst-radius); border-end-end-radius: var(--rst-radius); } |
| - [rst-shell-sidebar~="index"] [equipo-spec] > summary { min-block-size: 3rem; padding-inline: 1rem .75rem; column-gap: var(--rst-sp-3); font-size: 1rem; } |
| - [rst-shell-sidebar~="index"] [equipo-spec] > summary .icon:first-child { color: var(--rst-accent); } |
| - [rst-shell-sidebar~="index"] [equipo-spec-panel] { margin: 0 var(--rst-sp-3) var(--rst-sp-3) calc(1rem + 1em + var(--rst-sp-3)); font-size: var(--rst-fs-sm); } |
| + [rst-shell-sidebar][rst-shell-sidebar~="index"] [rst-shell-nav] > a[equipo-spec] { grid-template-columns: auto minmax(0, 1fr) auto .625rem; min-block-size: 3rem; padding-block: .55rem; padding-inline: 1rem .75rem; column-gap: .75rem; font-size: 1rem; } |
| + [rst-shell-sidebar~="index"] [rst-shell-nav] > a[equipo-spec]::after { content: none; } |
| + [rst-shell-sidebar~="index"] [equipo-spec] > .icon:first-child { color: var(--rst-accent); } |
| + [rst-shell-sidebar~="index"] [equipo-spec] > .icon:last-of-type { inline-size: .625rem; block-size: .625rem; justify-self: center; } |
| + [rst-shell-sidebar~="index"] [equipo-spec-now] { font-size: var(--rst-fs-sm); } |
| } |
| /* The message a task was noted from, opened from the task: a soft tint |
| that fades. */ |
| @@ -1063,8 +1058,6 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [rst-shell-sidebar~="index"] [equipo-nav-group] { margin: var(--rst-sp-5) 0 var(--rst-sp-2); padding: 0 1rem; line-height: 1.3; } |
| [rst-shell-sidebar~="index"] [rst-shell-nav] > a [equipo-count] { margin-inline-start: auto; } |
| [rst-shell-sidebar~="index"] [rst-shell-nav] > a:has([equipo-count])::after { margin-inline-start: 0; } |
| - [rst-shell-sidebar~="index"] [equipo-spec] > summary { grid-template-columns: auto minmax(0, 1fr) auto .625rem; padding-inline: 1rem .75rem; column-gap: .75rem; } |
| - [rst-shell-sidebar~="index"] [equipo-spec] > summary > .icon:last-child { justify-self: center; } |
| } |
| /* Settings: sections of full-row links with quiet descriptions. */ |
| [equipo-settings-section] { margin-block: 0 var(--rst-sp-6); } |
| @@ -1253,6 +1246,100 @@ 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; } |
| + |
| +/* A specialist's drawer (the team panel, 2026-11-11): its own page, |
| + /team/{specialist}, lifted by team-panel.js into a dialog at the |
| + window's end edge, full width on a phone. Hairlines and tints only. */ |
| +dialog[equipo-drawer] { position: fixed; inset: 0 0 0 auto; box-sizing: border-box; margin: 0; padding: 0; border: 0; inline-size: min(30rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; overflow: hidden; background: var(--rst-bg); color: var(--rst-text); box-shadow: inset 1px 0 0 var(--rst-line), -12px 0 32px -16px light-dark(rgba(16, 24, 40, .28), rgba(0, 0, 0, .7)); animation: equipo-drawer-in .32s cubic-bezier(.16, 1, .3, 1); } |
| +html:has(dialog[equipo-drawer][open]) { overflow: hidden; } |
| +dialog[equipo-drawer]::backdrop { background: var(--rst-overlay); animation: equipo-fade .24s ease-out; } |
| +dialog[equipo-drawer][data-leaving] { animation: equipo-drawer-out .18s cubic-bezier(.4, 0, 1, 1) forwards; } |
| +dialog[equipo-drawer][data-leaving]::backdrop { opacity: 0; transition: opacity .18s ease-in; } |
| +[dir="rtl"] dialog[equipo-drawer] { inset: 0 auto 0 0; box-shadow: inset -1px 0 0 var(--rst-line), 12px 0 32px -16px light-dark(rgba(16, 24, 40, .28), rgba(0, 0, 0, .7)); } |
| +@keyframes equipo-drawer-in { from { transform: translateX(100%); } } |
| +@keyframes equipo-drawer-out { to { transform: translateX(100%); } } |
| +dialog[equipo-drawer] > [equipo-team] { box-sizing: border-box; block-size: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--rst-sp-5) calc(var(--rst-sp-6) + env(safe-area-inset-bottom, 0px)); } |
| +dialog[equipo-drawer] [equipo-team-head] { position: sticky; inset-block-start: 0; z-index: 1; margin-inline: calc(-1 * var(--rst-sp-5)); padding: calc(var(--rst-sp-4) + env(safe-area-inset-top, 0px)) var(--rst-sp-4) var(--rst-sp-3) var(--rst-sp-5); background: var(--rst-bg); border-block-end: 1px solid var(--rst-line); } |
| + |
| +[equipo-team] { display: flex; flex-direction: column; gap: var(--rst-sp-5); max-inline-size: 40rem; } |
| +[equipo-team-head] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: var(--rst-sp-3); } |
| +[equipo-team-icon] { grid-row: 1 / span 2; display: inline-grid; place-items: center; inline-size: 2.5rem; block-size: 2.5rem; border-radius: calc(1.5 * var(--rst-radius)); color: var(--rst-accent); background: color-mix(in oklab, var(--rst-surface), var(--rst-accent-soft) 70%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rst-accent) 18%, var(--rst-line)); } |
| +[equipo-team-icon] .icon { inline-size: 1.2rem; block-size: 1.2rem; margin: 0; } |
| +[equipo-team-head] h1 { margin: 0; font-size: var(--rst-fs-lg); line-height: 1.25; font-weight: 650; letter-spacing: -.01em; } |
| +[equipo-team-state] { grid-column: 2; margin: 0; display: flex; align-items: center; gap: .45em; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); font-variant-numeric: tabular-nums; } |
| +[equipo-team][data-state="idle"] [equipo-team-state] { color: var(--rst-text-faint); } |
| +[equipo-team-state] [data-spec-star] { display: inline-flex; } |
| +[equipo-team-state] [equipo-sparkle] { margin: 0; inline-size: 1em; block-size: 1em; } |
| +[equipo-team-close] { grid-column: 3; grid-row: 1 / span 2; display: inline-grid; place-items: center; inline-size: max(2.5rem, var(--rst-target, 2.5rem)); block-size: max(2.5rem, var(--rst-target, 2.5rem)); padding: 0; border: 0; border-radius: var(--rst-radius); background: transparent; color: var(--rst-text-muted); cursor: pointer; } |
| +[equipo-team-close][hidden] { display: none; } |
| +[equipo-team-close]:hover { color: var(--rst-text); background: var(--rst-tint-hover); } |
| +[equipo-team-close]:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: 2px; } |
| +[equipo-team-close] .icon { inline-size: 1.15rem; block-size: 1.15rem; margin: 0; } |
| +@media (pointer: coarse) { [equipo-team-close] { inline-size: 2.75rem; block-size: 2.75rem; } } |
| +[equipo-team-sec] > h2 { margin: 0 0 var(--rst-sp-2); font-size: var(--rst-fs-sm); font-weight: 600; color: var(--rst-text); } |
| +[equipo-team-sec] p { margin: 0; } |
| +[equipo-team-task] { display: block; font-size: var(--rst-fs-base); font-weight: 600; line-height: 1.35; color: var(--rst-text); text-decoration: none; overflow-wrap: anywhere; } |
| +[equipo-team-task]:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--rst-text) 35%, transparent); } |
| +[equipo-team-where] { display: flex; flex-wrap: wrap; gap: 0 var(--rst-sp-2); margin-block-start: var(--rst-sp-1) !important; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +[equipo-team-where] > span + span::before { content: "\00B7"; margin-inline-end: var(--rst-sp-2); color: var(--rst-text-faint); } |
| +[equipo-team-quiet] { font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +[equipo-team-quiet] a { color: inherit; text-underline-offset: 2px; } |
| +/* The activity: newest first, a hairline joining the dots; the line |
| + now is marked with the accent. */ |
| +[equipo-team-tl] { list-style: none; margin: 0; padding: 0; } |
| +[equipo-team-tl] > li { position: relative; display: grid; grid-template-columns: .75rem minmax(0, 1fr); column-gap: var(--rst-sp-3); padding-block-end: var(--rst-sp-3); } |
| +[equipo-team-tl] > li:not(:last-child)::before { content: ""; position: absolute; inset-block: .9rem 0; inset-inline-start: calc(.375rem - .5px); inline-size: 1px; background: var(--rst-line); } |
| +[equipo-team-dot] { margin-block-start: .4rem; justify-self: center; inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--rst-line-strong); } |
| +[equipo-team-tl] > li[data-now] [equipo-team-dot] { background: var(--rst-accent); outline: 3px solid var(--rst-accent-soft); } |
| +[equipo-team][data-state="idle"] [equipo-team-tl] > li[data-now] [equipo-team-dot] { background: var(--rst-line-strong); outline: 0; } |
| +[equipo-team-tl] p { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--rst-sp-3); font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +[equipo-team-tl] > li[data-now] p > span:first-child { color: var(--rst-text); font-weight: 550; } |
| +[equipo-team-tl] [equipo-ago] { font-size: var(--rst-fs-xs); color: var(--rst-text-faint); font-variant-numeric: tabular-nums; } |
| +[equipo-team-raw] { margin-block-start: 2px; font-size: var(--rst-fs-xs); } |
| +[equipo-team-raw] > summary { display: inline-flex; align-items: center; gap: .35em; list-style: none; color: var(--rst-text-faint); cursor: pointer; border-radius: var(--rst-radius-sm); } |
| +[equipo-team-raw] > summary::-webkit-details-marker { display: none; } |
| +[equipo-team-raw] > summary .icon { inline-size: .85em; block-size: .85em; margin: 0; transition: transform .15s ease; } |
| +[equipo-team-raw][open] > summary .icon { transform: rotate(90deg); } |
| +[equipo-team-raw] > summary:hover { color: var(--rst-text-muted); } |
| +[equipo-team-raw] > summary:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: 2px; } |
| +[equipo-team-raw] code { display: block; margin-block-start: var(--rst-sp-1); padding: var(--rst-sp-2) var(--rst-sp-3); border: 1px solid var(--rst-line); border-radius: var(--rst-radius-sm); background: var(--rst-surface); color: var(--rst-text); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--rst-fs-xs); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; } |
| +[equipo-team-files] { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); } |
| +[equipo-team-files] li { display: inline-flex; align-items: center; gap: .4em; min-inline-size: 0; max-inline-size: 100%; padding: .2rem .55rem; border: 1px solid var(--rst-line); border-radius: var(--rst-radius-pill, 999px); background: var(--rst-surface); font-size: var(--rst-fs-sm); } |
| +[equipo-team-files] li > span { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| +[equipo-team-files] .icon { inline-size: .9em; block-size: .9em; margin: 0; color: var(--rst-text-faint); } |
| +[equipo-team-files] small { font-size: var(--rst-fs-xs); color: var(--rst-accent); font-weight: 550; } |
| +[equipo-team-runs] { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--rst-sp-1) var(--rst-sp-4); margin: 0; font-size: var(--rst-fs-sm); } |
| +[equipo-team-runs] > div { display: contents; } |
| +[equipo-team-runs] dt { color: var(--rst-text-muted); } |
| +[equipo-team-runs] dd { margin: 0; min-inline-size: 0; overflow-wrap: anywhere; } |
| +[equipo-team-runs] dd > span::before { content: "\00B7"; margin-inline: var(--rst-sp-2); color: var(--rst-text-faint); } |
| +[equipo-team-runs] dd [equipo-team-quiet]::before { content: none; } |
| +/* Asking: the task it is about, earlier questions with their answers, |
| + and the box. */ |
| +[equipo-team-ask] { padding: var(--rst-sp-4); border: 1px solid var(--rst-line); border-radius: calc(1.5 * var(--rst-radius)); background: color-mix(in oklab, var(--rst-surface), var(--rst-accent-soft) 22%); } |
| +[equipo-team-ask] > h2 { margin-block-end: var(--rst-sp-1); } |
| +[equipo-team-about] { font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +[equipo-team-about] a { color: var(--rst-text); text-underline-offset: 2px; } |
| +[equipo-team-ask] > [equipo-team-quiet] { margin-block-start: var(--rst-sp-1); } |
| +[equipo-team-qs] { list-style: none; margin: var(--rst-sp-3) 0 0; padding: 0; display: grid; gap: var(--rst-sp-3); } |
| +[equipo-team-q] { justify-self: end; font-size: var(--rst-fs-sm); font-weight: 500; } |
| +[equipo-team-qs] > li { display: grid; gap: var(--rst-sp-1); } |
| +[equipo-team-qs] [equipo-markdown] { padding: var(--rst-sp-2) var(--rst-sp-3); border-radius: var(--rst-radius); background: var(--rst-bg); border: 1px solid var(--rst-line); font-size: var(--rst-fs-sm); line-height: 1.5; } |
| +[equipo-team-ask-form] { display: grid; gap: var(--rst-sp-2); margin-block-start: var(--rst-sp-3); } |
| +[equipo-team-ask-form] textarea { box-sizing: border-box; inline-size: 100%; min-block-size: 4.5rem; resize: vertical; font: inherit; font-size: var(--rst-fs-sm); line-height: 1.5; } |
| +[equipo-team-ask-foot] { display: flex; align-items: center; justify-content: flex-end; gap: var(--rst-sp-3); } |
| +[equipo-team-ask-foot] [data-ask-error] { margin: 0 auto 0 0; font-size: var(--rst-fs-sm); color: var(--rst-tone-negative-fg); } |
| +[equipo-team-ask-foot] [data-ask-error][hidden] { display: none; } |
| +[equipo-team-recent] { list-style: none; margin: 0; padding: 0; display: grid; } |
| +[equipo-team-recent] li { display: grid; gap: 2px; padding-block: var(--rst-sp-2); border-block-end: 1px solid var(--rst-line); } |
| +[equipo-team-recent] li:first-child { padding-block-start: 0; } |
| +[equipo-team-recent] li:last-child { border-block-end: 0; } |
| +[equipo-team-recent] a { font-size: var(--rst-fs-sm); font-weight: 550; color: var(--rst-text); text-decoration: none; overflow-wrap: anywhere; } |
| +[equipo-team-recent] a:hover { text-decoration: underline; text-underline-offset: 2px; } |
| +[equipo-team-recent] p { font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +[equipo-team-recent] small { display: flex; flex-wrap: wrap; gap: 0 var(--rst-sp-2); font-size: var(--rst-fs-xs); color: var(--rst-text-faint); } |
| +[equipo-team-recent] small > span + span::before { content: "\00B7"; margin-inline-end: var(--rst-sp-2); } |
| + |
| /* 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, |
diff --git a/internal/equipo/static/nav-stream.js b/internal/equipo/static/nav-stream.js| index d7e926fc..af9e6e12 100644 |
| --- a/internal/equipo/static/nav-stream.js |
| +++ b/internal/equipo/static/nav-stream.js |
| @@ -1,7 +1,7 @@ |
| // The sidebar follows the person's event stream: when a task, a step, a |
| // step's activity or a project changes, the server renders the sidebar |
| // again (counts and what each specialist is doing) and it is swapped in |
| -// place, keeping each specialist's dropdown as the person left it. |
| +// place, keeping each working specialist's living mark moving. |
| // Requests run one at a time; one asked for during another runs once |
| // after it. The same stream tells the work pages (work-stream.js) to |
| // follow, and elapsed clocks tick here, on every page. |
| @@ -16,22 +16,6 @@ |
| else if (sessionStorage.getItem(BEFORE)) leave.setAttribute("href", sessionStorage.getItem(BEFORE)); |
| } catch (e) { /* the Conversation it is */ } |
| var rail = document.querySelector("[data-nav-stream]"); |
| - var KEY = "equipo.spec.open"; |
| - function opened() { |
| - try { return JSON.parse(sessionStorage.getItem(KEY) || "[]"); } catch (e) { return []; } |
| - } |
| - function remember() { |
| - if (!rail) return; |
| - var ids = [].map.call(rail.querySelectorAll("[equipo-spec][open]"), function (d) { return d.id; }); |
| - try { sessionStorage.setItem(KEY, JSON.stringify(ids)); } catch (e) {} |
| - } |
| - function restore() { |
| - if (!rail) return; |
| - opened().forEach(function (id) { |
| - var d = document.getElementById(id); |
| - if (d && d.matches("[equipo-spec][data-state='working']") && rail.contains(d)) d.open = true; |
| - }); |
| - } |
| // Clocks: "4:12", then "1:04:12" past an hour. They are content, so |
| // they tick under reduced motion too. |
| function two(n) { return String(n).padStart(2, "0"); } |
| @@ -73,20 +57,17 @@ |
| document.dispatchEvent(new CustomEvent("equipo:work", { detail: { type: type } })); |
| } |
| if (!rail) return; |
| - restore(); |
| - rail.addEventListener("toggle", function (e) { |
| - if (e.target.matches && e.target.matches("[equipo-spec]")) remember(); |
| - }, true); |
| if (!window.EventSource || !window.fetch) return; |
| var cursor = Number(rail.dataset.cursor) || 0; |
| var key = rail.dataset.key || ""; |
| var source = null, failures = 0, inflight = null, again = false, timer = 0; |
| - function lastLines() { |
| + // What each specialist row says it is doing now, by row. |
| + function doing() { |
| var out = {}; |
| rail.querySelectorAll("[equipo-spec]").forEach(function (d) { |
| - var p = d.querySelector("[equipo-spec-panel]"), li = d.querySelector("[equipo-spec-lines] li:last-child"); |
| - out[d.id] = p ? p.dataset.step + "|" + (li ? li.textContent : "") : ""; |
| + var now = d.querySelector("[equipo-spec-now]"); |
| + out[d.id] = now ? now.dataset.step + "|" + now.textContent : ""; |
| }); |
| return out; |
| } |
| @@ -97,21 +78,26 @@ |
| var doc = new DOMParser().parseFromString(body, "text/html"); |
| var next = doc.querySelector("[data-nav-stream]"); |
| if (!next) return; |
| - var before = lastLines(), focus = document.activeElement && rail.contains(document.activeElement) ? document.activeElement.id || "" : ""; |
| - remember(); |
| + var before = doing(), focus = document.activeElement && rail.contains(document.activeElement) ? document.activeElement.id || "" : ""; |
| + var sparks = {}; |
| + rail.querySelectorAll("[equipo-spec] [data-spec-star] [data-live]").forEach(function (s) { sparks[s.closest("[equipo-spec]").id] = s; }); |
| // Rendered after the event that asked for it, so never older. |
| rail.dataset.cursor = next.dataset.cursor; |
| rail.innerHTML = next.innerHTML; |
| - restore(); |
| - var after = lastLines(); |
| + Object.keys(sparks).forEach(function (id) { |
| + var slot = document.querySelector("#" + id + " [data-spec-star]"); |
| + if (slot) slot.replaceChildren(sparks[id]); |
| + }); |
| + var after = doing(); |
| Object.keys(after).forEach(function (id) { |
| if (before[id] !== undefined && after[id] && before[id] !== after[id]) { |
| - var li = document.querySelector("#" + id + " [equipo-spec-lines] li:last-child"); |
| - if (li) li.setAttribute("data-new", ""); |
| + var line = document.querySelector("#" + id + " [equipo-spec-doing]"); |
| + if (line) line.setAttribute("data-new", ""); |
| } |
| }); |
| if (focus) { var f = document.getElementById(focus); if (f) f.focus(); } |
| tick(); |
| + document.dispatchEvent(new CustomEvent("equipo:rail")); |
| }); |
| } |
| function refresh() { |
| @@ -147,6 +133,12 @@ |
| work("activity"); |
| } |
| }); |
| + // A question's state (asked, answering, answered): the team panel's |
| + // Ask box shows it. |
| + source.addEventListener("question", function (event) { |
| + seen(event); |
| + work("question"); |
| + }); |
| source.addEventListener("card", function (event) { |
| seen(event); |
| soon(); |
diff --git a/internal/equipo/static/team-panel.js b/internal/equipo/static/team-panel.js| new file mode 100644 |
| index 00000000..9342f4f8 |
| --- /dev/null |
| +++ b/internal/equipo/static/team-panel.js |
| @@ -0,0 +1,150 @@ |
| +// The team panel. Each specialist row in the sidebar is a link to that |
| +// specialist's page (/team/{specialist}); with script it opens the same |
| +// page as a drawer over the one the person is on. The drawer follows the |
| +// event stream (nav-stream.js says so with equipo:work) while it is |
| +// open, keeping a question being typed, the focus and any open command. |
| +// Its Ask box posts in the background. The still marks, in the sidebar |
| +// and the drawer, come alive as the shared Stardust (stardust.js). |
| +(function () { |
| + "use strict"; |
| + var dust = window.EquipoStardust; |
| + function enliven(scope) { |
| + if (!dust || !scope) return; |
| + scope.querySelectorAll("[data-spec-star]").forEach(function (slot) { |
| + if (slot.querySelector("[data-live]")) return; |
| + var live = dust.spark(dust.look); |
| + live.setAttribute("data-live", ""); |
| + slot.replaceChildren(live); |
| + }); |
| + } |
| + enliven(document); |
| + // nav-stream.js swaps the sidebar in and keeps the marks that were |
| + // already alive; the new ones come alive here. |
| + document.addEventListener("equipo:rail", function () { enliven(document.querySelector("#rail")); }); |
| + |
| + // The Ask box, in the drawer or on the page: posted in the background, |
| + // the question then shows in the panel with its answer when it comes. |
| + document.addEventListener("submit", function (e) { |
| + var form = e.target.closest && e.target.closest("[data-team-ask]"); |
| + if (!form || !window.fetch) return; |
| + e.preventDefault(); |
| + var button = form.querySelector("button[type=submit]"), error = form.querySelector("[data-ask-error]"); |
| + var id = form.querySelector("[name=request_id]"); |
| + if (button.disabled) return; |
| + button.disabled = true; |
| + if (error) error.hidden = true; |
| + fetch(form.action, { method: "POST", credentials: "same-origin", headers: { "Accept": "application/json", "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams(new FormData(form)) }) |
| + .then(function (r) { if (!r.ok) throw new Error("ask"); return r.json(); }) |
| + .then(function () { |
| + form.querySelector("textarea").value = ""; |
| + // A fresh key: the next question is a new one. |
| + if (id && window.crypto && crypto.randomUUID) id.value = crypto.randomUUID(); |
| + refresh(); |
| + }) |
| + .catch(function () { if (error) error.hidden = false; }) |
| + .finally(function () { button.disabled = false; }); |
| + }); |
| + |
| + if (!window.fetch || !window.DOMParser || typeof HTMLDialogElement !== "function") return; |
| + var still = window.matchMedia ? matchMedia("(prefers-reduced-motion: reduce)") : null; |
| + var dialog = null, href = "", from = "", inflight = null, again = false, timer = 0; |
| + |
| + function ensure() { |
| + if (dialog) return dialog; |
| + dialog = document.createElement("dialog"); |
| + dialog.setAttribute("equipo-drawer", ""); |
| + dialog.setAttribute("aria-labelledby", "team-title"); |
| + document.body.append(dialog); |
| + // A click on the scrim (the dialog itself, outside its panel) or on |
| + // the close button closes it; so does Escape, natively. |
| + dialog.addEventListener("click", function (e) { |
| + if (e.target === dialog || (e.target.closest && e.target.closest("[data-team-close]"))) close(); |
| + }); |
| + dialog.addEventListener("cancel", function (e) { e.preventDefault(); close(); }); |
| + dialog.addEventListener("close", function () { |
| + href = ""; |
| + dialog.removeAttribute("data-leaving"); |
| + dialog.replaceChildren(); |
| + var back = from && document.getElementById(from); |
| + if (back) back.focus(); |
| + }); |
| + return dialog; |
| + } |
| + function close() { |
| + if (!dialog || !dialog.open || dialog.hasAttribute("data-leaving")) return; |
| + if (still && still.matches) { dialog.close(); return; } |
| + dialog.setAttribute("data-leaving", ""); |
| + setTimeout(function () { if (dialog.open) dialog.close(); }, 180); |
| + } |
| + function load(url) { |
| + return fetch(url, { credentials: "same-origin", headers: { "Accept": "text/html" } }) |
| + .then(function (r) { if (!r.ok) throw new Error("team"); return r.text(); }) |
| + .then(function (body) { |
| + var next = new DOMParser().parseFromString(body, "text/html").querySelector("[equipo-team]"); |
| + if (!next) throw new Error("team"); |
| + return next; |
| + }); |
| + } |
| + // place puts a freshly rendered panel in the drawer, keeping what the |
| + // person was doing in the old one. |
| + function place(next) { |
| + var d = ensure(), old = d.querySelector("[equipo-team]"); |
| + var shut = next.querySelector("[data-team-close]"); |
| + if (shut) shut.hidden = false; |
| + if (old) { |
| + var draft = old.querySelector("[data-team-ask] textarea"), typed = draft ? draft.value : "", focused = draft && document.activeElement === draft; |
| + var opened = [].filter.call(old.querySelectorAll("[equipo-team-raw]"), function (x) { return x.open; }).map(function (x) { return x.textContent; }); |
| + var top = old.scrollTop; |
| + var oldKey = old.querySelector("[data-team-ask] [name=request_id]"); |
| + // A live mark that is still wanted keeps moving rather than restarting. |
| + var spark = old.querySelector("[equipo-team-state] [data-live]"), slot = next.querySelector("[equipo-team-state] [data-spec-star]"); |
| + if (spark && slot) slot.replaceChildren(spark); |
| + old.replaceWith(next); |
| + next.scrollTop = top; |
| + var box = next.querySelector("[data-team-ask] textarea"); |
| + if (box && draft && next.querySelector("[data-ask-task]") && old.querySelector("[data-ask-task]") && next.querySelector("[data-ask-task]").dataset.askTask === old.querySelector("[data-ask-task]").dataset.askTask) { |
| + box.value = typed; |
| + var key = next.querySelector("[data-team-ask] [name=request_id]"); |
| + if (key && oldKey) key.value = oldKey.value; |
| + if (focused) box.focus(); |
| + } |
| + next.querySelectorAll("[equipo-team-raw]").forEach(function (x) { if (opened.indexOf(x.textContent) >= 0) x.open = true; }); |
| + } else { |
| + d.append(next); |
| + } |
| + enliven(next); |
| + if (window.equipoAges) window.equipoAges(); |
| + } |
| + function open(url, row) { |
| + href = url; |
| + from = row || ""; |
| + load(url).then(function (next) { |
| + if (href !== url) return; |
| + var d = ensure(); |
| + place(next); |
| + if (!d.open) d.showModal(); |
| + var c = d.querySelector("[data-team-close]"); |
| + if (c) c.focus(); |
| + }).catch(function () { location.assign(url); }); |
| + } |
| + function refresh() { |
| + if (!href) return; |
| + if (inflight) { again = true; return; } |
| + var url = href; |
| + inflight = load(url).then(function (next) { if (href === url) place(next); }).catch(function () {}).finally(function () { |
| + inflight = null; |
| + if (again) { again = false; refresh(); } |
| + }); |
| + } |
| + document.addEventListener("click", function (e) { |
| + var a = e.target.closest && e.target.closest("a[data-team-open]"); |
| + if (!a || e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return; |
| + e.preventDefault(); |
| + open(a.getAttribute("href"), a.id); |
| + }); |
| + document.addEventListener("equipo:work", function () { |
| + if (!href) return; |
| + clearTimeout(timer); |
| + timer = setTimeout(refresh, 200); |
| + }); |
| +})(); |
diff --git a/internal/equipo/team_activity.go b/internal/equipo/team_activity.go| new file mode 100644 |
| index 00000000..6317d0db |
| --- /dev/null |
| +++ b/internal/equipo/team_activity.go |
| @@ -0,0 +1,92 @@ |
| +package equipo |
| + |
| +import ( |
| + "fmt" |
| + "strings" |
| + |
| + "amadan.net/oficina/equipo/internal/equipo/activity" |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// The team panel says what a specialist is doing the way a person would: |
| +// "Reading NavigationStack.swift", not the command the runner saw. A |
| +// step's activity lines (wire.ActivityLine, the step_activity stream) |
| +// arrive sorted by kind for Claude's own tools; a shell command arrives |
| +// as kind "run" with the command's first line, wrapped or not (Codex |
| +// sends `/bin/bash -lc "cat ios/..."`). Package activity unwraps the |
| +// command, takes its first meaningful part and maps the common tools to |
| +// a verb and, for a file, its path; humaneActivity words it with the |
| +// base name. Anything unknown is "Running a command": raw shell never |
| +// shows. The command itself stays behind a disclosure on the panel. |
| + |
| +// humaneActivity is one activity line in plain words. |
| +func humaneActivity(a wire.ActivityLine) string { |
| + key, subject := activity.Meaning(a) |
| + return activityWords(key, subject) |
| +} |
| + |
| +// activityWords renders a verb and subject with the reviewed copy. A |
| +// subject that is not plain (a variable, a glob, a substitution) is |
| +// dropped rather than shown. |
| +func activityWords(key, subject string) string { |
| + file := activity.Name(subject) |
| + switch key { |
| + case "read", "edit": |
| + if file == "" { |
| + return copyText("team.activity." + key + "_files") |
| + } |
| + return fmt.Sprintf(copyText("work.activity."+key), file) |
| + case "search": |
| + if !activity.Word(subject) { |
| + return copyText("team.activity.search_code") |
| + } |
| + return fmt.Sprintf(copyText("work.activity.search"), subject) |
| + case "list": |
| + if file == "" || file == "." { |
| + return copyText("team.activity.list_files") |
| + } |
| + return fmt.Sprintf(copyText("team.activity.list"), file) |
| + case "script": |
| + if file == "" { |
| + return copyText("team.activity.command") |
| + } |
| + return fmt.Sprintf(copyText("team.activity.script"), file) |
| + case "working": |
| + return copyText("work.activity.working") |
| + } |
| + if text := copyText("team.activity." + key); text != "" { |
| + return text |
| + } |
| + return copyText("team.activity.command") |
| +} |
| + |
| +// teamFile is one file a step's lines touched. |
| +type teamFile struct { |
| + Name, Path string |
| + Edited bool |
| +} |
| + |
| +// activityFiles are the files a step's lines read or edited, newest |
| +// first, once each; an edit wins over a read. |
| +func activityFiles(lines []wire.ActivityLine) []teamFile { |
| + var out []teamFile |
| + seen := map[string]int{} |
| + for i := len(lines) - 1; i >= 0; i-- { |
| + key, subject := activity.Meaning(lines[i]) |
| + if key != "read" && key != "edit" { |
| + continue |
| + } |
| + name := activity.Name(subject) |
| + if name == "" { |
| + continue |
| + } |
| + p := strings.TrimPrefix(strings.TrimSpace(subject), "./") |
| + if j, ok := seen[p]; ok { |
| + out[j].Edited = out[j].Edited || key == "edit" |
| + continue |
| + } |
| + seen[p] = len(out) |
| + out = append(out, teamFile{Name: name, Path: p, Edited: key == "edit"}) |
| + } |
| + return out |
| +} |
diff --git a/internal/equipo/team_activity_test.go b/internal/equipo/team_activity_test.go| new file mode 100644 |
| index 00000000..d1cb90c4 |
| --- /dev/null |
| +++ b/internal/equipo/team_activity_test.go |
| @@ -0,0 +1,147 @@ |
| +package equipo |
| + |
| +import ( |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// The team panel says what a specialist is doing in plain words: a verb |
| +// and, for a file, its base name. Common tool calls map to their verb |
| +// however the runner wrapped them (Codex sends "/bin/bash -lc ..."); a |
| +// command it does not know is "Running a command". Raw shell never shows. |
| +func TestHumaneActivity(t *testing.T) { |
| + run := func(cmd string) wire.ActivityLine { return wire.ActivityLine{Kind: wire.ActivityRun, Subject: cmd} } |
| + for _, tc := range []struct { |
| + line wire.ActivityLine |
| + want string |
| + }{ |
| + // The kinds the runner already sorted. |
| + {wire.ActivityLine{Kind: wire.ActivityRead, Subject: "ios/Woodstar/NavigationStack.swift"}, "Reading NavigationStack.swift"}, |
| + {wire.ActivityLine{Kind: wire.ActivityEdit, Subject: "internal/equipo/static/live.js"}, "Editing live.js"}, |
| + {wire.ActivityLine{Kind: wire.ActivitySearch, Subject: "replaceWith"}, "Searching for replaceWith"}, |
| + {wire.ActivityLine{Kind: wire.ActivitySearch, Subject: "**/*.swift"}, "Searching the code"}, |
| + {wire.ActivityLine{Kind: wire.ActivityOther, Subject: "mcp__equipo__read_task"}, "Working"}, |
| + {wire.ActivityLine{Kind: wire.ActivityRead}, "Working"}, |
| + // Reads, however they are wrapped. |
| + {run(`/bin/bash -lc "cat ios/Woodstar/NavigationStack.swift"`), "Reading NavigationStack.swift"}, |
| + {run(`/bin/bash -c 'cat ios/Woodstar/AccountNavigationHost.swift'`), "Reading AccountNavigationHost.swift"}, |
| + {run(`bash -lc "sed -n '1,120p' ios/Woodstar/Panes/PaneNavigationHost.swift"`), "Reading PaneNavigationHost.swift"}, |
| + {run(`sed -n -e 1,80p internal/equipo/rail.go`), "Reading rail.go"}, |
| + {run(`head -n 40 README.md`), "Reading README.md"}, |
| + {run(`tail -50 internal/equipo/copy.go`), "Reading copy.go"}, |
| + {run(`nl -ba internal/equipo/work_views.go | sed -n '280,320p'`), "Reading work_views.go"}, |
| + {run(`cd /workspace && cat go.mod`), "Reading go.mod"}, |
| + // Searches. |
| + {run(`/bin/bash -lc "rg -n interactivePopGestureRecognizer ios"`), "Searching for interactivePopGestureRecognizer"}, |
| + {run(`rg -n "func (a \*application) rail" internal/equipo`), "Searching the code"}, |
| + {run(`grep -rn --include=*.go activityText .`), "Searching for activityText"}, |
| + {run(`git grep -n lastActivity`), "Searching for lastActivity"}, |
| + {run(`rg --files ios | head`), "Looking through ios"}, |
| + {run(`rg --files`), "Looking through the files"}, |
| + {run(`cat`), "Reading files"}, |
| + {run(`find ios -name "*.swift"`), "Looking through ios"}, |
| + {run(`ls -la internal/equipo/static`), "Looking through static"}, |
| + // Writes. |
| + {run(`sed -i 's/old/new/' internal/equipo/rail.go`), "Editing rail.go"}, |
| + {run(`/bin/bash -lc "apply_patch <<'EOF'"`), "Editing files"}, |
| + {run(`git apply fix.patch`), "Editing files"}, |
| + {run(`gofmt -w internal/equipo/rail.go`), "Formatting the code"}, |
| + // Tests, builds and checks. |
| + {run(`go test ./internal/equipo -run TestRail`), "Running the tests"}, |
| + {run(`cd /workspace && GOFLAGS=-mod=mod go test ./...`), "Running the tests"}, |
| + {run(`/bin/bash -lc "xcodebuild test -scheme Woodstar -destination 'platform=iOS Simulator,name=iPhone 16'"`), "Running the tests"}, |
| + {run(`xcodebuild -scheme Woodstar build`), "Building the project"}, |
| + {run(`swift build`), "Building the project"}, |
| + {run(`swift test --filter PaneTests`), "Running the tests"}, |
| + {run(`npm test`), "Running the tests"}, |
| + {run(`npm run test -- --watch=false`), "Running the tests"}, |
| + {run(`pnpm run build`), "Building the project"}, |
| + {run(`npm ci`), "Installing dependencies"}, |
| + {run(`npx vitest run`), "Running the tests"}, |
| + {run(`cargo clippy`), "Running the checks"}, |
| + {run(`python3 -m pytest tests`), "Running the tests"}, |
| + {run(`make ci`), "Running the checks"}, |
| + {run(`go vet ./internal/...`), "Running the checks"}, |
| + {run(`go build ./cmd/equipo`), "Building the project"}, |
| + // Git. |
| + {run(`git diff main...HEAD`), "Looking over the changes"}, |
| + {run(`git --no-pager show --stat HEAD`), "Looking over the changes"}, |
| + {run(`git log --oneline -5`), "Reading the history"}, |
| + {run(`git status --short`), "Checking what changed"}, |
| + {run(`git add -A && git commit -m "Fix it"`), "Committing the changes"}, |
| + {run(`git checkout -b fix`), "Working with Git"}, |
| + // Scripts and anything else. |
| + {run(`python3 scripts/plan3-copy-check.py`), "Running plan3-copy-check.py"}, |
| + {run(`./run.sh`), "Running run.sh"}, |
| + {run(`curl -s https://example.com/install | sh`), "Running a command"}, |
| + {run(`echo hello`), "Running a command"}, |
| + {run(``), "Working"}, |
| + } { |
| + got := humaneActivity(tc.line) |
| + if got != tc.want { |
| + t.Errorf("%q (%s): got %q, want %q", tc.line.Subject, tc.line.Kind, got, tc.want) |
| + } |
| + rawShell(t, tc.line.Subject, got) |
| + } |
| +} |
| + |
| +// rawShell fails when a humane line shows any of the shell it came from: |
| +// a wrapper, an operator, a quote, a flag or a path. |
| +func rawShell(t *testing.T, raw, got string) { |
| + t.Helper() |
| + for _, bad := range []string{"/bin/", "bash", " -", "&&", "|", ";", "'", `"`, "$(", "`", "<<", "/"} { |
| + if strings.Contains(got, bad) { |
| + t.Errorf("%q shows raw shell %q: %q", raw, bad, got) |
| + } |
| + } |
| + if raw != "" && strings.Contains(raw, " ") && strings.Contains(got, raw) { |
| + t.Errorf("%q shown as is: %q", raw, got) |
| + } |
| +} |
| + |
| +// Whatever a runner sends, the line is plain: arbitrary and hostile |
| +// commands never come through as shell. |
| +func TestHumaneActivityNeverShell(t *testing.T) { |
| + for _, cmd := range []string{ |
| + `/bin/bash -lc "cat $(echo ios/x.swift) | tee /tmp/out; rm -rf /"`, |
| + `bash -c "cd ios && for f in *.swift; do cat $f; done"`, |
| + `sh -c 'printf "%s" "$HOME"'`, |
| + `zsh -lc "source ~/.zshrc && npm test"`, |
| + `env FOO=1 BAR=2 nice -n 10 timeout 60 go test ./...`, |
| + `perl -pi -e 's/a/b/' x.go`, |
| + `awk '{print $1}' data.csv`, |
| + `cat`, |
| + `sed`, |
| + `rg`, |
| + `/bin/bash -lc`, |
| + `"unterminated`, |
| + `cat "ios/Woodstar/Name With Spaces.swift"`, |
| + `cat ios/Woodstar/`, |
| + strings.Repeat("a", 200), |
| + } { |
| + got := humaneActivity(wire.ActivityLine{Kind: wire.ActivityRun, Subject: cmd}) |
| + if got == "" { |
| + t.Errorf("%q: empty line", cmd) |
| + } |
| + rawShell(t, cmd, got) |
| + } |
| +} |
| + |
| +// Files touched: the files a step's lines read or edited, newest first, |
| +// once each, by base name with the path kept for the title; an edit wins |
| +// over a read of the same file. |
| +func TestActivityFiles(t *testing.T) { |
| + lines := []wire.ActivityLine{ |
| + {Kind: wire.ActivityRead, Subject: "internal/equipo/static/live.js"}, |
| + {Kind: wire.ActivitySearch, Subject: "replaceWith"}, |
| + {Kind: wire.ActivityRun, Subject: `/bin/bash -lc "cat internal/equipo/static/nav-stream.js"`}, |
| + {Kind: wire.ActivityEdit, Subject: "internal/equipo/static/live.js"}, |
| + {Kind: wire.ActivityRun, Subject: "go test ./internal/equipo"}, |
| + } |
| + got := activityFiles(lines) |
| + if len(got) != 2 || got[0].Path != "internal/equipo/static/live.js" || got[0].Name != "live.js" || !got[0].Edited || got[1].Name != "nav-stream.js" || got[1].Edited { |
| + t.Fatalf("files: %+v", got) |
| + } |
| +} |
diff --git a/internal/equipo/team_panel.go b/internal/equipo/team_panel.go| new file mode 100644 |
| index 00000000..b421c0c1 |
| --- /dev/null |
| +++ b/internal/equipo/team_panel.go |
| @@ -0,0 +1,222 @@ |
| +package equipo |
| + |
| +import ( |
| + "context" |
| + "crypto/rand" |
| + "net/http" |
| + "slices" |
| + "time" |
| + |
| + "github.com/go-chi/chi/v5" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// The team panel: the sidebar's specialist rows open one specialist's |
| +// drawer (GET /team/{specialist}, its own URL, so it also works as a |
| +// page without script and on a phone). It shows the task the specialist |
| +// is on, what it is doing in plain words (the raw command behind a |
| +// disclosure), the files its recent lines touched, the connection and |
| +// model it runs on, a box to ask it about the work where asking works, |
| +// and what it did lately. team-panel.js opens the same page as a drawer |
| +// over the current one and keeps it current from the event stream. |
| + |
| +// teamPanel is one specialist's drawer. |
| +type teamPanel struct { |
| + Key, Icon, CopyKey, Name string |
| + // Task and Step are what it is working on now (nil when idle), Stage |
| + // the task's stage in words; More counts its other running tasks and |
| + // Queue the tasks waiting for it. |
| + Task *wire.Task |
| + Step *wire.Step |
| + Stage string |
| + More int |
| + Queue []wire.Task |
| + // Lines are the step's activity, oldest first; Files what they touched. |
| + Lines []teamLine |
| + Files []teamFile |
| + // Provider and Connection say what it runs on; Model is "" until the |
| + // step reports usage (ModelPending while it runs). |
| + Provider, Connection, Model string |
| + ModelPending bool |
| + Ask *teamAsk |
| + Recent []teamRecent |
| +} |
| + |
| +// teamLine is one activity line: what it means, and the raw subject for |
| +// a command (shown only behind a disclosure). |
| +type teamLine struct { |
| + Text, Command, Ago string |
| + At time.Time |
| +} |
| + |
| +// teamAsk is where a question to this specialist goes: the task, whether |
| +// the answer waits for the running step, and the questions already asked. |
| +type teamAsk struct { |
| + TaskID, Title, Specialist, Name, RequestID string |
| + Waits bool |
| + Questions []threadItem |
| +} |
| + |
| +// teamRecent is one task the specialist finished a step on. |
| +type teamRecent struct { |
| + TaskID, Title, Project, Headline, Ago string |
| + At time.Time |
| +} |
| + |
| +func railEntry(key string) (struct{ specialist, icon, copyKey string }, bool) { |
| + for _, s := range specialistRail { |
| + if s.specialist == key { |
| + return s, true |
| + } |
| + } |
| + return struct{ specialist, icon, copyKey string }{}, false |
| +} |
| + |
| +// teamPage is GET /team/{specialist}. |
| +func (a *application) teamPage(w http.ResponseWriter, r *http.Request) { |
| + w.Header().Set("Cache-Control", "no-store") |
| + s, ok := railEntry(chi.URLParam(r, "specialist")) |
| + if !ok { |
| + a.failure(w, r, ErrNotFound) |
| + return |
| + } |
| + ctx, address, ok := sessionContext(r) |
| + if !ok { |
| + a.failure(w, r, ErrForbidden) |
| + return |
| + } |
| + data, err := a.page(r, s.specialist) |
| + if err != nil { |
| + a.failure(w, r, err) |
| + return |
| + } |
| + panel, err := a.teamPanel(ctx, address, s.specialist, s.icon, s.copyKey) |
| + if err != nil { |
| + a.failure(w, r, chatError(err)) |
| + return |
| + } |
| + data.Team, data.Title = panel, s.copyKey |
| + render(w, "team", data) |
| +} |
| + |
| +// teamPanel reads one specialist's drawer from the thin core. |
| +func (a *application) teamPanel(ctx context.Context, person, key, icon, copyKey string) (teamPanel, error) { |
| + c := a.store.Chat() |
| + p := teamPanel{Key: key, Icon: icon, CopyKey: copyKey, Name: specialistName(key)} |
| + tasks, err := c.Tasks(ctx, person) |
| + if err != nil { |
| + return p, err |
| + } |
| + now := time.Now() |
| + var running []wire.Task |
| + for _, k := range tasks.Items { |
| + if wire.FinalStage(k.Stage) || len(k.Steps) == 0 { |
| + continue |
| + } |
| + switch st := k.Steps[len(k.Steps)-1]; { |
| + case st.Specialist == key && st.State == wire.StepRunning: |
| + running = append(running, k) |
| + case st.Specialist == key && st.State == wire.StepQueued: |
| + p.Queue = append(p.Queue, k) |
| + } |
| + } |
| + if len(running) > 0 { |
| + k := running[0] |
| + st := k.Steps[len(k.Steps)-1] |
| + p.Task, p.Step, p.More = &k, &st, len(running)-1 |
| + p.Stage = copyText("work.stage." + k.Stage) |
| + for _, l := range st.Activity { |
| + line := teamLine{Text: humaneActivity(l), At: l.At, Ago: ago(now, l.At)} |
| + if l.Kind == wire.ActivityRun { |
| + line.Command = l.Subject |
| + } |
| + p.Lines = append(p.Lines, line) |
| + } |
| + slices.Reverse(p.Lines) |
| + p.Files = activityFiles(st.Activity) |
| + p.Provider = providerName(st.Family) |
| + if conns, err := c.Connections(ctx, person); err == nil { |
| + for _, cn := range conns { |
| + if cn.LocalID == st.Account && (st.RunnerID == "" || cn.RunnerID == st.RunnerID) { |
| + p.Connection = cn.Label |
| + if p.Provider == "" { |
| + p.Provider = providerName(cn.Provider) |
| + } |
| + } |
| + } |
| + } |
| + models, err := c.StepModels(ctx, person, []string{st.ID}) |
| + if err != nil { |
| + return p, err |
| + } |
| + p.Model, p.ModelPending = models[st.ID], models[st.ID] == "" |
| + if k.Creator == person && k.AskOpen && finishedAskable(k, key) { |
| + p.Ask = &teamAsk{TaskID: k.ID, Title: k.Title, Waits: true} |
| + } |
| + } |
| + // What it finished lately, newest first, one line per task. |
| + type done struct { |
| + k wire.Task |
| + st wire.Step |
| + } |
| + var finished []done |
| + for _, k := range tasks.Items { |
| + if p.Task != nil && k.ID == p.Task.ID { |
| + continue |
| + } |
| + for i := len(k.Steps) - 1; i >= 0; i-- { |
| + if st := k.Steps[i]; st.Specialist == key && wire.StepTerminal(st.State) && st.FinishedAt != nil { |
| + finished = append(finished, done{k, st}) |
| + break |
| + } |
| + } |
| + } |
| + slices.SortStableFunc(finished, func(x, y done) int { return y.st.FinishedAt.Compare(*x.st.FinishedAt) }) |
| + for i, d := range finished { |
| + if i == 5 { |
| + break |
| + } |
| + headline := d.st.Headline |
| + if headline == "" && d.st.Specialist == wire.SpecialistReview { |
| + headline = map[string]string{wire.VerdictApprove: copyText("work.badge.approved"), wire.VerdictChanges: copyText("work.badge.changes")}[d.st.Verdict] |
| + } |
| + p.Recent = append(p.Recent, teamRecent{TaskID: d.k.ID, Title: d.k.Title, Project: d.k.Project, Headline: headline, At: *d.st.FinishedAt, Ago: ago(now, *d.st.FinishedAt)}) |
| + if p.Task == nil && p.Ask == nil && d.k.Creator == person && d.k.AskOpen && finishedAskable(d.k, key) { |
| + k := d.k |
| + p.Ask = &teamAsk{TaskID: k.ID, Title: k.Title} |
| + } |
| + } |
| + if p.Ask != nil { |
| + p.Ask.Specialist, p.Ask.Name, p.Ask.RequestID = key, p.Name, rand.Text() |
| + for _, k := range tasks.Items { |
| + if k.ID != p.Ask.TaskID { |
| + continue |
| + } |
| + thread := threadOf(k, person, 0) |
| + for _, it := range thread.Items { |
| + if !it.Note && it.Who == p.Name { |
| + p.Ask.Questions = append(p.Ask.Questions, it) |
| + } |
| + } |
| + } |
| + if n := len(p.Ask.Questions); n > 2 { |
| + p.Ask.Questions = p.Ask.Questions[n-2:] |
| + } |
| + } |
| + return p, nil |
| +} |
| + |
| +// finishedAskable: the task has a finished step of this specialist whose |
| +// session the runner kept, which is what a question resumes. |
| +func finishedAskable(k wire.Task, key string) bool { |
| + if key != wire.SpecialistEngineering && key != wire.SpecialistReview { |
| + return false |
| + } |
| + for _, s := range k.Steps { |
| + if s.Specialist == key && s.Askable && s.State == wire.StepDone { |
| + return true |
| + } |
| + } |
| + return false |
| +} |
diff --git a/internal/equipo/templates/chrome.html b/internal/equipo/templates/chrome.html| index e4496628..67c821b8 100644 |
| --- a/internal/equipo/templates/chrome.html |
| +++ b/internal/equipo/templates/chrome.html |
| @@ -1,6 +1,6 @@ |
| {{define "rail-brand"}}<span hidden></span>{{end}} |
| {{define "title"}}{{copy .Title}} Ā· {{copy "brand"}}{{end}} |
| -{{define "head"}}{{.Live.Head (T "rastrillo.ui.live.paused") (T "rastrillo.ui.live.unconfirmed")}}<link rel="stylesheet" href="{{asset "static/equipo.css"}}"><script defer src="{{asset "static/nav-stream.js"}}"></script><script defer src="{{asset "static/work-stream.js"}}"></script>{{if .HousekeepingStream}}<script defer src="{{asset "static/housekeeping.js"}}"></script>{{end}}{{if or (eq .Key "thinking") (eq .Key "settings-hub")}}<script defer src="{{asset "static/stardust.js"}}"></script><script defer src="{{asset "static/thinking-preview.js"}}"></script><script defer src="{{asset "static/settings.js"}}"></script>{{end}}{{if or .ConnectionsStream .ChatStream}}<script defer src="{{asset "static/stardust.js"}}"></script>{{end}}{{if .ConnectionsStream}}<script defer src="{{asset "static/vendor/tweetnacl/nacl-fast.js"}}"></script><script defer src="{{asset "static/seal.js"}}"></script><script defer src="{{asset "static/connections.js"}}"></script>{{end}}{{if .ChatStream}}<script defer src="{{asset "static/chat-stream.js"}}"></script><script defer src="{{asset "static/chat-compose.js"}}"></script><script defer src="{{asset "static/ask-target.js"}}"></script>{{if eq .Key "conversation"}}<script defer src="{{asset "static/chat-anchor.js"}}"></script><script defer src="{{asset "static/chat-attach.js"}}"></script>{{end}}{{else if eq .Key "conversation"}}<script defer blocking="render" src="{{asset "static/chat-navigation.js"}}"></script><script defer src="{{asset "static/chat.js"}}"></script><script defer src="{{asset "static/chat-send.js"}}"></script>{{end}}{{end}} |
| +{{define "head"}}{{.Live.Head (T "rastrillo.ui.live.paused") (T "rastrillo.ui.live.unconfirmed")}}<link rel="stylesheet" href="{{asset "static/equipo.css"}}"><script defer src="{{asset "static/nav-stream.js"}}"></script><script defer src="{{asset "static/work-stream.js"}}"></script><script defer src="{{asset "static/stardust.js"}}"></script><script defer src="{{asset "static/team-panel.js"}}"></script>{{if .HousekeepingStream}}<script defer src="{{asset "static/housekeeping.js"}}"></script>{{end}}{{if or (eq .Key "thinking") (eq .Key "settings-hub")}}<script defer src="{{asset "static/thinking-preview.js"}}"></script><script defer src="{{asset "static/settings.js"}}"></script>{{end}}{{if .ConnectionsStream}}<script defer src="{{asset "static/vendor/tweetnacl/nacl-fast.js"}}"></script><script defer src="{{asset "static/seal.js"}}"></script><script defer src="{{asset "static/connections.js"}}"></script>{{end}}{{if .ChatStream}}<script defer src="{{asset "static/chat-stream.js"}}"></script><script defer src="{{asset "static/chat-compose.js"}}"></script><script defer src="{{asset "static/ask-target.js"}}"></script>{{if eq .Key "conversation"}}<script defer src="{{asset "static/chat-anchor.js"}}"></script><script defer src="{{asset "static/chat-attach.js"}}"></script>{{end}}{{else if eq .Key "conversation"}}<script defer blocking="render" src="{{asset "static/chat-navigation.js"}}"></script><script defer src="{{asset "static/chat.js"}}"></script><script defer src="{{asset "static/chat-send.js"}}"></script>{{end}}{{end}} |
| {{define "up"}}/work{{if .Key}}#nav-{{.Key}}{{end}}{{end}} |
| {{define "up-label"}}{{.TeamName}}{{end}} |
| {{define "brand"}}<a rst-shell-brand href="/work">{{icon "users"}}{{.TeamName}}</a>{{end}} |
| @@ -14,12 +14,8 @@ |
| </nav>{{end}} |
| {{define "rail-count"}}{{if not .Known}}<small equipo-count data-count>{{copy "counts.unavailable"}}</small>{{else if .N}}<small equipo-count data-count>{{.N}}</small>{{end}}{{end}} |
| {{define "rail-count-attention"}}{{if not .Known}}<small equipo-count data-count>{{copy "counts.unavailable"}}</small>{{else if .N}}<small equipo-count data-count data-attention>{{.N}}</small>{{end}}{{end}} |
| -{{define "rail-specialists"}}<p equipo-nav-group>{{copy "nav.specialists"}}</p>{{range .Specialists}}{{$s := .}}<details equipo-spec id="nav-{{.Key}}" data-specialist="{{.Key}}" data-state="{{if .Task}}working{{else}}idle{{end}}"><summary{{if not .Task}} tabindex="-1" aria-disabled="true"{{end}}>{{icon .Icon}}<span>{{copy .CopyKey}}</span><span equipo-spec-state>{{if .Task}}{{template "mark" "s"}}{{with .Step}}{{template "elapsed" .StartedAt}}{{end}}{{else}}{{copy "nav.idle"}}{{end}}</span>{{icon "chevron-down"}}</summary>{{with .Task}}<div equipo-spec-panel data-step="{{with $s.Step}}{{.ID}}{{end}}"> |
| -<a equipo-nav-task href="/tasks/{{.ID}}">{{.Title}}</a> |
| -<p equipo-spec-where><span>{{.Project}}</span><span>{{$s.Stage}}</span>{{with $s.Step}}<span>{{printf (copy "nav.attempt") .Attempt}}</span>{{end}}</p> |
| -<ol equipo-spec-lines>{{range $s.Lines}}<li data-now="{{copy "nav.now"}}"><span>{{.}}</span></li>{{end}}</ol> |
| -{{if $s.More}}<p equipo-spec-queue>{{printf (copy "nav.more") $s.More}}</p>{{end}}{{with $s.Queue}}<p equipo-spec-queue>{{printf (copy "nav.queue") (len .)}} <a href="/tasks/{{(index . 0).ID}}">{{(index . 0).Title}}</a></p>{{end}} |
| -</div>{{end}}</details>{{end}}{{end}} |
| +{{define "rail-specialists"}}<p equipo-nav-group>{{copy "nav.specialists"}}</p>{{range .Specialists}}{{$s := .}}<a equipo-spec id="nav-{{.Key}}" href="/team/{{.Key}}" data-team-open data-specialist="{{.Key}}" data-state="{{if .Task}}working{{else}}idle{{end}}">{{icon .Icon}}<span equipo-spec-name>{{copy .CopyKey}}</span><span equipo-spec-state>{{if .Task}}{{with .Step}}{{if gt .Attempt 1}}<span equipo-spec-attempt>{{printf (copy "nav.attempt") .Attempt}}</span>{{end}}{{end}}<span data-spec-star>{{template "mark" "s"}}</span>{{with .Step}}{{template "elapsed" .StartedAt}}{{end}}{{else}}{{copy "nav.idle"}}{{end}}</span>{{icon "chevron-right"}}{{with .Task}}<span equipo-spec-now data-step="{{with $s.Step}}{{.ID}}{{end}}" title="{{.Title}} Ā· {{$s.Now}}"><span equipo-nav-task>{{.Title}}</span><span equipo-spec-doing>{{$s.Now}}</span></span>{{end}}</a> |
| +{{end}}{{end}} |
| {{define "region:notice"}}<div id="notice" role="status"></div>{{end}} |
| {{define "profile"}}{{if .Address}}<span rst-person-av aria-hidden="true">{{icon "users"}}</span><span rst-person-name>{{.Address}}</span>{{else}}<span rst-person-av="empty placeholder" aria-hidden="true"></span><span rst-person-name>{{copy "nav.account"}}</span>{{end}}{{end}} |
| {{define "account"}}{{if .Address}}<form method="post" action="/signout"><button rst-btn type="submit">{{copy "nav.signout"}}</button></form>{{end}}{{end}} |
diff --git a/internal/equipo/templates/team.html b/internal/equipo/templates/team.html| new file mode 100644 |
| index 00000000..853f23c7 |
| --- /dev/null |
| +++ b/internal/equipo/templates/team.html |
| @@ -0,0 +1,50 @@ |
| +{{define "content"}} |
| +<div equipo-team-page data-work-live data-work-region id="team-page">{{template "team-panel" .Team}}</div> |
| +{{end}} |
| +{{/* One specialist's drawer: GET /team/{specialist} renders it as a page |
| + (no script, the phone's index), and team-panel.js lifts the same |
| + section into a drawer over the page the person is on. */}} |
| +{{define "team-panel"}}<section equipo-team data-team="{{.Key}}" data-state="{{if .Task}}working{{else}}idle{{end}}" aria-labelledby="team-title"> |
| +<header equipo-team-head> |
| +<span equipo-team-icon aria-hidden="true">{{icon .Icon}}</span> |
| +<h1 id="team-title">{{copy .CopyKey}}</h1> |
| +<p equipo-team-state>{{if .Task}}<span data-spec-star>{{template "mark" "s"}}</span>{{with .Step}}{{template "elapsed" .StartedAt}}{{end}}{{else}}{{copy "nav.idle"}}{{end}}</p> |
| +<button type="button" equipo-team-close data-team-close hidden aria-label="{{copy "team.close"}}" title="{{copy "team.close"}}">{{icon "x"}}</button> |
| +</header> |
| +{{with .Task}}<section equipo-team-sec equipo-team-now> |
| +<h2>{{copy "team.working_on"}}</h2> |
| +<a equipo-team-task href="/tasks/{{.ID}}">{{.Title}}</a> |
| +<p equipo-team-where><span>{{.Project}}</span><span>{{$.Stage}}</span>{{with $.Step}}{{if gt .Attempt 1}}<span>{{printf (copy "nav.attempt") .Attempt}}</span>{{end}}{{end}}{{if $.More}}<span>{{printf (copy "nav.more") $.More}}</span>{{end}}</p> |
| +</section> |
| +<section equipo-team-sec> |
| +<h2>{{copy "team.activity"}}</h2> |
| +<ol equipo-team-tl>{{range $i, $l := $.Lines}}<li{{if eq $i 0}} data-now{{end}}><span equipo-team-dot aria-hidden="true"></span><div><p><span>{{.Text}}</span> <span equipo-ago{{agoData .At ""}}>{{.Ago}}</span></p>{{with .Command}}<details equipo-team-raw><summary>{{icon "chevron-right"}}{{copy "team.command"}}</summary><code>{{.}}</code></details>{{end}}</div></li>{{else}}<li data-now><span equipo-team-dot aria-hidden="true"></span><div><p><span>{{copy "work.activity.working"}}</span></p></div></li>{{end}}</ol> |
| +</section> |
| +{{with $.Files}}<section equipo-team-sec> |
| +<h2>{{copy "team.files"}}</h2> |
| +<ul equipo-team-files>{{range .}}<li title="{{.Path}}">{{icon "file-text"}}<span>{{.Name}}</span>{{if .Edited}}<small>{{copy "team.edited"}}</small>{{end}}</li>{{end}}</ul> |
| +</section>{{end}} |
| +<section equipo-team-sec> |
| +<h2>{{copy "team.runs_on"}}</h2> |
| +<dl equipo-team-runs>{{if $.Provider}}<div><dt>{{copy "team.connection"}}</dt><dd>{{$.Provider}}{{with $.Connection}}<span>{{.}}</span>{{end}}</dd></div>{{end}}<div><dt>{{copy "team.model"}}</dt><dd>{{if $.Model}}{{$.Model}}{{else}}<span equipo-team-quiet>{{copy "team.model_pending"}}</span>{{end}}</dd></div></dl> |
| +</section>{{end}} |
| +{{with .Ask}}<section equipo-team-sec equipo-team-ask data-ask-task="{{.TaskID}}"> |
| +<h2>{{printf (copy "team.ask") .Name}}</h2> |
| +<p equipo-team-about>{{printf (copy "team.ask_about") ""}}<a href="/tasks/{{.TaskID}}">{{.Title}}</a></p> |
| +{{if .Waits}}<p equipo-team-quiet>{{printf (copy "team.ask_waits") .Name}}</p>{{end}} |
| +{{with .Questions}}<ol equipo-team-qs>{{range .}}<li data-question="{{.ID}}"><p equipo-team-q>{{.Text}}</p>{{if .Answered}}<div equipo-markdown equipo-md>{{chatMarkdown .Answer}}</div>{{else if .Waiting}}<p equipo-team-quiet>{{.Waiting}}</p>{{else}}<p equipo-team-quiet>{{.Ended}}</p>{{end}}</li>{{end}}</ol>{{end}} |
| +<form equipo-team-ask-form data-team-ask method="post" action="/tasks/{{.TaskID}}/ask"> |
| +<input type="hidden" name="request_id" value="{{.RequestID}}"> |
| +<input type="hidden" name="specialist" value="{{.Specialist}}"> |
| +<textarea rst-input name="body" required maxlength="4000" rows="2" aria-label="{{printf (copy "work.ask.placeholder") .Name}}" placeholder="{{printf (copy "work.ask.placeholder") .Name}}"></textarea> |
| +<div equipo-team-ask-foot><p data-ask-error role="alert" hidden>{{copy "team.ask_failed"}}</p><button rst-btn="primary" type="submit">{{copy "team.ask_send"}}</button></div> |
| +</form> |
| +</section>{{end}} |
| +{{with .Queue}}<section equipo-team-sec> |
| +<p equipo-team-quiet>{{printf (copy "nav.queue") (len .)}} <a href="/tasks/{{(index . 0).ID}}">{{(index . 0).Title}}</a></p> |
| +</section>{{end}} |
| +<section equipo-team-sec> |
| +<h2>{{copy "team.recent"}}</h2> |
| +{{with .Recent}}<ul equipo-team-recent>{{range .}}<li><a href="/tasks/{{.TaskID}}">{{.Title}}</a>{{with .Headline}}<p>{{.}}</p>{{end}}<small><span>{{.Project}}</span><span equipo-ago{{agoData .At ""}}>{{.Ago}}</span></small></li>{{end}}</ul>{{else}}<p equipo-team-quiet>{{copy "team.recent_empty"}}</p>{{end}} |
| +</section> |
| +</section>{{end}} |
diff --git a/internal/equipotest/perf_test.go b/internal/equipotest/perf_test.go| index 6ff633a8..27897505 100644 |
| --- a/internal/equipotest/perf_test.go |
| +++ b/internal/equipotest/perf_test.go |
| @@ -65,7 +65,7 @@ func TestPerfScreens(t *testing.T) { |
| defer closeAll() |
| project := f.project |
| projectPath := fmt.Sprintf("/projects/%d", project.ID) |
| - paths := map[string]string{"/projects/{id}": projectPath, "/projects/{id}/edit": projectPath + "/edit", "/specialists/{key}": "/specialists/engineering", "/tasks/{id}": "/tasks/" + f.a.TaskID, "/tasks/{id}/questions/{question}": "/tasks/" + f.a.TaskID + "/questions/perf-question", "/tasks/{id}/merge": "/tasks/" + mergeTask.ID + "/merge"} |
| + paths := map[string]string{"/projects/{id}": projectPath, "/projects/{id}/edit": projectPath + "/edit", "/specialists/{key}": "/specialists/engineering", "/team/{specialist}": "/team/review", "/tasks/{id}": "/tasks/" + f.a.TaskID, "/tasks/{id}/questions/{question}": "/tasks/" + f.a.TaskID + "/questions/perf-question", "/tasks/{id}/merge": "/tasks/" + mergeTask.ID + "/merge"} |
| planChecks := map[string]string{} |
| inviteURL := perfPlan3Paths(t, f, paths, planChecks, renderID, renderHash) |
| perftest.Screens(t, perftest.ScreenConfig{ |
diff --git a/internal/headless/browser_review_test.go b/internal/headless/browser_review_test.go| index e72531a7..fd874c57 100644 |
| --- a/internal/headless/browser_review_test.go |
| +++ b/internal/headless/browser_review_test.go |
| @@ -4,6 +4,7 @@ package headless |
| import ( |
| "testing" |
| + "time" |
| "amadan.net/oficina/equipo/internal/browsertest" |
| ) |
| @@ -34,6 +35,9 @@ func TestBrowserReceiptFollowsReview(t *testing.T) { |
| // Paul, staging: the sidebar reads the thin core and follows the stream. |
| // While a step runs, Engineering says it is working on the task (linked) |
| // and Tasks counts it; at 1280 and at 390 (inside the menu), no reload. |
| +// Then checks pass and Review approves, and Equipo merges it on its own |
| +// (slice 4c): the specialists go idle, Tasks stops counting it and |
| +// Needs you never does. |
| func TestBrowserRailFollowsWork(t *testing.T) { |
| for _, size := range []struct { |
| w, h int64 |
| @@ -48,10 +52,12 @@ func TestBrowserRailFollowsWork(t *testing.T) { |
| p.check(eng+`.dataset.state==='idle' && !document.querySelector('#nav-tasks [data-count]') && !document.querySelector('#rail [data-specialist="product"]')`, "idle sidebar") |
| p.send("tool:record_task:oficina/sample|Slow sidebar change|x\ntool:start_task:$task|stepsleep:2500 edit:README.md|teh panes|the panes") |
| p.run(browsertest.Wait(eng + `?.dataset.state==='working' && ` + eng + `.querySelector('[equipo-nav-task]')?.textContent==='Slow sidebar change' && document.querySelector('#nav-tasks [data-count]')?.textContent==='1'`)) |
| - p.run(browsertest.Wait(`document.querySelector('#rail [data-specialist="engineering"]')?.dataset.state==='idle'`)) |
| - p.run(browsertest.Wait(`document.querySelector('#rail [data-specialist="review"]')?.dataset.state==='idle'`)) |
| - // Checks and review, then ready to merge: it needs the person. |
| - p.run(browsertest.Wait(`document.querySelector('#nav-needs-you [data-count]')?.textContent==='1'`)) |
| + // The step sleeps 2.5 s on purpose; on a loaded machine the |
| + // runner's report and the sidebar's swap need more than the 2.5 s |
| + // a 5 s wait leaves after it. |
| + p.run(browsertest.WaitWithin(`document.querySelector('#rail [data-specialist="engineering"]')?.dataset.state==='idle'`, 20*time.Second)) |
| + p.run(browsertest.WaitWithin(`document.querySelector('#rail [data-specialist="review"]')?.dataset.state==='idle' && !document.querySelector('#nav-tasks [data-count]')`, 20*time.Second)) |
| + p.check(`!document.querySelector('#nav-needs-you [data-count]')`, "a task Equipo merged on its own counts as needing the person") |
| p.check(`performance.getEntriesByType('navigation').length===window.__nav`, "the page reloaded") |
| p.stop() |
| } |
diff --git a/internal/thintest/inner_browser_test.go b/internal/thintest/inner_browser_test.go| index a49adb0a..97bce717 100644 |
| --- a/internal/thintest/inner_browser_test.go |
| +++ b/internal/thintest/inner_browser_test.go |
| @@ -180,12 +180,12 @@ func TestBrowserInnerGallery(t *testing.T) { |
| // TestBrowserInnerScreens: the rich screens at 1280 with a mouse and at |
| // 390 with touch. Rows are links as a whole, by mouse and by keyboard; |
| // quiet actions show on hover or focus, and always on touch; the |
| -// sidebar's dropdown and the stage track follow the stream without a |
| -// reload; the Needs you card answers in one tap. |
| +// sidebar's specialist rows and the stage track follow the stream |
| +// without a reload; the Needs you card answers in one tap. |
| func TestBrowserInnerScreens(t *testing.T) { |
| g := newGallery(t) |
| a := g.a |
| - last := "Editing internal/equipo/static/live.js" |
| + doing := "Editing live.js" |
| for _, size := range []struct { |
| w, h int64 |
| touch bool |
| @@ -224,23 +224,24 @@ func TestBrowserInnerScreens(t *testing.T) { |
| p.do(chromedp.KeyEvent("\r")) |
| p.wait(`location.pathname===`+jsString(want), "Enter on the row") |
| - // The sidebar's dropdown follows the step's activity live (on a |
| - // phone, the sidebar is the index page). |
| + // The sidebar's specialist row follows the step's activity live, in |
| + // plain words (on a phone, the sidebar is the index page). |
| rail := "/tasks" |
| if size.touch { |
| rail = "/work" |
| } |
| p.open(rail) |
| eng := `document.querySelector('#rail [data-specialist="engineering"]')` |
| - p.check(eng+`.dataset.state==='working' && !!`+eng+`.querySelector('[equipo-mark]') && /^\d+:\d\d$/.test(`+eng+`.querySelector('[equipo-clock]').textContent)`, "Engineering is not shown working with its mark and clock") |
| - p.check(`(()=>{`+eng+`.querySelector('summary').click();return `+eng+`.open})()`, "open dropdown") |
| - p.check(eng+`.querySelector('[equipo-nav-task]').textContent==='Task list loses its scroll position after a refresh' && `+eng+`.querySelector('[equipo-spec-lines] li:last-child').textContent===`+jsString(last), "dropdown content") |
| - line := "go test ./internal/equipo -run Live" + fmt.Sprint(size.w) |
| + p.check(eng+`.dataset.state==='working' && !!`+eng+`.querySelector('[equipo-sparkle]') && /^\d+:\d\d$/.test(`+eng+`.querySelector('[equipo-clock]').textContent)`, "Engineering is not shown working with its mark and clock") |
| + p.check(eng+`.querySelector('[equipo-nav-task]').textContent==='Task list loses its scroll position after a refresh' && `+eng+`.querySelector('[equipo-spec-doing]').textContent===`+jsString(doing), "row content") |
| + line, plain := "go test ./internal/equipo -run Live", "Running the tests" |
| + if size.touch { |
| + line, plain = `/bin/bash -lc "go build ./cmd/equipo"`, "Building the project" |
| + } |
| a.activity("live-"+fmt.Sprint(size.w), wire.StepActivityReport{TaskID: g.running, StepID: g.runningStep.StepID, Attempt: 1, Kind: wire.ActivityRun, Subject: line}) |
| - last = "Running " + line |
| - p.wait(eng+`.open && `+eng+`.querySelector('[equipo-spec-lines] li:last-child').textContent===`+jsString(last), "the new activity line") |
| - p.check(eng+`.querySelectorAll('[equipo-spec-lines] li').length===3`, "the last three lines") |
| - p.stayed("dropdown") |
| + p.wait(eng+`.querySelector('[equipo-spec-doing]').textContent===`+jsString(plain), "the new activity line") |
| + doing = plain |
| + p.stayed("row") |
| if size.touch { |
| p.shot(fmt.Sprintf("ux1-index-open-%d", size.w)) |
| } |
| @@ -266,9 +267,11 @@ func TestBrowserInnerScreens(t *testing.T) { |
| } |
| // Under production's policy (no inline styles): avatars and |
| - // monograms carry their hue and the spread bars their widths. |
| + // monograms carry their hue and the spread bars their widths. The |
| + // one exception is the living mark's motes, which Stardust places |
| + // through the CSSOM (not markup; the policy allows it). |
| p.open("/projects") |
| - p.check(`(()=>{const h=e=>getComputedStyle(e).getPropertyValue('--h').trim();const av=document.querySelector('[equipo-av]'),mono=document.querySelector('[equipo-mono]'),bar=document.querySelector('[equipo-bar] i');return !!av&&h(av)!==''&&!!mono&&h(mono)!==''&&!!bar&&bar.getBoundingClientRect().width>0&&!document.querySelector('[style]')})()`, "a hue or a bar width is missing under the policy") |
| + p.check(`(()=>{const h=e=>getComputedStyle(e).getPropertyValue('--h').trim();const av=document.querySelector('[equipo-av]'),mono=document.querySelector('[equipo-mono]'),bar=document.querySelector('[equipo-bar] i');return !!av&&h(av)!==''&&!!mono&&h(mono)!==''&&!!bar&&bar.getBoundingClientRect().width>0&&!document.querySelector('[style]:not([equipo-sparkle] [data-mote])')})()`, "a hue or a bar width is missing under the policy") |
| // Timeline entries: one plain line each, the rest behind Details, |
| // closed by default; Details opens by keyboard and by click. |
diff --git a/internal/thintest/pages_test.go b/internal/thintest/pages_test.go| index f49f7f19..dc156dc2 100644 |
| --- a/internal/thintest/pages_test.go |
| +++ b/internal/thintest/pages_test.go |
| @@ -275,7 +275,7 @@ var hrefs = regexp.MustCompile(`href="([^"]*)"`) |
| func TestPagesRail(t *testing.T) { |
| r := newToolRig(t) |
| owner := r.inst.Cookie() |
| - allowed := regexp.MustCompile(`^/(conversation|conversation/settings|tasks|projects|people|work|tasks\?needs=you|tasks/tk[a-z0-9]+)$`) |
| + allowed := regexp.MustCompile(`^/(conversation|conversation/settings|tasks|projects|people|work|tasks\?needs=you|tasks/tk[a-z0-9]+|team/(engineering|review|checks))$`) |
| for _, path := range []string{"/conversation", "/tasks", "/projects", "/people", "/tasks?needs=you"} { |
| rail := railOf(t, r.get(owner, path, 200)) |
| for _, m := range hrefs.FindAllStringSubmatch(rail, -1) { |
| @@ -299,7 +299,7 @@ func TestPagesRail(t *testing.T) { |
| d := body.(*wire.DispatchCommand) |
| r.step("n-run", wire.StepReport{TaskID: id, StepID: d.StepID, Attempt: 1, State: wire.StepRunning, BaseSHA: strings.Repeat("1", 40)}) |
| rail = railOf(t, r.get(owner, "/nav/rail?key=tasks", 200)) |
| - for _, want := range []string{`data-specialist="engineering" data-state="working"`, `<a equipo-nav-task href="/tasks/` + id + `">Swipe back does nothing</a>`, `id="nav-tasks" href="/tasks" aria-current="page"`, `<small equipo-count data-count>1</small>`} { |
| + for _, want := range []string{`data-specialist="engineering" data-state="working"`, `<span equipo-nav-task>Swipe back does nothing</span>`, `id="nav-tasks" href="/tasks" aria-current="page"`, `<small equipo-count data-count>1</small>`} { |
| if !strings.Contains(rail, want) { |
| t.Fatalf("working sidebar lacks %q: %s", want, rail) |
| } |
diff --git a/internal/thintest/team_panel_browser_test.go b/internal/thintest/team_panel_browser_test.go| new file mode 100644 |
| index 00000000..858854a9 |
| --- /dev/null |
| +++ b/internal/thintest/team_panel_browser_test.go |
| @@ -0,0 +1,146 @@ |
| +//go:build browser |
| + |
| +package thintest |
| + |
| +import ( |
| + "context" |
| + "fmt" |
| + "os" |
| + "path/filepath" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| + "github.com/chromedp/cdproto/input" |
| + "github.com/chromedp/chromedp" |
| +) |
| + |
| +// view saves what the window shows (a drawer is fixed to it, so a full |
| +// page capture would stretch it) when EQUIPO_BROWSER_ARTIFACTS names a |
| +// directory. |
| +func (p *innerPage) view(name string) { |
| + p.t.Helper() |
| + dir := os.Getenv("EQUIPO_BROWSER_ARTIFACTS") |
| + if dir == "" { |
| + return |
| + } |
| + var buf []byte |
| + p.do(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| + var err error |
| + buf, err = chromedp.CaptureScreenshot()(ctx, target) |
| + return err |
| + })) |
| + if err := os.MkdirAll(dir, 0700); err != nil { |
| + p.t.Fatal(err) |
| + } |
| + if err := os.WriteFile(filepath.Join(dir, name+".png"), buf, 0600); err != nil { |
| + p.t.Fatal(err) |
| + } |
| +} |
| + |
| +// press clicks (or taps) the middle of what expression finds. |
| +func (p *innerPage) press(expression string) { |
| + p.t.Helper() |
| + box := eval[[]float64](p, `(()=>{const e=`+expression+`;e.scrollIntoView({block:'center'});const r=e.getBoundingClientRect();return [r.x+r.width/2,r.y+r.height/2]})()`) |
| + p.do(chromedp.MouseEvent(input.DispatchMouseEventTypeMousePressed, box[0], box[1], chromedp.ButtonLeft, chromedp.ClickCount(1)), chromedp.MouseEvent(input.DispatchMouseEventTypeMouseReleased, box[0], box[1], chromedp.ButtonLeft, chromedp.ClickCount(1))) |
| +} |
| + |
| +// TestBrowserTeamPanel: the sidebar's specialists at 1280 with a mouse |
| +// and at 390 with touch. Review at work is one row of two lines with the |
| +// living mark; a click on the row opens its drawer over the page (no |
| +// navigation) with the task, the activity in plain words, each command |
| +// behind a disclosure, the files touched and what it runs on, and it |
| +// follows new activity live. Engineering idle is one muted word; its |
| +// drawer shows its recent work and asks about the task it finished: the |
| +// question goes to its kept session and the answer arrives in place. |
| +func TestBrowserTeamPanel(t *testing.T) { |
| + g := newTeamGallery(t) |
| + a := g.a |
| + newest := "Looking over the changes" |
| + for _, size := range []struct { |
| + w, h int64 |
| + touch bool |
| + }{{1280, 900, false}, {390, 844, true}} { |
| + p := openInner(t, a.inst.URL, a.inst.Cookie(), size.w, size.h, size.touch, "light", "no-preference") |
| + rail := "/tasks" |
| + if size.touch { |
| + rail = "/work" |
| + } |
| + p.open(rail) |
| + rev := `document.querySelector('#rail [data-specialist="review"]')` |
| + eng := `document.querySelector('#rail [data-specialist="engineering"]')` |
| + // Compact: two lines, the title and what it is doing on the second. |
| + p.wait(rev+`.querySelector('[data-spec-star] [data-live]')`, "Review's living mark (Stardust)") |
| + p.check(`(()=>{const r=`+rev+`,n=r.querySelector('[equipo-spec-name]').getBoundingClientRect(),l=r.querySelector('[equipo-spec-now]').getBoundingClientRect(),t=r.querySelector('[equipo-nav-task]').getBoundingClientRect(),d=r.querySelector('[equipo-spec-doing]').getBoundingClientRect();const lh=parseFloat(getComputedStyle(r.querySelector('[equipo-spec-now]')).lineHeight);return l.top>=n.bottom-1 && Math.abs(t.top-d.top)<=2 && l.height<=lh+1 && r.getBoundingClientRect().height<=n.height+l.height+30})()`, "Review's row is not two lines") |
| + p.check(rev+`.querySelector('[equipo-spec-doing]').textContent===`+jsString(newest)+` && !`+rev+`.textContent.includes('/bin/') && !`+rev+`.textContent.includes('attempt')`, "Review's row content") |
| + p.check(eng+`.dataset.state==='idle' && `+eng+`.querySelector('[equipo-spec-state]').textContent==='idle' && !`+eng+`.querySelector('[equipo-spec-now]')`, "Engineering idle") |
| + p.check(`(()=>{const s=getComputedStyle(`+eng+`.querySelector('[equipo-spec-state]')),n=getComputedStyle(`+rev+`.querySelector('[equipo-spec-state]'));return s.color!==n.color})()`, "idle is not muted") |
| + p.view(fmt.Sprintf("team-panel-rail-%d", size.w)) |
| + |
| + // The drawer: a click on the row, no navigation. |
| + p.press(rev) |
| + drawer := `document.querySelector('dialog[equipo-drawer]')` |
| + p.wait(drawer+`?.open && `+drawer+`.querySelector('[equipo-team][data-team="review"]')`, "Review's drawer") |
| + p.wait(drawer+`.getAnimations().length===0`, "the drawer settled") |
| + p.stayed("drawer") |
| + p.check(`(()=>{const d=`+drawer+`.getBoundingClientRect();return d.right>=document.querySelector('main').getBoundingClientRect().right-1 && d.right<=innerWidth && d.height>=innerHeight-1 && (`+fmt.Sprint(size.touch)+` ? d.width>=innerWidth-1 : d.width<innerWidth/2)})()`, "the drawer is not at the window's edge") |
| + p.check(drawer+`.querySelector('[equipo-team-task]').textContent==='Swipe from the edge to go back on the Account pane' && `+drawer+`.querySelector('[equipo-team-task]').getAttribute('href')==='/tasks/`+g.review+`'`, "the task, linked") |
| + tl := drawer + `.querySelectorAll('[equipo-team-tl] > li')` |
| + p.check(`(()=>{const ls=[...`+tl+`].map(l=>l.querySelector('p > span').textContent);return ls.join('|').startsWith(`+jsString(newest)+`) && ls.join('|').endsWith('Looking over the changes|Searching for interactivePopGestureRecognizer|Reading AccountNavigationHost.swift|Reading NavigationStack.swift')})()`, "the timeline in plain words, newest first") |
| + p.check(`[...`+tl+`].every(l=>!l.querySelector('p').textContent.includes('/bin/') && !l.querySelector('[equipo-team-raw]').open)`, "raw shell outside a closed disclosure") |
| + p.check(`(()=>{const d=[...`+drawer+`.querySelectorAll('[equipo-team-raw]')].find(d=>d.textContent.includes('git diff'));d.querySelector('summary').click();return d.open && d.querySelector('code').textContent==='/bin/bash -lc "git diff 1111111...a91c3d0"' && d.querySelector('code').getBoundingClientRect().height>0})()`, "the disclosure") |
| + p.check(`[...`+drawer+`.querySelectorAll('[equipo-team-files] li')].map(l=>l.textContent).join('|')==='AccountNavigationHost.swift|NavigationStack.swift'`, "files touched") |
| + p.check(drawer+`.querySelector('[equipo-team-runs]').textContent.includes('Claude') && !`+drawer+`.querySelector('[data-team-ask]')`, "runs on, and no Ask box on a running step") |
| + p.check(`document.documentElement.scrollWidth<=innerWidth+1 && `+drawer+`.querySelector('[equipo-team]').scrollWidth<=`+drawer+`.querySelector('[equipo-team]').clientWidth+1`, "the drawer scrolls sideways") |
| + p.view(fmt.Sprintf("team-panel-review-%d", size.w)) |
| + // Live: a new line arrives, plain, at the top; the open disclosure stays open. |
| + live, plain := `/bin/bash -lc "xcodebuild test -scheme Woodstar -destination 'platform=iOS Simulator,name=iPhone 16'"`, "Running the tests" |
| + if size.touch { |
| + live, plain = `/bin/bash -lc "cd ios && swift build"`, "Building the project" |
| + } |
| + a.activity(fmt.Sprintf("tp-live-%d", size.w), wire.StepActivityReport{TaskID: g.review, StepID: g.reviewStep, Attempt: 1, Kind: wire.ActivityRun, Subject: live}) |
| + p.wait(drawer+`.querySelector('[equipo-team-tl] > li p > span').textContent===`+jsString(plain)+` && `+rev+`.querySelector('[equipo-spec-doing]').textContent===`+jsString(plain), "the live line in the drawer and the row") |
| + p.check(`[...`+drawer+`.querySelectorAll('[equipo-team-raw]')].some(d=>d.open && d.textContent.includes('git diff'))`, "the open disclosure closed on a live update") |
| + p.stayed("live drawer") |
| + newest = plain |
| + // Closing: Escape with a keyboard, the close button by touch; focus |
| + // returns to the row. |
| + if size.touch { |
| + p.press(drawer + `.querySelector('[data-team-close]')`) |
| + } else { |
| + p.do(chromedp.KeyEvent("\x1b")) |
| + } |
| + p.wait(`!`+drawer+`.open`, "the drawer closed") |
| + p.wait(`document.activeElement===`+rev, "focus back on the row") |
| + |
| + // Engineering idle: its recent work and an Ask box for the task it |
| + // finished, which goes to its kept session. |
| + p.press(eng) |
| + p.wait(drawer+`?.open && `+drawer+`.querySelector('[equipo-team][data-team="engineering"]') && `+drawer+`.getAnimations().length===0`, "Engineering's drawer") |
| + p.check(`[...`+drawer+`.querySelectorAll('[equipo-team-recent] a')].map(a=>a.textContent).slice(0,2).join('|')==='Swipe from the edge to go back on the Account pane|Task list loses its scroll position after a refresh'`, "recent work, newest first") |
| + form := drawer + `.querySelector('[data-team-ask]')` |
| + p.check(`!!`+form+` && `+form+`.getAttribute('action')==='/tasks/`+g.running+`/ask'`, "the Ask box") |
| + question := fmt.Sprintf("Why keep the anchor rather than the offset? (%d)", size.w) |
| + p.check(`(()=>{const t=`+form+`.querySelector('textarea');t.focus();t.value=`+jsString(question)+`;return true})()`, "type") |
| + p.press(form + `.querySelector('button[type=submit]')`) |
| + p.wait(`[...`+drawer+`.querySelectorAll('[equipo-team-qs] li')].length>0 || !`+form+`.querySelector('[data-ask-error]').hidden`, "the question posted") |
| + p.check(form+`.querySelector('[data-ask-error]').hidden`, "the question did not go through") |
| + _, body := a.expect(wire.FrameAsk) |
| + ask := body.(*wire.AskCommand) |
| + if ask.Specialist != wire.SpecialistEngineering || ask.TaskID != g.running || ask.Text != question { |
| + t.Fatalf("ask: %+v", ask) |
| + } |
| + p.wait(`[...`+drawer+`.querySelectorAll('[equipo-team-qs] li')].some(l=>l.textContent.includes(`+jsString(question)+`)) && `+form+`.querySelector('textarea').value===''`, "the question in the drawer") |
| + a.answer(fmt.Sprintf("tp-ans-%d", size.w), wire.AnswerReport{TaskID: g.running, QuestionID: ask.QuestionID, Attempt: ask.Attempt, State: wire.QuestionAnswered, Text: "The offset moves when rows above it change; the **anchor** row does not."}) |
| + p.wait(`[...`+drawer+`.querySelectorAll('[equipo-team-qs] li [equipo-markdown]')].some(m=>m.querySelector('strong')?.textContent==='anchor')`, "the answer in the drawer") |
| + p.stayed("ask") |
| + p.view(fmt.Sprintf("team-panel-engineering-%d", size.w)) |
| + p.stop() |
| + } |
| + |
| + // Without script the row is a link to the same panel as a page. |
| + p := openInner(t, a.inst.URL, a.inst.Cookie(), 1280, 900, false, "dark", "reduce") |
| + defer p.stop() |
| + p.open("/team/review") |
| + p.check(`!!document.querySelector('main [equipo-team][data-team="review"]') && document.querySelector('[data-team-close]').hidden`, "Review's page") |
| + p.shot("team-panel-page-1280-dark") |
| +} |
diff --git a/internal/thintest/team_panel_test.go b/internal/thintest/team_panel_test.go| new file mode 100644 |
| index 00000000..b9f9a38a |
| --- /dev/null |
| +++ b/internal/thintest/team_panel_test.go |
| @@ -0,0 +1,147 @@ |
| +package thintest |
| + |
| +import ( |
| + "regexp" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// teamGallery is the gallery with the team panel's two cases: Review at |
| +// work on a Woodstar task, its activity arriving as Codex sends it |
| +// (raw shell), and Engineering idle after finishing the Equipo task, |
| +// whose session the runner kept, so it can be asked. |
| +type teamGallery struct { |
| + *gallery |
| + review, reviewStep string |
| +} |
| + |
| +// teamRawLines are Review's activity as the runner reported it. |
| +var teamRawLines = []wire.StepActivityReport{ |
| + {Kind: wire.ActivityRun, Subject: `/bin/bash -lc "cat ios/Woodstar/NavigationStack.swift"`}, |
| + {Kind: wire.ActivityRun, Subject: `/bin/bash -c 'sed -n 1,80p ios/Woodstar/AccountNavigationHost.swift'`}, |
| + {Kind: wire.ActivityRun, Subject: `/bin/bash -lc "rg -n interactivePopGestureRecognizer ios"`}, |
| + {Kind: wire.ActivityRun, Subject: `/bin/bash -lc "git diff 1111111...a91c3d0"`}, |
| +} |
| + |
| +func newTeamGallery(t *testing.T) *teamGallery { |
| + t.Helper() |
| + g := &teamGallery{gallery: newGallery(t)} |
| + a := g.a |
| + sha := func(c string) string { return strings.Repeat(c, 40) } |
| + // Engineering finishes the Equipo task; its session is kept. |
| + cand := "a7c41e2" + sha("c")[7:] |
| + a.step("tp-eng-done", wire.StepReport{TaskID: g.running, StepID: g.runningStep.StepID, Attempt: 1, State: wire.StepDone, BaseSHA: sha("8"), CandidateSHA: cand, Pushed: true, Termination: true, Family: "claude", Account: "claude-a", Summary: "Keep the scroll position across a live swap.", Headline: "Kept the list's scroll position across a live swap.", Askable: true}) |
| + a.dispatched(wire.SpecialistChecks, sha("8"), cand, 0) |
| + // Review reads a Woodstar change, the way Paul saw it. |
| + wcand := "a91c3d0" + sha("d")[7:] |
| + g.review, _ = a.galleryPushed("tp-w", "oficina/sample", "Swipe from the edge to go back on the Account pane", "Swiping in from the left edge on the Account pane should go back.", sha("1"), wcand, "Let the stack's pop gesture run beside the pane's.", true) |
| + c := a.dispatched(wire.SpecialistChecks, sha("1"), wcand, 0) |
| + a.checks("tp-w-c", c, wire.ChecksCannotRun, nil, "needs_macos", "") |
| + rv := a.dispatched(wire.SpecialistReview, sha("1"), wcand, 0) |
| + g.reviewStep = rv.StepID |
| + a.step("tp-w-r-run", wire.StepReport{TaskID: g.review, StepID: rv.StepID, Attempt: 1, State: wire.StepRunning, BaseSHA: rv.BaseSHA, CandidateSHA: rv.CandidateSHA, Family: "claude", Account: "claude-a"}) |
| + for i, l := range teamRawLines { |
| + l.TaskID, l.StepID, l.Attempt = g.review, rv.StepID, 1 |
| + a.activity("tp-act-"+itoa(i), l) |
| + } |
| + a.wait("review activity", func(c *Conversation) bool { return len(c.StepActivity[rv.StepID]) == len(teamRawLines) }) |
| + return g |
| +} |
| + |
| +// TestPagesTeamPanel: the compact rows and each specialist's page (the |
| +// drawer's content), from the thin core alone. Review at work: one row |
| +// of two lines (no inner card, no stage or attempt chip, no raw shell); |
| +// its page has the task linked, the activity in plain words with each |
| +// command behind a disclosure, the files touched, what it runs on, and |
| +// no Ask box (a running step's session cannot be asked). Engineering |
| +// idle: the one word on its row; its page lists its recent work and asks |
| +// about the task it finished. |
| +func TestPagesTeamPanel(t *testing.T) { |
| + g := newTeamGallery(t) |
| + a := g.a |
| + owner := a.inst.Cookie() |
| + rail := railOf(t, a.get(owner, "/tasks", 200)) |
| + row := regexp.MustCompile(`(?s)<a equipo-spec id="nav-review".*?</a>`).FindString(rail) |
| + for _, want := range []string{`href="/team/review" data-team-open`, `data-state="working"`, "equipo-mark", "equipo-clock", `<span equipo-nav-task>Swipe from the edge to go back on the Account pane</span>`, `<span equipo-spec-doing>Looking over the changes</span>`} { |
| + if !strings.Contains(row, want) { |
| + t.Fatalf("Review row lacks %q: %s", want, row) |
| + } |
| + } |
| + for _, not := range []string{"attempt", "In review", "Woodstar", "/bin/bash", "git diff", "<details", "equipo-spec-panel"} { |
| + if strings.Contains(row, not) { |
| + t.Fatalf("Review row shows %q: %s", not, row) |
| + } |
| + } |
| + if n := strings.Count(row, "equipo-spec-now"); n != 1 { |
| + t.Fatalf("Review row has %d second lines", n) |
| + } |
| + eng := regexp.MustCompile(`(?s)<a equipo-spec id="nav-engineering".*?</a>`).FindString(rail) |
| + if !strings.Contains(eng, `data-state="idle"`) || !strings.Contains(eng, "<span equipo-spec-state>idle</span>") || strings.Contains(eng, "equipo-spec-now") || !strings.Contains(eng, `href="/team/engineering"`) { |
| + t.Fatalf("idle Engineering row: %s", eng) |
| + } |
| + |
| + review := a.get(owner, "/team/review", 200) |
| + for _, want := range []string{`<section equipo-team data-team="review" data-state="working"`, `<h1 id="team-title">Review</h1>`, `<a equipo-team-task href="/tasks/` + g.review + `">Swipe from the edge to go back on the Account pane</a>`, |
| + "Looking over the changes", "Searching for interactivePopGestureRecognizer", "Reading AccountNavigationHost.swift", "Reading NavigationStack.swift", |
| + `Command</summary><code>/bin/bash -lc "cat ios/Woodstar/NavigationStack.swift"</code></details>`, |
| + `<li title="ios/Woodstar/NavigationStack.swift">`, "<span>AccountNavigationHost.swift</span>", "Runs on", "<dd>Claude<span>" + Owner + "</span></dd>", "Known when the step ends", "Recent work", `data-team-close hidden`} { |
| + if !strings.Contains(review, want) { |
| + t.Fatalf("Review's page lacks %q:\n%s", want, review) |
| + } |
| + } |
| + // Newest first, and raw shell only inside the disclosures. |
| + if strings.Index(review, "Looking over the changes") > strings.Index(review, "Reading NavigationStack.swift") { |
| + t.Fatal("activity not newest first") |
| + } |
| + outside := regexp.MustCompile(`(?s)<details equipo-team-raw>.*?</details>`).ReplaceAllString(review, "") |
| + for _, raw := range []string{"/bin/bash", "sed -n", "rg -n", "git diff"} { |
| + if strings.Contains(outside, raw) { |
| + t.Fatalf("raw shell %q outside the disclosure", raw) |
| + } |
| + } |
| + if strings.Contains(review, "data-team-ask") { |
| + t.Fatal("an Ask box on a running step, which cannot be asked") |
| + } |
| + |
| + engineering := a.get(owner, "/team/engineering", 200) |
| + for _, want := range []string{`data-team="engineering" data-state="idle"`, "Recent work", `<a href="/tasks/` + g.running + `">Task list loses its scroll position after a refresh</a>`, "<p>Kept the list's scroll position across a live swap.</p>", |
| + `<h2>Ask Engineering</h2>`, `About <a href="/tasks/` + g.running + `">`, `action="/tasks/` + g.running + `/ask"`, `name="specialist" value="engineering"`, "Ask Engineering about this work"} { |
| + if !strings.Contains(engineering, want) { |
| + t.Fatalf("Engineering's page lacks %q:\n%s", want, engineering) |
| + } |
| + } |
| + if strings.Contains(engineering, "equipo-team-now") || strings.Contains(engineering, "answers once this step ends") { |
| + t.Fatal("idle Engineering shown at work") |
| + } |
| + // Checks never answer questions. |
| + if p := a.get(owner, "/team/checks", 200); strings.Contains(p, "data-team-ask") { |
| + t.Fatal("an Ask box for Checks") |
| + } |
| + a.get(owner, "/team/product", 404) |
| +} |
| + |
| +// TestPagesTeamPanelAskWaits: a running specialist is asked only through |
| +// a session the runner kept, an earlier round's; the drawer says the |
| +// answer comes once this round ends. |
| +func TestPagesTeamPanelAskWaits(t *testing.T) { |
| + r := newToolRig(t) |
| + base, cand, cand2 := strings.Repeat("1", 40), strings.Repeat("2", 40), strings.Repeat("3", 40) |
| + id, _ := r.pushed("w", "Fix the README typo", base, cand) |
| + r.checks("w-c1", r.dispatched(wire.SpecialistChecks, base, cand, 0), wire.ChecksPassed, exit(0), "", "ok") |
| + rv1 := r.dispatched(wire.SpecialistReview, base, cand, 0) |
| + r.step("w-r1", wire.StepReport{TaskID: id, StepID: rv1.StepID, Attempt: 1, State: wire.StepDone, BaseSHA: base, CandidateSHA: cand, Termination: true, Family: "claude", Account: "claude-b", Verdict: wire.VerdictChanges, ReviewLabel: wire.ReviewSameFamily, Findings: []wire.Finding{{Text: "The second typo is still there.", Path: "README.md", Line: 7}}, Askable: true}) |
| + fix := r.dispatched(wire.SpecialistEngineering, cand, "", 1) |
| + r.step("w-f-run", wire.StepReport{TaskID: id, StepID: fix.StepID, Attempt: 1, State: wire.StepRunning, BaseSHA: cand}) |
| + r.step("w-f-done", wire.StepReport{TaskID: id, StepID: fix.StepID, Attempt: 1, State: wire.StepDone, BaseSHA: cand, CandidateSHA: cand2, Pushed: true, Termination: true}) |
| + r.checks("w-c2", r.dispatched(wire.SpecialistChecks, base, cand2, 1), wire.ChecksPassed, exit(0), "", "ok") |
| + rv2 := r.dispatched(wire.SpecialistReview, base, cand2, 1) |
| + r.step("w-r2-run", wire.StepReport{TaskID: id, StepID: rv2.StepID, Attempt: 1, State: wire.StepRunning, BaseSHA: base, CandidateSHA: cand2}) |
| + page := r.get(r.inst.Cookie(), "/team/review", 200) |
| + for _, want := range []string{`data-state="working"`, "<h2>Ask Review</h2>", `action="/tasks/` + id + `/ask"`, `name="specialist" value="review"`, "Review answers once this step ends, from its last finished round."} { |
| + if !strings.Contains(page, want) { |
| + t.Fatalf("Review's page lacks %q:\n%s", want, page) |
| + } |
| + } |
| +} |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index 6ffd5b80..bfff6ac2 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -10967,5 +10967,54 @@ |
| "match": "equipo-runner", |
| "count": 1, |
| "reason": "Progress log: names the retained runner executable and its release directory." |
| + }, |
| + { |
| + "path": "internal/equipo/activity/activity.go", |
| + "line_sha256": "8eda00bec4c72a007aeb9d9045c4dcab2c8a5968c5ed22d2923e3971cefa6410", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Team panel activity wording: recognises a specialist's npm or node command to describe it in plain words; not a runner dependency." |
| + }, |
| + { |
| + "path": "internal/equipo/activity/activity.go", |
| + "line_sha256": "29cff920523ef55175c76b5b8e429d3abc778249838a90af047e62c61b1f6199", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Team panel activity wording: recognises a specialist's npm or node command to describe it in plain words; not a runner dependency." |
| + }, |
| + { |
| + "path": "internal/equipo/team_activity_test.go", |
| + "line_sha256": "a6b6be2a6d81c263ea49cd899901fba0e73b574af5d1205fbdaa85d7ef59382a", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Team panel activity wording: recognises a specialist's npm or node command to describe it in plain words; not a runner dependency." |
| + }, |
| + { |
| + "path": "internal/equipo/team_activity_test.go", |
| + "line_sha256": "bede6ad7e44861b3c7e96b78cca3db668cac8caff5fb49d665094def7fa6e481", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Team panel activity wording: recognises a specialist's npm or node command to describe it in plain words; not a runner dependency." |
| + }, |
| + { |
| + "path": "internal/equipo/team_activity_test.go", |
| + "line_sha256": "b8bc0c436bb5902c22b2c7b773acc4b27743ab6cdc9d7a872a06be8746ec736a", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Team panel activity wording: recognises a specialist's npm or node command to describe it in plain words; not a runner dependency." |
| + }, |
| + { |
| + "path": "internal/equipo/team_activity_test.go", |
| + "line_sha256": "c47a2a7dbf56f705b022fe2a405297e4db7762bf0f1a108f0c8c24a2328389ba", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Team panel activity wording: recognises a specialist's npm or node command to describe it in plain words; not a runner dependency." |
| + }, |
| + { |
| + "path": "internal/equipo/team_activity_test.go", |
| + "line_sha256": "453361ab86aa152300073fe1f23352e3681abe48e47147a907ec46b4d7fed536", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Team panel activity wording: recognises a specialist's npm or node command to describe it in plain words; not a runner dependency." |
| } |
| ] |