Merge branch 'tasks-redesign' into main
Merge tasks-redesign: the Tasks screens redesigned The task list and task page redesign: statuses no longer truncate and the actions fit at every width. Screenshots reviewed by the coordinator. Hosted CI passed on 4edbf0a.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 files changed,
+588
−70
.rastrillo/budgets.txt+2 −2docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+12 −0internal/equipo/copy.go+17 −0internal/equipo/icons/icons.go+7 −0internal/equipo/static/equipo.css+105 −16internal/equipo/templates/work_needs.html+1 −1internal/equipo/templates/work_parts.html+20 −13internal/equipo/templates/work_project.html+1 −1internal/equipo/templates/work_tasks.html+1 −1internal/equipo/work_pages.go+11 −0internal/equipo/work_views.go+94 −3internal/thintest/gallery_test.go+6 −6internal/thintest/inner_browser_test.go+4 −18internal/thintest/pages_test.go+2 −2internal/thintest/projects_browser_test.go+1 −6internal/thintest/projects_pages_test.go+1 −1internal/thintest/rows_browser_test.go+97 −0internal/thintest/rows_fixture_test.go+93 −0internal/thintest/rows_pages_test.go+113 −0
CI passed — run details
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 7ec5accd..adb0bc54 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 17869 - The instance web layer: pages, handlers, templates and copy for every screen. Measured 17869 source lines. |
| +size internal/equipo 17988 - The instance web layer: pages, handlers, templates and copy for every screen. Measured 17988 source lines. |
| 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); |
| time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). |
| @@ -62,5 +62,5 @@ 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 TestReleaseRunnerHasNoFakeWorker builds the release runner and the thin package under testbuild (about 12s locally). |
| size internal/headless - 9387 End-to-end scenarios through a real runner and instance, plus browser drives. Measured 9387 test lines. |
| -size internal/thintest - 16410 Thin v1 contract and page tests; one package keeps one instance harness. Measured 16410 test lines. |
| +size internal/thintest - 16694 Thin v1 contract and page tests; one package keeps one instance harness. Measured 16694 test lines. |
| perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}. |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index 8a32d969..735a48d3 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -6089,6 +6089,18 @@ records remain unchanged. |
| | `teams.forget_short` | Forget | Settings UX pass (Paul, 2026-11-11): Teams, the quiet action on a remembered row | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| | `teams.forgotten` | %s forgotten. | Settings UX pass (Paul, 2026-11-11): Teams, in the row's place before Undo; %s is the team's name | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| | `teams.undo` | Undo | Settings UX pass (Paul, 2026-11-11): Teams, after Forget | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| +| `work.col.project` | Project | Tasks rows redesign (2026-11-12): column name | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.col.task` | Task | Tasks rows redesign (2026-11-12): column name | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.col.status` | Status | Tasks rows redesign (2026-11-12): column name | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.col.from` | From | Tasks rows redesign (2026-11-12): column name | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.col.updated` | Updated | Tasks rows redesign (2026-11-12): column name | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.source.short` | Conversation, %s | Tasks rows redesign (2026-11-12): the From column's origin | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.row.retry_push` | Retry push | Tasks rows redesign (2026-11-12): a row's action when the push failed | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.row.round` | Another round | Tasks rows redesign (2026-11-12): a row's action after the fix rounds | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.row.what_next` | What next? | Tasks rows redesign (2026-11-12): an exploration's action | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.row.decide` | Decide | Tasks rows redesign (2026-11-12): a row's action that opens its decision | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.row.step` | Step %d of %d | Tasks rows redesign (2026-11-12): the stepper's label for screen readers | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| +| `work.done_more` | Show %d more | Tasks rows redesign (2026-11-12): Done's fold | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) | |
| | `chat.activity.star_project` | Starring a project… | Coordinator activity (projects-ux) | COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| | `chat.queued` | Waiting its turn | Conversation: the note under a message sent while a turn runs (thinking-stale hot fix) | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| | `chat.failed_many` | The coordinator could not answer these messages. | Conversation: the note when a turn that covered several messages fails (turn batching) | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 0dae3072..82d1ead4 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -164,6 +164,23 @@ var pageCopy = map[string]string{ |
| "teams.forgotten": "%s forgotten.", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
| "teams.undo": "Undo", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
| + // Tasks rows redesign (Paul approved the design, 2026-11-12): the |
| + // column names, the From column's short origin, each Needs you row's |
| + // one action, the stepper's words and Done's fold; accepted by |
| + // Astra's delegated copy pass. |
| + "work.col.project": "Project", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.col.task": "Task", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.col.status": "Status", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.col.from": "From", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.col.updated": "Updated", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.source.short": "Conversation, %s", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.row.retry_push": "Retry push", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.row.round": "Another round", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.row.what_next": "What next?", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.row.decide": "Decide", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.row.step": "Step %d of %d", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + "work.done_more": "Show %d more", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| + |
| // Machines in Settings (Paul, 2026-11-11), accepted by Astra's |
| // delegated copy pass. |
| "machines.lede": "The computers that do your work. A machine is online when its runner is connected to Equipo.", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
diff --git a/internal/equipo/icons/icons.go b/internal/equipo/icons/icons.go| index 06d4af0b..659b490b 100644 |
| --- a/internal/equipo/icons/icons.go |
| +++ b/internal/equipo/icons/icons.go |
| @@ -62,6 +62,13 @@ var icons = map[string]template.HTML{ |
| "copy": `<svg class="icon" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" viewBox="0 0 24 24"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`, |
| "x": `<svg class="icon" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`, |
| "x-circle": `<svg class="icon" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>`, |
| + // The Tasks rows' actions: 16px, 1.5px round strokes, drawn for the |
| + // redesign (retry, another round, what next, recover, decide). |
| + "rotate-cw": `<svg class="icon" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" viewBox="0 0 16 16"><path d="M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"/><path d="M14 2v3.33h-3.33"/></svg>`, |
| + "rotate-ccw": `<svg class="icon" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" viewBox="0 0 16 16"><path d="M2 8a6 6 0 1 0 6-6c-1.68 0-3.29.67-4.49 1.83L2 5.33"/><path d="M2 2v3.33h3.33"/></svg>`, |
| + "repeat": `<svg class="icon" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" viewBox="0 0 16 16"><path d="m11.33 1.33 2.67 2.67-2.67 2.67"/><path d="M2 7.33v-.66A2.67 2.67 0 0 1 4.67 4H14"/><path d="m4.67 14.67-2.67-2.67 2.67-2.67"/><path d="M14 8.67v.66A2.67 2.67 0 0 1 11.33 12H2"/></svg>`, |
| + "split": `<svg class="icon" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" viewBox="0 0 16 16"><path d="M2 8h3.5c2 0 2.5-4 5-4H14"/><path d="M5.5 8c2 0 2.5 4 5 4H14"/><path d="m12 2 2 2-2 2"/><path d="m12 10 2 2-2 2"/></svg>`, |
| + "arrow-right": `<svg class="icon" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" viewBox="0 0 16 16"><path d="M3 8h10"/><path d="m9 4 4 4-4 4"/></svg>`, |
| } |
| // Icon renders one icon by its Lucide slug. An unknown slug renders |
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css| index 52d5fc78..fe83692b 100644 |
| --- a/internal/equipo/static/equipo.css |
| +++ b/internal/equipo/static/equipo.css |
| @@ -430,14 +430,10 @@ html:has([equipo-conversation]) { overflow: hidden; scrollbar-gutter: auto; } |
| [equipo-row-body] > p, [equipo-row-side] > p { margin: 0; } |
| [equipo-row-title] { display: flex; align-items: baseline; gap: var(--rst-sp-2); min-inline-size: 0; margin: 0; } |
| [equipo-row-title] [equipo-row-link] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; } |
| -[equipo-row-meta] { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem var(--rst-sp-3); font-size: var(--rst-fs-xs); color: var(--rst-text-muted); min-inline-size: 0; margin: 0; } |
| [equipo-source] { color: var(--rst-text-muted); } |
| a[equipo-source] { text-decoration: none; } |
| a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; text-underline-offset: 2px; } |
| [equipo-row-side] { display: grid; justify-items: end; gap: .35rem; font-size: var(--rst-fs-xs); color: var(--rst-text-muted); white-space: nowrap; } |
| -[equipo-row-top] { display: inline-flex; align-items: center; gap: var(--rst-sp-2); min-block-size: 1.5rem; } |
| -[equipo-badges] { display: flex; gap: var(--rst-sp-1); } |
| -[equipo-badges]:empty { display: none; } |
| [equipo-ago] { font-variant-numeric: tabular-nums; } |
| [equipo-row][data-stage="done"] [equipo-row-link], [equipo-row][data-stage="cancelled"] [equipo-row-link] { color: var(--rst-text-muted); font-weight: 400; } |
| [equipo-row][data-stage="done"] [equipo-track], [equipo-row][data-stage="cancelled"] [equipo-track] { opacity: .6; } |
| @@ -455,7 +451,6 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-track] li[data-s="current"][data-tone="attention"]::after { background: var(--rst-tone-warning-fg); border-color: var(--rst-tone-warning-fg); box-shadow: 0 0 0 3px var(--rst-tone-warning-bg); } |
| [equipo-track] li[data-live]::after { display: none; } |
| [equipo-track] li[data-live] [equipo-mark] { font-size: 1rem; } |
| -[equipo-track-line] { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .2rem var(--rst-sp-2); min-inline-size: 0; } |
| [equipo-stage-name] { color: var(--rst-text); font-weight: 500; } |
| [equipo-stage-name][data-tone="negative"] { color: var(--rst-tone-negative-fg); } |
| [equipo-stage-name][data-tone="attention"] { color: var(--rst-tone-warning-fg); } |
| @@ -508,6 +503,111 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-dup] { display: flex; align-items: center; gap: var(--rst-sp-2); margin: 0; font-size: var(--rst-fs-xs); color: var(--rst-text-muted); } |
| [equipo-dup] .icon { inline-size: 1em; block-size: 1em; margin: 0; color: var(--rst-tone-warning-fg); } |
| [equipo-dup] a { color: var(--rst-text-muted); } |
| +/* Task rows: one grid for every row in every list, with the column |
| + names once above them. Project, task, status, from (who, then the |
| + conversation), updated, and the action slot: a Needs you row's one |
| + action, then the quiet menu, always last, so both sit in the same |
| + place on every row. The list is its own container, so the project |
| + page's narrower column restacks the same cells. */ |
| +[equipo-tasklist] { container: tasklist / inline-size; } |
| +[equipo-row][equipo-trow], [equipo-tcols] { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 1.2fr) 8rem 3.5rem 11.875rem; column-gap: .75rem; } |
| +[equipo-tcols] { padding: 0 1.0625rem .375rem; color: var(--rst-text-muted); font-size: var(--rst-fs-xs); } |
| +[equipo-tcols] > :nth-child(5) { text-align: end; } |
| +[equipo-row][equipo-trow] { align-items: start; padding: .6875rem 1rem; } |
| +[equipo-trow] :is([equipo-trow-proj], [equipo-act], a[equipo-source]) { position: relative; z-index: 1; } |
| +[equipo-trow-proj] { display: flex; align-items: center; gap: .5rem; min-inline-size: 0; color: var(--rst-text); font-size: var(--rst-fs-sm); text-decoration: none; } |
| +[equipo-trow-proj] > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| +[equipo-trow-proj]:hover > span { text-decoration: underline; text-underline-offset: 2px; } |
| +[equipo-trow-task], [equipo-trow-status] { min-inline-size: 0; } |
| +[equipo-trow] [equipo-row-title] { display: block; } |
| +[equipo-trow] [equipo-row-title] [equipo-row-link] { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; white-space: normal; overflow-wrap: anywhere; font-weight: 600; line-height: 1.35; } |
| +[equipo-trow] [equipo-row-link]:hover { text-decoration: underline; text-underline-offset: 2px; } |
| +[equipo-trow]:is([data-stage="done"], [data-stage="cancelled"]) [equipo-row-title] [equipo-row-link] { font-weight: 400; color: var(--rst-text-muted); } |
| +[equipo-trow] [equipo-dup] { display: block; margin-block-start: .1875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| +[equipo-trow] [equipo-dup] a { position: relative; z-index: 1; } |
| +/* Status: one phrase, coloured only when someone must act; below it the |
| + stepper and the rest in plain words, one line that truncates. */ |
| +[equipo-trow] [equipo-stage-name] { margin: 0; font-size: .8125rem; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; } |
| +[equipo-trow] [equipo-stage-name]:is([data-tone="negative"], [data-tone="attention"]) { font-weight: 600; } |
| +[equipo-trow-detail] { display: flex; align-items: center; gap: .5rem; min-inline-size: 0; margin: .1875rem 0 0; color: var(--rst-text-muted); font-size: var(--rst-fs-xs); } |
| +[equipo-trow-note] { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| +[equipo-trow-note] [equipo-chip] { display: inline; } |
| +[equipo-trow-note] [equipo-chip] > .icon { display: none; } |
| +[equipo-trow-note] [equipo-chip] [equipo-mark] { margin-inline-end: .25em; } |
| +[equipo-trow-note] [equipo-clock] { margin-inline-start: .3em; } |
| +[equipo-trow-note] [equipo-badge2] { display: inline; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; } |
| +[equipo-trow-note] [equipo-badge2] [equipo-mark] { margin-inline-end: .25em; color: var(--rst-accent); } |
| +/* The stepper: six small dots, the current one larger and toned. */ |
| +[equipo-trow] [equipo-track] li { inline-size: .4375rem; block-size: .4375rem; } |
| +[equipo-trow] [equipo-track] li + li { margin-inline-start: .1875rem; } |
| +[equipo-trow] [equipo-track] li + li::before { display: none; } |
| +[equipo-trow] [equipo-track] li::after { inline-size: .3125rem; block-size: .3125rem; } |
| +[equipo-trow] [equipo-track] li[data-s="current"]::after { inline-size: .4375rem; block-size: .4375rem; box-shadow: none; } |
| +[equipo-trow] [equipo-track] li[data-live] { margin-inline: .25rem; } |
| +[equipo-trow] [equipo-track] li[data-live] [equipo-mark] { font-size: .875rem; } |
| +/* From: who, then the conversation it came from. */ |
| +[equipo-trow-from] { display: grid; gap: .125rem; min-inline-size: 0; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| +[equipo-trow-from] > * { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| +[equipo-trow-from] [equipo-who] { display: flex; } |
| +[equipo-trow-from] [equipo-who] > span:last-child { overflow: hidden; text-overflow: ellipsis; } |
| +[equipo-trow-from] [data-long] { display: none; } |
| +[equipo-trow] > [equipo-ago] { padding-block-start: .0625rem; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); text-align: end; } |
| +/* The action slot: every action the same size, quiet at rest (a soft |
| + accent tint), solid on hover and keyboard focus. The width fits the |
| + longest label (Another round, about 103px in the fallback sans) with |
| + room to spare; a label never truncates. */ |
| +[equipo-trow-act] { display: flex; justify-content: flex-end; gap: .375rem; } |
| +[equipo-trow-act] form { margin: 0; display: contents; } |
| +[equipo-act] { box-sizing: border-box; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .375rem; inline-size: 9.75rem; block-size: 1.75rem; padding: 0 .5rem; border: 1px solid color-mix(in srgb, var(--rst-accent) 20%, var(--rst-accent-soft)); border-radius: var(--rst-radius); background: var(--rst-accent-soft); color: var(--rst-accent); font: 600 var(--rst-fs-sm)/1 var(--rst-font, inherit); white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color .12s, border-color .12s, color .12s; } |
| +[equipo-act] .icon { flex: none; inline-size: 1rem; block-size: 1rem; margin: 0; } |
| +[equipo-act] > span { overflow: hidden; text-overflow: ellipsis; } |
| +[equipo-act]:hover, [equipo-act]:focus-visible { background: var(--rst-accent-fill); border-color: var(--rst-accent-fill); color: var(--rst-on-accent-fill, #fff); } |
| +[equipo-act]:focus-visible { outline: 2px solid var(--rst-focus-edge); outline-offset: 2px; } |
| +[equipo-trow] [equipo-menu] { opacity: 1; } |
| +[equipo-trow] [equipo-menu] > summary { box-sizing: border-box; inline-size: 1.75rem; block-size: 1.75rem; border: 1px solid var(--rst-line); border-radius: var(--rst-radius); color: var(--rst-text-muted); transition: background-color .12s, border-color .12s, color .12s; } |
| +[equipo-trow] [equipo-menu] > summary:hover, [equipo-trow] [equipo-menu] > summary:focus-visible, [equipo-trow] [equipo-menu][open] > summary { background: var(--rst-accent-soft); border-color: color-mix(in srgb, var(--rst-accent) 20%, var(--rst-accent-soft)); color: var(--rst-accent); } |
| +[equipo-trow] [equipo-menu] > summary:focus-visible { outline: 2px solid var(--rst-focus-edge); outline-offset: 2px; } |
| +[equipo-menu] [equipo-ask-about] { display: block; padding: .35rem .6rem; border-radius: var(--rst-radius-sm); color: var(--rst-text); text-decoration: none; } |
| +[equipo-menu] [equipo-ask-about]:hover, [equipo-menu] [equipo-ask-about]:focus-visible { background: var(--rst-tint-hover); } |
| +/* Done is muted; the rest of it waits behind "Show N more". */ |
| +[equipo-group][data-group="done"] [equipo-trow-proj] { color: var(--rst-text-muted); } |
| +[equipo-trow] [equipo-stage-name][data-tone="positive"] { color: var(--rst-text); } |
| +[equipo-trow-more] { display: block; padding: .5625rem 1rem; border-block-start: 1px solid var(--rst-line); border-end-start-radius: inherit; border-end-end-radius: inherit; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); text-decoration: none; } |
| +[equipo-trow-more]:hover, [equipo-trow-more]:focus-visible { color: var(--rst-text); background: var(--rst-tint-hover); } |
| +[equipo-rows] > li:has(> [equipo-trow-more]) { border-end-start-radius: calc(2 * var(--rst-radius)); border-end-end-radius: calc(2 * var(--rst-radius)); } |
| +/* A project's own page names the project: no project column. */ |
| +[equipo-tasklist][data-scope="project"] :is([equipo-row][equipo-trow], [equipo-tcols]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 8rem 3.5rem 11.875rem; } |
| +[equipo-tasklist][data-scope="project"] :is([equipo-trow-proj], [equipo-tcols] > :first-child) { display: none; } |
| +/* Narrower lists: the same cells in fixed slots, stacked: project and |
| + age, the title, the status, who and where from, then the action. The |
| + column names go, so From says "From your conversation" again. */ |
| +@container tasklist (max-width: 760px) { |
| + [equipo-tcols] { display: none; } |
| + /* One column; the slots that share a line share a grid area, one at |
| + each end, so no cell can widen the row. */ |
| + [equipo-row][equipo-trow], [equipo-tasklist][data-scope="project"] [equipo-row][equipo-trow] { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "task" "status" "foot"; row-gap: .375rem; padding: .75rem; } |
| + [equipo-trow-proj] { grid-area: top; justify-self: start; max-inline-size: calc(100% - 6.5rem); } |
| + [equipo-trow] > [equipo-ago] { grid-area: top; justify-self: end; } |
| + [equipo-trow-task] { grid-area: task; } |
| + [equipo-tasklist][data-scope="project"] [equipo-trow-task] { grid-area: top; padding-inline-end: 6.5rem; } |
| + [equipo-tasklist][data-scope="project"] [equipo-row][equipo-trow] { grid-template-areas: "top" "status" "foot"; } |
| + [equipo-trow-status] { grid-area: status; } |
| + [equipo-trow-from] { grid-area: foot; justify-self: start; align-self: center; display: flex; align-items: center; gap: .5rem; max-inline-size: calc(100% - 12.5rem); } |
| + [equipo-trow]:not(:has([equipo-act])) [equipo-trow-from] { max-inline-size: calc(100% - 2.5rem); } |
| + [equipo-trow-from] [equipo-who] { flex: none; } |
| + [equipo-trow-from] [data-long] { display: inline; } |
| + [equipo-trow-from] [data-short] { display: none; } |
| + [equipo-trow-act] { grid-area: foot; justify-self: end; align-self: center; } |
| +} |
| +@container tasklist (max-width: 520px) { |
| + [equipo-trow] [equipo-row-title] [equipo-row-link] { font-size: .9375rem; } |
| + [equipo-row][equipo-trow]:has([equipo-act]) { grid-template-areas: "top" "task" "status" "foot" "act"; } |
| + [equipo-tasklist][data-scope="project"] [equipo-row][equipo-trow]:has([equipo-act]) { grid-template-areas: "top" "status" "foot" "act"; } |
| + [equipo-trow]:has([equipo-act]) [equipo-trow-from] { max-inline-size: 100%; } |
| + [equipo-trow]:has([equipo-act]) [equipo-trow-act] { grid-area: act; justify-self: stretch; margin-block-start: .25rem; } |
| + [equipo-trow-act] [equipo-act] { flex: 1 1 auto; inline-size: auto; block-size: 2.5rem; gap: .5rem; font-size: var(--rst-fs-base); } |
| + [equipo-trow]:has([equipo-act]) [equipo-menu] > summary { inline-size: 2.5rem; block-size: 2.5rem; } |
| +} |
| [equipo-quiet] { color: var(--rst-text-muted); font-size: var(--rst-fs-xs); } |
| [equipo-quiet] a { color: inherit; } |
| [equipo-empty] { color: var(--rst-text-muted); margin: 0; } |
| @@ -546,14 +646,6 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-d-actions] [equipo-link]:hover { color: var(--rst-text); } |
| /* Quiet, beside the decision and not one: set up a Mac, ask about it. */ |
| [equipo-d-quiet] { display: inline-flex; flex-wrap: wrap; gap: var(--rst-sp-1) var(--rst-sp-4); margin-inline-start: auto; } |
| -/* A task row's quiet "Ask about this": on the row's hover or focus with |
| - a mouse, always on touch. */ |
| -[equipo-ask-about] { position: relative; z-index: 1; color: var(--rst-text-muted); text-decoration: none; } |
| -[equipo-ask-about]:hover, [equipo-ask-about]:focus-visible { color: var(--rst-text); text-decoration: underline; text-underline-offset: 2px; } |
| -@media (hover: hover) { |
| - [equipo-row] [equipo-ask-about] { opacity: 0; transition: opacity .15s; } |
| - [equipo-row]:hover [equipo-ask-about], [equipo-row]:focus-within [equipo-ask-about] { opacity: 1; } |
| -} |
| /* The task page. */ |
| [equipo-crumbs] { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem var(--rst-sp-2); margin: 0; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| [equipo-crumbs] a { color: var(--rst-text-muted); text-decoration: none; } |
| @@ -736,10 +828,7 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| @container work (max-width: 600px) { |
| [equipo-row] { grid-template-columns: auto minmax(0, 1fr); row-gap: .4rem; } |
| [equipo-row-side] { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; justify-items: start; align-items: center; } |
| - [equipo-row-top] { justify-self: end; grid-column: 2; grid-row: 1; } |
| - [equipo-badges] { grid-column: 1; grid-row: 1; flex-wrap: wrap; } |
| [equipo-row-title] [equipo-row-link] { white-space: normal; } |
| - [equipo-row-meta] { row-gap: .4rem; } |
| [equipo-track-full] li > span:not([equipo-dot]) { font-size: 0; } |
| [equipo-track-full] li[data-s="current"] > span:not([equipo-dot]) { font-size: var(--rst-fs-xs); } |
| [equipo-track-full] li > small { display: none; } |
diff --git a/internal/equipo/templates/work_needs.html b/internal/equipo/templates/work_needs.html| index 6cebe658..03a49b47 100644 |
| --- a/internal/equipo/templates/work_needs.html |
| +++ b/internal/equipo/templates/work_needs.html |
| @@ -3,6 +3,6 @@ |
| <section equipo-work equipo-inner data-work-live data-work-region id="work-needs"> |
| {{with .Thin}}<div equipo-page-head><h1>{{copy "nav.needs-you"}}</h1><p>{{if eq (len .Decisions) 0}}{{copy "work.needs_empty"}}{{else if eq (len .Decisions) 1}}{{copy "work.needs.one"}}{{else}}{{printf (copy "work.needs.many") (len .Decisions)}}{{end}}</p></div> |
| {{range .Decisions}}{{template "decision" (dict "Task" . "Head" true "From" "needs")}}{{end}} |
| -{{if .Others}}<section equipo-group data-group="others"><h2>{{copy "work.group.others"}} <span equipo-n>{{len .Others}}</span><span equipo-hint>{{copy "work.group.others_hint"}}</span></h2><ol equipo-rows data-thin-tasks>{{range .Others}}{{template "task-row" .}}{{end}}</ol></section>{{end}}{{end}} |
| +{{with .Groups}}{{template "work-groups" (dict "Groups" . "From" "needs")}}{{end}}{{end}} |
| </section> |
| {{end}} |
diff --git a/internal/equipo/templates/work_parts.html b/internal/equipo/templates/work_parts.html| index 392823da..576682f3 100644 |
| --- a/internal/equipo/templates/work_parts.html |
| +++ b/internal/equipo/templates/work_parts.html |
| @@ -10,23 +10,30 @@ |
| {{define "mono"}}<span equipo-mono data-h="{{.Hue}}" title="{{.Title}}" aria-hidden="true">{{.Letter}}</span>{{end}} |
| {{define "mono-l"}}<span equipo-mono data-size="l" data-h="{{.Hue}}" title="{{.Title}}" aria-hidden="true">{{.Letter}}</span>{{end}} |
| {{define "mono-s"}}<span equipo-mono data-size="s" data-h="{{.Hue}}" aria-hidden="true">{{.Letter}}</span>{{end}} |
| -{{define "track"}}<ol equipo-track aria-hidden="true">{{range .Track}}<li data-s="{{.State}}"{{if .Tone}} data-tone="{{.Tone}}"{{end}}{{if .Live}} data-live{{end}} title="{{.Label}}">{{if .Live}}{{template "mark" "s"}}{{end}}</li>{{end}}</ol>{{end}} |
| +{{define "track"}}<ol equipo-track role="img" aria-label="{{.StepLabel}}">{{range .Track}}<li data-s="{{.State}}"{{if .Tone}} data-tone="{{.Tone}}"{{end}}{{if .Live}} data-live{{end}} title="{{.Label}}">{{if .Live}}{{template "mark" "s"}}{{end}}</li>{{end}}</ol>{{end}} |
| {{define "track-full"}}<ol equipo-track-full data-track aria-label="{{.StageLine}}">{{range .Track}}<li data-s="{{.State}}"{{if .Tone}} data-tone="{{.Tone}}"{{end}}{{if .Live}} data-live{{end}}{{if eq .State "current"}} aria-current="step"{{end}}><span equipo-dot>{{if .Live}}{{template "mark" "s"}}{{end}}</span><span>{{.Label}}</span>{{with .At}}<small><time datetime="{{.Format "2006-01-02T15:04:05Z07:00"}}">{{.Format "15:04"}}</time></small>{{end}}</li>{{end}}</ol>{{end}} |
| {{define "badge"}}<span equipo-badge2 data-kind="{{.Kind}}" data-tone="{{.Tone}}" title="{{.Title}}">{{if .Live}}{{template "mark" "s"}}{{else if .Icon}}{{icon .Icon}}{{end}}<span>{{.Text}}</span></span>{{end}} |
| {{define "chip"}}{{with .Chip}}<span equipo-chip{{if .Live}} data-live{{end}}>{{if .Live}}{{template "mark" "s"}}{{else if .Icon}}{{icon .Icon}}{{end}}<span>{{.Text}}</span>{{with .Since}}{{template "elapsed" .}}{{end}}</span>{{end}}{{end}} |
| {{define "source"}}{{if .SourceHref}}<a href="{{.SourceHref}}" equipo-source>{{.Source}}</a>{{else}}<span equipo-source>{{.Source}}</span>{{end}}{{end}} |
| -{{define "task-menu"}}{{if .Menu}}{{$id := .ID}}<details equipo-menu><summary aria-label="{{copy "work.menu.more"}}">{{icon "kebab"}}</summary><div>{{range .Menu}}<form method="post" action="{{if eq .Action "duplicate"}}/tasks/{{$id}}/duplicate{{else}}/conversation/tasks/{{$id}}/{{.Action}}{{end}}"><input type="hidden" name="from" value="{{$.From}}">{{if .Value}}<input type="hidden" name="of" value="{{.Value}}">{{end}}<button type="submit"{{if .Danger}} data-danger{{end}} data-task-{{.Action}}>{{.Label}}{{with .Note}}<small>{{.}}</small>{{end}}</button></form>{{end}}</div></details>{{end}}{{end}} |
| -{{define "task-row"}}<li equipo-row data-task="{{.ID}}" data-stage="{{.Stage}}" data-group="{{.Group}}"> |
| -{{template "mono" .Mono}} |
| -<div equipo-row-body> |
| -<p equipo-row-title><a equipo-row-link href="/tasks/{{.ID}}">{{.Title}}</a></p> |
| -<div equipo-row-meta><span equipo-track-line>{{template "track" .}}<span equipo-stage-name{{if .Tone}} data-tone="{{.Tone}}"{{end}} data-stage-line>{{.StageLine}}</span></span>{{template "chip" .}}{{template "who" .Creator}}{{template "source" .}}</div> |
| -{{with .Dup}}<p equipo-dup>{{icon "alert-triangle"}}<span>{{copy "work.dup"}} <a href="/tasks/{{.ID}}">{{.Title}}</a>{{if not $.Mine}} {{printf (copy "work.dup_decides") $.Creator.Name}}{{end}}</span></p>{{end}} |
| -</div> |
| -<div equipo-row-side><span equipo-row-top><a equipo-ask-about href="/conversation?about={{.ID}}" data-ask-about>{{copy "work.ask_about"}}</a>{{template "task-menu" (dict "ID" .ID "Menu" .Menu "From" "tasks")}}<span equipo-ago{{agoData .Changed ""}} title="{{.Changed.Format "2006-01-02 15:04"}}">{{.Ago}}</span></span><span equipo-badges>{{range .Badges}}{{template "badge" .}}{{end}}</span></div> |
| -</li>{{end}} |
| -{{define "work-groups"}}{{range .}}<section equipo-group data-group="{{.Key}}"><h2>{{copy (printf "work.group.%s" .Key)}} <span equipo-n>{{len .Tasks}}</span>{{with copy (printf "work.group.%s_hint" .Key)}}<span equipo-hint>{{.}}</span>{{end}}</h2><ol equipo-rows data-thin-tasks>{{range .Tasks}}{{template "task-row" .}}{{end}}</ol></section>{{end}}{{end}} |
| -{{define "decision"}}{{$t := .Task}}{{with $t.Decision}}<div equipo-decision{{with .Tone}} data-tone="{{.}}"{{end}} data-need="{{.Need}}" data-decision="{{$t.ID}}"> |
| +{{define "task-menu"}}{{if or .Menu .Ask}}{{$id := .ID}}<details equipo-menu><summary aria-label="{{copy "work.menu.more"}}">{{if .Ask}}{{icon "more-horizontal"}}{{else}}{{icon "kebab"}}{{end}}</summary><div>{{if .Ask}}<a equipo-ask-about href="/conversation?about={{$id}}" data-ask-about>{{copy "work.ask_about"}}</a>{{end}}{{range .Menu}}<form method="post" action="{{if eq .Action "duplicate"}}/tasks/{{$id}}/duplicate{{else}}/conversation/tasks/{{$id}}/{{.Action}}{{end}}"><input type="hidden" name="from" value="{{$.From}}">{{if .Value}}<input type="hidden" name="of" value="{{.Value}}">{{end}}<button type="submit"{{if .Danger}} data-danger{{end}} data-task-{{.Action}}>{{.Label}}{{with .Note}}<small>{{.}}</small>{{end}}</button></form>{{end}}</div></details>{{end}}{{end}} |
| +{{/* A task row: one grid of project, task, status, from, updated and |
| + the action slot, the same in every list. The action slot holds a |
| + Needs you row's one action and, always last, the quiet menu, so both |
| + sit in the same place on every row. Called with T (the task) and |
| + From (where its forms return). */}} |
| +{{define "task-row"}}{{$from := .From}}{{with .T}}<li equipo-row equipo-trow data-task="{{.ID}}" data-stage="{{.Stage}}" data-group="{{.Group}}"> |
| +{{if .ProjectID}}<a equipo-trow-proj href="/projects/{{.ProjectID}}">{{template "mono-s" .Mono}}<span>{{.Project}}</span></a>{{else}}<span equipo-trow-proj>{{template "mono-s" .Mono}}<span>{{.Project}}</span></span>{{end}} |
| +<div equipo-trow-task><p equipo-row-title><a equipo-row-link href="/tasks/{{.ID}}">{{.Title}}</a></p>{{with .Dup}}<p equipo-dup><span>{{copy "work.dup"}} <a href="/tasks/{{.ID}}">{{.Title}}</a>{{if not $.T.Mine}} {{printf (copy "work.dup_decides") $.T.Creator.Name}}{{end}}</span></p>{{end}}</div> |
| +<div equipo-trow-status><p equipo-stage-name{{if .Tone}} data-tone="{{.Tone}}"{{end}} data-stage-line>{{.Say}}</p><div equipo-trow-detail>{{template "track" .}}<span equipo-trow-note title="{{.Note}}">{{template "chip" .}}{{if .Chip}}.{{end}}{{range .Badges}} <span equipo-badge2 data-kind="{{.Kind}}" data-tone="{{.Tone}}">{{if .Live}}{{template "mark" "s"}}{{end}}{{.Text}}.</span>{{end}}</span></div></div> |
| +<div equipo-trow-from>{{template "who" .Creator}}{{if .SourceHref}}<a equipo-source href="{{.SourceHref}}">{{else}}<span equipo-source>{{end}}<span data-long>{{.Source}}</span><span data-short>{{.SourceShort}}</span>{{if .SourceHref}}</a>{{else}}</span>{{end}}</div> |
| +<span equipo-ago{{agoData .Changed ""}} title="{{.Changed.Format "2006-01-02 15:04"}}">{{.Ago}}</span> |
| +<div equipo-trow-act>{{with .Act}}{{if .Href}}<a equipo-act href="{{.Href}}" data-act="{{.Kind}}">{{icon .Icon}}<span>{{.Label}}</span></a>{{else}}<form method="post" action="{{.Post}}"><input type="hidden" name="from" value="{{$from}}"><button equipo-act type="submit" data-act="{{.Kind}}" data-task-{{.Kind}}>{{icon .Icon}}<span>{{.Label}}</span></button></form>{{end}}{{end}}{{template "task-menu" (dict "ID" .ID "Menu" .Menu "From" $from "Ask" true)}}</div> |
| +</li>{{end}}{{end}} |
| +{{/* A list of task rows in its groups, with the column names once. |
| + Scope "project" drops the project column (the page names it). */}} |
| +{{define "work-groups"}}{{$from := .From}}<div equipo-tasklist{{with .Scope}} data-scope="{{.}}"{{end}}><div equipo-tcols aria-hidden="true"><span>{{copy "work.col.project"}}</span><span>{{copy "work.col.task"}}</span><span>{{copy "work.col.status"}}</span><span>{{copy "work.col.from"}}</span><span>{{copy "work.col.updated"}}</span></div> |
| +{{range .Groups}}<section equipo-group data-group="{{.Key}}"{{if eq .Key "done"}} id="done"{{end}}><h2>{{copy (printf "work.group.%s" .Key)}} <span equipo-n>{{.Count}}</span>{{with copy (printf "work.group.%s_hint" .Key)}}<span equipo-hint>{{.}}</span>{{end}}</h2><ol equipo-rows data-thin-tasks>{{range .Tasks}}{{template "task-row" (dict "T" . "From" $from)}}{{end}}{{if .More}}<li><a equipo-trow-more href="{{.MoreHref}}">{{printf (copy "work.done_more") .More}}</a></li>{{end}}</ol></section>{{end}}</div>{{end}} |
| +{{define "decision"}}{{$t := .Task}}{{with $t.Decision}}<div equipo-decision{{if eq $.From "task"}} id="decide"{{end}}{{with .Tone}} data-tone="{{.}}"{{end}} data-need="{{.Need}}" data-decision="{{$t.ID}}"> |
| {{if $.Head}}{{template "mono" $t.Mono}}<div equipo-d-title><a href="/tasks/{{$t.ID}}">{{$t.Title}}</a><span equipo-quiet>{{$t.Project}} · {{template "source" $t}}</span></div>{{end}} |
| <p equipo-d-why>{{.Why}}</p> |
| <p equipo-d-ask>{{.Ask}}</p>{{if .Link}}<p equipo-quiet data-direction-line>{{with .LinkText}}{{.}} {{end}}<a equipo-link href="{{.Link}}" rel="noopener noreferrer" target="_blank" data-direction-link>{{.LinkLabel}}</a>{{with .AltLink}} <a equipo-link href="{{.}}" rel="noopener noreferrer" target="_blank" data-direction-branch>{{$t.Decision.AltLabel}}</a>{{end}}</p>{{end}}{{with .Said}}<p equipo-quiet data-triage-said>{{.}}</p>{{end}}{{with .Failed}}<p equipo-quiet data-triage-failed>{{.}}</p>{{end}}{{with .Recommend}}<p equipo-quiet data-triage-recommend>{{.}}</p>{{end}} |
diff --git a/internal/equipo/templates/work_project.html b/internal/equipo/templates/work_project.html| index 0b7e9823..c595febb 100644 |
| --- a/internal/equipo/templates/work_project.html |
| +++ b/internal/equipo/templates/work_project.html |
| @@ -8,7 +8,7 @@ |
| {{if .People}}<div equipo-people><span equipo-avs>{{range .People}}{{template "av-l" .}}{{end}}</span><span>{{range $i, $p := .People}}{{if $i}}, {{end}}{{if $p.You}}{{copy "work.you"}}{{else}}{{$p.Name}}{{end}}{{end}}</span></div>{{end}} |
| </header> |
| <div equipo-p-cols> |
| -<section equipo-p-section><h2>{{copy "nav.tasks"}} {{with .Words}}<span equipo-quiet>{{.}}</span>{{end}}</h2>{{if $.Thin.Groups}}{{template "work-groups" $.Thin.Groups}}{{else}}<p equipo-empty data-empty-state="work.tasks_empty">{{copy "work.tasks_empty"}}</p>{{end}}</section> |
| +<section equipo-p-section><h2>{{copy "nav.tasks"}} {{with .Words}}<span equipo-quiet>{{.}}</span>{{end}}</h2>{{if $.Thin.Groups}}{{template "work-groups" (dict "Groups" $.Thin.Groups "From" "tasks" "Scope" "project")}}{{else}}<p equipo-empty data-empty-state="work.tasks_empty">{{copy "work.tasks_empty"}}</p>{{end}}</section> |
| <aside> |
| <section equipo-p-section><h2>{{copy "work.project.attachments"}}</h2><ul equipo-attach>{{range .Repos}}{{$r := .}}<li>{{icon "git"}}<div><p equipo-attach-name>{{.Name}}</p><p equipo-attach-sub>{{with .DefaultBranch}}<span>{{.}}</span>{{end}}{{with .HeadSubject}}<span>{{.}}</span>{{end}}{{with .HeadAt}}<span equipo-ago{{agoData . ""}}>{{$r.Ago}}</span>{{end}}</p></div>{{with .URL}}<span equipo-quiet><a href="{{.}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a></span>{{end}}</li>{{end}}</ul>{{with .ChecksLine}}<p equipo-quiet equipo-after>{{.}}</p>{{end}}</section> |
| {{if $.Thin.Activity}}<section equipo-p-section><h2>{{copy "work.project.recently"}}</h2><ol equipo-activity-list>{{range $.Thin.Activity}}<li><time equipo-ago{{agoData .At ""}} datetime="{{.At.Format "2006-01-02T15:04:05Z07:00"}}">{{.Ago}}</time><span>{{template "recent" .}}</span></li>{{end}}</ol></section>{{end}} |
diff --git a/internal/equipo/templates/work_tasks.html b/internal/equipo/templates/work_tasks.html| index 45ff75d2..6ee66a52 100644 |
| --- a/internal/equipo/templates/work_tasks.html |
| +++ b/internal/equipo/templates/work_tasks.html |
| @@ -6,6 +6,6 @@ |
| <details equipo-filter{{if .Filter.Project}} data-active{{end}}><summary>{{if .Filter.Project}}{{.Filter.ProjectTitle}}{{else}}{{copy "work.filter.all_projects"}}{{end}} {{icon "chevron-down"}}</summary><div><a href="/tasks{{with .Filter.Person}}?person={{.}}{{end}}"{{if not .Filter.Project}} aria-current="true"{{end}}>{{copy "work.filter.all_projects"}}</a>{{$f := .Filter}}{{range .Filter.Projects}}<a href="/tasks?project={{.ID}}{{with $f.Person}}&person={{.}}{{end}}"{{if eq .ID $f.Project}} aria-current="true"{{end}}>{{template "mono-s" .Mono}}{{.Title}}</a>{{end}}</div></details> |
| <details equipo-filter{{if .Filter.Person}} data-active{{end}}><summary>{{if .Filter.Person}}{{if eq .Filter.Person $.Address}}{{copy "work.filter.by_you"}}{{else}}{{printf (copy "work.filter.by") .Filter.Person1}}{{end}}{{else}}{{copy "work.filter.anyone"}}{{end}} {{icon "chevron-down"}}</summary><div><a href="/tasks{{with .Filter.Project}}?project={{.}}{{end}}"{{if not .Filter.Person}} aria-current="true"{{end}}>{{copy "work.filter.anyone"}}</a>{{range .Filter.People}}<a href="/tasks?person={{.Address}}{{with $f.Project}}&project={{.}}{{end}}"{{if eq .Address $f.Person}} aria-current="true"{{end}}>{{template "av" .}}{{if .You}}{{copy "work.you"}}{{else}}{{.Name}}{{end}}</a>{{end}}</div></details> |
| </div> |
| -{{if .Groups}}{{template "work-groups" .Groups}}{{else}}<p equipo-empty data-empty-state="work.tasks_empty">{{copy "work.tasks_empty"}}</p>{{end}}{{end}} |
| +{{if .Groups}}{{template "work-groups" (dict "Groups" .Groups "From" "tasks")}}{{else}}<p equipo-empty data-empty-state="work.tasks_empty">{{copy "work.tasks_empty"}}</p>{{end}}{{end}} |
| </section> |
| {{end}} |
diff --git a/internal/equipo/work_pages.go b/internal/equipo/work_pages.go| index b956ab8f..6185272f 100644 |
| --- a/internal/equipo/work_pages.go |
| +++ b/internal/equipo/work_pages.go |
| @@ -59,6 +59,12 @@ type taskLine struct { |
| Running, Stopped *wire.Step |
| // WaitsOther: a teammate's task waiting on their decision. |
| WaitsOther bool |
| + // The Tasks row's own words (rowOf): Say is the status, Note the |
| + // detail line whole (its tooltip), StepLabel the stepper in words, |
| + // SourceShort the From column's origin and Act a Needs you row's one |
| + // action. |
| + Say, Note, StepLabel, SourceShort string |
| + Act *rowAction |
| // Summary and Timeline are the task page's; Spend what the task used |
| // and StepSpend each step's part, for the specialist panel. |
| Summary string |
| @@ -436,6 +442,9 @@ func (a *application) workTasks(w http.ResponseWriter, r *http.Request) { |
| } |
| sortGroup(data.Thin.Decisions) |
| sortGroup(data.Thin.Others) |
| + if len(data.Thin.Others) > 0 { |
| + data.Thin.Groups = []taskGroup{{Key: "others", Tasks: data.Thin.Others}} |
| + } |
| render(w, "work_needs", data) |
| return |
| } |
| @@ -469,6 +478,7 @@ func (a *application) workTasks(w http.ResponseWriter, r *http.Request) { |
| } |
| data.Thin.Filter, data.Thin.ProjectCount = f, len(projects.Items) |
| data.Thin.Groups = groupTasks(data.Thin.Tasks) |
| + foldDone(data.Thin.Groups, r.URL) |
| render(w, "work_tasks", data) |
| } |
| @@ -633,6 +643,7 @@ func (a *application) workProject(w http.ResponseWriter, r *http.Request) bool { |
| } |
| } |
| data.Thin.Groups = groupTasks(data.Thin.Tasks) |
| + foldDone(data.Thin.Groups, r.URL) |
| data.Thin.Activity = projectActivity(data.Thin.Tasks, time.Now()) |
| notebook, err := a.store.Chat().Notebook(ctx, address) |
| if err != nil { |
diff --git a/internal/equipo/work_views.go b/internal/equipo/work_views.go| index 4e161225..1cf02702 100644 |
| --- a/internal/equipo/work_views.go |
| +++ b/internal/equipo/work_views.go |
| @@ -550,6 +550,71 @@ func (v *taskLine) richOf(t wire.Task, viewer string, card *wire.Card, now time. |
| if v.Group == "needs" { |
| v.Decision = decisionOf(t, *v) |
| } |
| + v.rowOf() |
| +} |
| + |
| +// rowAction is a Needs you row's one action: the decision's own answer |
| +// when it takes one tap (Post, the handler its card posts to), else a |
| +// link to the decision on the task page (Href). |
| +type rowAction struct { |
| + Kind, Label, Icon, Post, Href string |
| +} |
| + |
| +// rowOf adds what a Tasks row says beyond the task's own lines: the |
| +// status once (the Needs you heading already says "Needs you"), the |
| +// detail line whole, the stepper in words, the From column's origin and |
| +// the row's action, which then leaves the row's menu. |
| +func (v *taskLine) rowOf() { |
| + v.Say = v.StageLine |
| + if v.Group == "needs" { |
| + if rest, ok := strings.CutPrefix(v.Say, copyText("work.group.needs")+": "); ok { |
| + v.Say = sentenceCase(rest) |
| + } |
| + } |
| + var note []string |
| + if v.Chip != nil { |
| + note = append(note, v.Chip.Text+".") |
| + } |
| + for _, b := range v.Badges { |
| + note = append(note, b.Text+".") |
| + } |
| + v.Note = strings.Join(note, " ") |
| + for i, s := range v.Track { |
| + if s.State == "current" { |
| + v.StepLabel = fmt.Sprintf(copyText("work.row.step"), i+1, len(v.Track)) |
| + } |
| + } |
| + v.SourceShort = fmt.Sprintf(copyText("work.source.short"), v.SourceAt.Format("15:04")) |
| + v.Act = actionOf(v.ID, v.Decision, v.Stopped) |
| + if v.Act != nil { |
| + v.Menu = slices.DeleteFunc(v.Menu, func(m menuItem) bool { return m.Action == v.Act.Kind }) |
| + } |
| +} |
| + |
| +// actionOf maps a decision to the row's action, with the handlers its |
| +// card uses: Retry (Retry push when the push failed), Another round, |
| +// Recover; What next? opens an exploration's direction card, and any |
| +// other decision opens on the task page. |
| +func actionOf(id string, d *decisionView, stopped *wire.Step) *rowAction { |
| + if d == nil { |
| + return nil |
| + } |
| + post := "/conversation/tasks/" + id + "/" |
| + switch { |
| + case d.Need == wire.NeedsDirection: |
| + return &rowAction{Kind: "next", Label: copyText("work.row.what_next"), Icon: "split", Href: "/tasks/" + id + "#decide"} |
| + case d.Retry: |
| + label := copyText("work.retry") |
| + if stopped != nil && stopped.Reason == "push_failed" { |
| + label = copyText("work.row.retry_push") |
| + } |
| + return &rowAction{Kind: "retry", Label: label, Icon: "rotate-cw", Post: post + "retry"} |
| + case d.Round: |
| + return &rowAction{Kind: "round", Label: copyText("work.row.round"), Icon: "repeat", Post: post + "round"} |
| + case d.Recover: |
| + return &rowAction{Kind: "recover", Label: copyText("work.recover"), Icon: "rotate-ccw", Post: post + "recover"} |
| + } |
| + return &rowAction{Kind: "decide", Label: copyText("work.row.decide"), Icon: "arrow-right", Href: "/tasks/" + id + "#decide"} |
| } |
| // decisionOf is the one card for what the creator must decide. |
| @@ -1058,10 +1123,36 @@ func sortGroup(ts []taskLine) { |
| slices.SortStableFunc(ts, func(a, b taskLine) int { return b.Changed.Compare(a.Changed) }) |
| } |
| -// taskGroup is one titled group of task rows. |
| +// taskGroup is one titled group of task rows. More is how many Done |
| +// rows wait behind "Show N more", which MoreHref opens. |
| type taskGroup struct { |
| - Key string |
| - Tasks []taskLine |
| + Key string |
| + Tasks []taskLine |
| + More int |
| + MoreHref string |
| +} |
| + |
| +// Count is the group's tasks, shown or folded. |
| +func (g taskGroup) Count() int { return len(g.Tasks) + g.More } |
| + |
| +// doneShown is how many Done rows a list shows before "Show N more". |
| +const doneShown = 1 |
| + |
| +// foldDone keeps Done to its newest row and links the rest, at the same |
| +// path and filters with done=all, unless done=all asked for them. |
| +func foldDone(gs []taskGroup, u *url.URL) { |
| + q := u.Query() |
| + if q.Get("done") == "all" { |
| + return |
| + } |
| + q.Set("done", "all") |
| + for i := range gs { |
| + if gs[i].Key == "done" && len(gs[i].Tasks) > doneShown { |
| + gs[i].More = len(gs[i].Tasks) - doneShown |
| + gs[i].Tasks = gs[i].Tasks[:doneShown] |
| + gs[i].MoreHref = u.Path + "?" + q.Encode() + "#done" |
| + } |
| + } |
| } |
| func groupTasks(ts []taskLine) []taskGroup { |
diff --git a/internal/thintest/gallery_test.go b/internal/thintest/gallery_test.go| index c4a7637f..9089beec 100644 |
| --- a/internal/thintest/gallery_test.go |
| +++ b/internal/thintest/gallery_test.go |
| @@ -174,14 +174,14 @@ func TestPagesInnerScreens(t *testing.T) { |
| } |
| } |
| has(tasks, "Tasks", |
| - `<li equipo-row data-task="`+g.unchecked+`" data-stage="ready_to_merge" data-group="needs">`, |
| - `<li equipo-row data-task="`+g.stopped+`" data-stage="in_progress" data-group="needs">`, |
| - `<li equipo-row data-task="`+g.merging+`" data-stage="merging" data-group="ready">`, |
| - `<li equipo-row data-task="`+g.noras+`" data-stage="ready_to_merge" data-group="ready">`, |
| - `<li equipo-row data-task="`+g.nora+`" data-stage="done" data-group="done">`, |
| + `<li equipo-row equipo-trow data-task="`+g.unchecked+`" data-stage="ready_to_merge" data-group="needs">`, |
| + `<li equipo-row equipo-trow data-task="`+g.stopped+`" data-stage="in_progress" data-group="needs">`, |
| + `<li equipo-row equipo-trow data-task="`+g.merging+`" data-stage="merging" data-group="ready">`, |
| + `<li equipo-row equipo-trow data-task="`+g.noras+`" data-stage="ready_to_merge" data-group="ready">`, |
| + `<li equipo-row equipo-trow data-task="`+g.nora+`" data-stage="done" data-group="done">`, |
| "Possible duplicate of <a href=\"/tasks/"+g.unchecked+"\">Swipe back from the edge doesn't work</a>", |
| "Waiting for a Mac to run checks", "Engineering working", "Coordinator looking into it", "Merging into the default branch", |
| - "Checks: needs macOS", "Checks passed", "Approved", `title="Merged into main at c7d0a52"`, |
| + "Checks: needs macOS", "Checks passed", "Approved", ">Merged.</span>", |
| "From your conversation, ", "From Nora's conversation, ", |
| `<li data-s="current" data-tone="negative" title=`, `<li data-s="current" data-live title="In progress">`, |
| "7 tasks across 3 projects", "Anyone", "All projects") |
diff --git a/internal/thintest/inner_browser_test.go b/internal/thintest/inner_browser_test.go| index 1ad745df..85f63f66 100644 |
| --- a/internal/thintest/inner_browser_test.go |
| +++ b/internal/thintest/inner_browser_test.go |
| @@ -241,18 +241,8 @@ func TestBrowserInnerScreens(t *testing.T) { |
| p.open("/tasks") |
| p.check(`[...document.querySelectorAll('[equipo-group]')].map(e=>e.dataset.group).join()==='needs,progress,ready,done'`, "groups") |
| p.check(`getComputedStyle(`+row(g.noras)+`.querySelector('[equipo-row-link]'),'::after').cursor==='pointer'`, "row cursor") |
| - if size.touch { |
| - p.check(`getComputedStyle(`+row(g.stopped)+`.querySelector('[equipo-menu]')).opacity==='1'`, "⋯ hidden on touch") |
| - } else { |
| - // At rest, before any hover or focus, the ⋯ is hidden. Its |
| - // opacity eases (a .15 s transition), so the check waits for the |
| - // menu's transitions to end and only then reads it. |
| - menu := row(g.stopped) + `.querySelector('[equipo-menu]')` |
| - if why := eval[string](p, `(()=>{const m=`+menu+`;if(getComputedStyle(m).opacity==='0')return '';return JSON.stringify({opacity:getComputedStyle(m).opacity,moving:m.getAnimations().map(a=>[a.transitionProperty||a.animationName,a.playState,a.currentTime]),hover:[...document.querySelectorAll(':hover')].map(e=>e.tagName+[...e.attributes].map(x=>'['+x.name+']').join('')).slice(-2),within:m.closest('[equipo-row]').matches(':focus-within'),active:document.activeElement?.tagName,open:m.open})})()`); why != "" { |
| - t.Logf("⋯ not yet at rest on load: %s", why) |
| - } |
| - p.wait(menu+`.getAnimations().length===0 && getComputedStyle(`+menu+`).opacity==='0'`, "⋯ hidden before hover") |
| - } |
| + // The row's menu is always in its slot, last in the action column. |
| + p.check(`getComputedStyle(`+row(g.stopped)+`.querySelector('[equipo-menu]')).opacity==='1'`, "⋯ hidden") |
| box := eval[[]float64](p, `(()=>{`+row(g.noras)+`.scrollIntoView({block:'center'});const r=`+row(g.noras)+`.getBoundingClientRect();return [r.x+r.width*0.45,r.y+r.height-6]})()`) |
| 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))) |
| p.wait(`location.pathname==='/tasks/`+g.noras+`'`, "the row's click") |
| @@ -262,15 +252,11 @@ func TestBrowserInnerScreens(t *testing.T) { |
| p.open("/tasks") |
| p.check(`(()=>{const f=[...document.querySelectorAll('[equipo-filter] > summary')].pop();f.focus();return document.activeElement===f})()`, "focus filter") |
| p.do(chromedp.KeyEvent("\t")) |
| + p.check(`document.activeElement===document.querySelector('[equipo-group] [equipo-trow-proj]')`, "Tab did not reach the first row's project") |
| + p.do(chromedp.KeyEvent("\t")) |
| first := `document.querySelector('[equipo-group] [equipo-row-link]')` |
| p.check(`document.activeElement===`+first, "Tab did not reach the first row") |
| p.check(`getComputedStyle(`+first+`.closest('[equipo-row]')).boxShadow.includes('inset')`, "no focus ring on the row") |
| - if !size.touch { |
| - // Focus shows the row's quiet actions. |
| - p.check(`(()=>{`+row(g.stopped)+`.querySelector('[equipo-menu] > summary').focus();return true})()`, "focus ⋯") |
| - p.wait(`getComputedStyle(`+row(g.stopped)+`.querySelector('[equipo-menu]')).opacity==='1'`, "⋯ shown on focus") |
| - p.check(`(()=>{`+first+`.focus();return true})()`, "refocus") |
| - } |
| want := eval[string](p, first+`.getAttribute('href')`) |
| p.do(chromedp.KeyEvent("\r")) |
| p.wait(`location.pathname===`+jsString(want), "Enter on the row") |
diff --git a/internal/thintest/pages_test.go b/internal/thintest/pages_test.go| index a8f69443..c1c23977 100644 |
| --- a/internal/thintest/pages_test.go |
| +++ b/internal/thintest/pages_test.go |
| @@ -138,8 +138,8 @@ func TestPagesTasksAndProjects(t *testing.T) { |
| } |
| list := r.get(owner, "/tasks", 200) |
| // Rows: the whole row links the task; who filed it and from where; the |
| - // Done group; the quiet Merged badge says where it went. |
| - for _, want := range []string{`data-task="` + id + `"`, `equipo-row-link href="/tasks/` + id + `"`, `title="Woodstar"`, ">You</span>", "From your conversation, ", `data-group="done"`, `title="Merged into main at eeeeeee"`} { |
| + // Done group; the project by name; the detail line says Merged. |
| + for _, want := range []string{`data-task="` + id + `"`, `equipo-row-link href="/tasks/` + id + `"`, "<span>Woodstar</span></a>", ">You</span>", "From your conversation, ", `data-group="done"`, ">Merged.</span>"} { |
| if !strings.Contains(list, want) { |
| t.Fatalf("Tasks page lacks %q", want) |
| } |
diff --git a/internal/thintest/projects_browser_test.go b/internal/thintest/projects_browser_test.go| index 7e5432ff..6351418c 100644 |
| --- a/internal/thintest/projects_browser_test.go |
| +++ b/internal/thintest/projects_browser_test.go |
| @@ -47,12 +47,7 @@ func TestBrowserProjectsList(t *testing.T) { |
| p.fits("tasks") |
| p.check(`[...document.querySelectorAll('[equipo-row] [equipo-chip]')].every(c=>c.getBoundingClientRect().height<=parseFloat(getComputedStyle(c).fontSize)*1.8 && getComputedStyle(c).backgroundColor==='rgba(0, 0, 0, 0)')`, "a task status is a tall grey box") |
| p.check(`![...document.querySelectorAll('[equipo-group][data-group="needs"] [equipo-chip]')].some(c=>c.textContent.includes('Waiting for you'))`, "a Needs you row repeats its heading") |
| - ask := `document.querySelector('[equipo-row] [equipo-ask-about]')` |
| - if size.touch { |
| - p.check(`getComputedStyle(`+ask+`).opacity==='1'`, "Ask about this hidden on touch") |
| - } else { |
| - p.check(`getComputedStyle(`+ask+`).opacity==='0'`, "Ask about this shown before hover") |
| - } |
| + p.check(`document.querySelectorAll('[equipo-trow]').length>0 && [...document.querySelectorAll('[equipo-trow]')].every(r=>!!r.querySelector('[equipo-trow-act] [equipo-menu] [equipo-ask-about]'))`, "Ask about this is not in every row's menu") |
| p.shot(fmt.Sprintf("projects-tasks-%d", size.w)) |
| p.open("/tasks?needs=you") |
| p.fits("needs") |
diff --git a/internal/thintest/projects_pages_test.go b/internal/thintest/projects_pages_test.go| index a55c20d5..cc9c7fbc 100644 |
| --- a/internal/thintest/projects_pages_test.go |
| +++ b/internal/thintest/projects_pages_test.go |
| @@ -241,7 +241,7 @@ func TestPagesTaskDecisionsSayWhy(t *testing.T) { |
| if strings.Contains(tasks, "Waiting for you") { |
| t.Fatal("a Needs you row repeats its heading") |
| } |
| - row := regexp.MustCompile(`(?s)<li equipo-row data-task="` + g.unchecked + `".*?</div>\n</li>`).FindString(tasks) |
| + row := regexp.MustCompile(`(?s)<li equipo-row equipo-trow data-task="` + g.unchecked + `".*?</div>\n</li>`).FindString(tasks) |
| if !strings.Contains(row, "<span>Waiting for a Mac to run checks</span>") || !strings.Contains(row, `href="/conversation?about=`+g.unchecked+`" data-ask-about>Ask about this</a>`) { |
| t.Fatalf("unchecked row: %s", row) |
| } |
diff --git a/internal/thintest/rows_browser_test.go b/internal/thintest/rows_browser_test.go| new file mode 100644 |
| index 00000000..6ca71fef |
| --- /dev/null |
| +++ b/internal/thintest/rows_browser_test.go |
| @@ -0,0 +1,97 @@ |
| +//go:build browser |
| + |
| +package thintest |
| + |
| +import ( |
| + "fmt" |
| + "testing" |
| + |
| + "github.com/chromedp/chromedp" |
| +) |
| + |
| +// TestBrowserTaskRows: the redesigned rows at 1280 with a mouse and at |
| +// 390 with touch, light and dark, on a list past twenty rows. Every |
| +// action is the same size and sits in the same slot on every row; an |
| +// exploration waiting on its direction leads with What next?, which |
| +// opens its direction card; long titles clamp to two lines and the |
| +// detail line keeps to one; at 390 the cells restack and the action |
| +// takes the row's width beside the menu. Each view is saved as |
| +// rows-<width>-<scheme>.png when EQUIPO_BROWSER_ARTIFACTS names a |
| +// directory. |
| +func TestBrowserTaskRows(t *testing.T) { |
| + f := newRowsFixture(t, 16) |
| + r := f.r |
| + row := func(id string) string { return `document.querySelector('[equipo-trow][data-task="` + id + `"]')` } |
| + rows := `[...document.querySelectorAll('#work-tasks [equipo-trow]')]` |
| + acts := `[...document.querySelectorAll('#work-tasks [equipo-act]')]` |
| + box := `(e=>e.getBoundingClientRect())` |
| + for _, size := range []struct { |
| + w, h int64 |
| + touch bool |
| + }{{1280, 900, false}, {390, 844, true}} { |
| + for _, scheme := range []string{"light", "dark"} { |
| + p := openInner(t, r.inst.URL, r.inst.Cookie(), size.w, size.h, size.touch, scheme, "reduce") |
| + p.open("/tasks") |
| + p.fits("tasks") |
| + if n := eval[int](p, rows+`.length`); n < 20 { |
| + t.Fatalf("%d rows", n) |
| + } |
| + p.check(acts+`.length===4`, "not one action on each of the four Needs you rows") |
| + |
| + // Every action the same size; the menu, last, in one place. |
| + p.check(`(()=>{const w=`+acts+`.map(a=>`+box+`(a).width),h=`+acts+`.map(a=>`+box+`(a).height);return Math.max(...w)-Math.min(...w)<0.5 && Math.max(...h)-Math.min(...h)<0.5})()`, "action buttons differ in size") |
| + p.check(`(()=>{const m=`+rows+`.map(r=>`+box+`(r.querySelector('[equipo-menu] > summary')));return m.length>=20 && m.every(b=>Math.abs(b.right-m[0].right)<0.5 && (`+fmt.Sprint(size.touch)+` || Math.abs(b.width-m[0].width)<0.5))})()`, "the menu moves between rows") |
| + p.check(`(()=>{const a=`+acts+`.map(e=>`+box+`(e));return a.every(b=>Math.abs(b.left-a[0].left)<0.5 && Math.abs(b.right-a[0].right)<0.5)})()`, "the action slot moves between rows") |
| + // The icons are decoration; the label names the action. |
| + p.check(acts+`.every(a=>a.querySelector('svg').getAttribute('aria-hidden')==='true' && a.textContent.trim().length>0)`, "an action's icon speaks, or it has no label") |
| + |
| + // What next? is the exploration's action, with its fork icon. |
| + next := row(f.explore) + `.querySelector('[equipo-act]')` |
| + p.check(next+`.textContent.trim()==='What next?' && `+next+`.dataset.act==='next' && !!`+next+`.querySelector('svg')`, "What next? is not the exploration's action") |
| + p.check(row(f.push)+`.querySelector('[equipo-act]').textContent.trim()==='Retry push' && `+row(f.rounds)+`.querySelector('[equipo-act]').textContent.trim()==='Another round'`, "Retry push or Another round") |
| + |
| + // Long titles clamp to two lines; detail lines keep to one and |
| + // carry the whole line as a tooltip. |
| + title := row(f.long) + `.querySelector('[equipo-row-link]')` |
| + p.check(`(()=>{const l=`+title+`;const lh=parseFloat(getComputedStyle(l).lineHeight);return `+box+`(l).height<=2*lh+1 && l.scrollHeight>l.clientHeight})()`, "the long title is not clamped to two lines") |
| + p.check(`[...document.querySelectorAll('[equipo-trow-note]')].every(n=>`+box+`(n).height<=parseFloat(getComputedStyle(n).fontSize)*1.8 && (n.textContent.trim()==='' || n.title.length>0))`, "a detail line wraps or has no tooltip") |
| + // The status is never cut off: it wraps, to two lines at most here. |
| + p.check(`[...document.querySelectorAll('[equipo-trow] [equipo-stage-name]')].every(n=>n.scrollWidth<=n.clientWidth && n.scrollHeight<=n.clientHeight+1 && `+box+`(n).height<=parseFloat(getComputedStyle(n).lineHeight)*2+1)`, "a status is cut off or runs past two lines") |
| + // No action's label overflows its button. |
| + p.check(acts+`.every(a=>{const l=a.querySelector('span');return l.scrollWidth<=l.clientWidth})`, "an action's label overflows its button: "+eval[string](p, acts+`.map(a=>a.textContent.trim()+' '+a.querySelector('span').scrollWidth+'/'+a.querySelector('span').clientWidth).join(', ')`)) |
| + |
| + if size.touch { |
| + // 390: no column names; project and age share the top line, |
| + // the action takes the row less the menu, 40px tall. |
| + p.check(`getComputedStyle(document.querySelector('[equipo-tcols]')).display==='none'`, "column names at 390") |
| + p.check(rows+`.every(r=>{const a=`+box+`(r.querySelector('[equipo-trow-proj]')),g=`+box+`(r.querySelector(':scope > [equipo-ago]'));return Math.abs(a.top-g.top)<6 && g.right<=`+box+`(r).right})`, "project and age not on one line") |
| + p.check(`(()=>{const r=`+row(f.retry)+`,a=`+box+`(r.querySelector('[equipo-act]')),m=`+box+`(r.querySelector('[equipo-menu] > summary')),b=`+box+`(r);const pad=parseFloat(getComputedStyle(r).paddingLeft);return Math.abs(a.left-(b.left+pad))<1 && Math.abs(m.right-(b.right-pad))<1 && a.height>=40 && m.width>=40 && a.top>=`+box+`(r.querySelector('[equipo-trow-from]')).bottom})()`, "the 390 action is not full width under From") |
| + p.check(`getComputedStyle(`+row(f.retry)+`.querySelector('[equipo-trow-from] [data-long]')).display!=='none'`, "From your conversation missing at 390") |
| + } else { |
| + // 1280: the column names line up with their cells. |
| + p.check(`(()=>{const c=[...document.querySelectorAll('[equipo-tcols] > span')].map(e=>`+box+`(e).left),r=`+row(f.retry)+`;const cells=['[equipo-trow-proj]','[equipo-trow-task]','[equipo-trow-status]','[equipo-trow-from]'].map(s=>`+box+`(r.querySelector(s)).left);return cells.every((x,i)=>Math.abs(x-c[i])<1)})()`, "column names off their cells") |
| + p.check(`(()=>{const a=`+box+`(`+row(f.retry)+`.querySelector('[equipo-act]'));return a.width>=155 && a.width<=157 && a.height>=27 && a.height<=29})()`, "action is not 156 by 28") |
| + // Focus: the action shows its ring and its solid fill. |
| + p.check(`(()=>{const s=`+row(f.explore)+`.querySelector('a[equipo-source]')||`+row(f.explore)+`.querySelector('[equipo-row-link]');s.focus();return document.activeElement===s})()`, "focus before the action") |
| + for i := 0; i < 4 && !eval[bool](p, `document.activeElement===`+next); i++ { |
| + p.do(chromedp.KeyEvent("\t")) |
| + } |
| + p.check(`document.activeElement===`+next, "Tab did not reach What next?") |
| + p.wait(`(()=>{const s=getComputedStyle(`+next+`);return s.outlineStyle==='solid' && s.color==='rgb(255, 255, 255)'})()`, "the action's focus ring and fill") |
| + } |
| + p.shot(fmt.Sprintf("rows-%d-%s", size.w, scheme)) |
| + |
| + // Show N more opens the rest of Done. |
| + p.check(`!!document.querySelector('[equipo-trow-more]') && document.querySelectorAll('[data-group="done"] [equipo-trow]').length===1`, "Done not folded") |
| + p.check(`(()=>{document.querySelector('[equipo-trow-more]').click();return true})()`, "Show more") |
| + p.wait(`location.search==='?done=all' && document.querySelectorAll('[data-group="done"] [equipo-trow]').length===3`, "the rest of Done") |
| + |
| + // What next? opens the direction card. |
| + p.open("/tasks") |
| + p.check(`(()=>{`+next+`.click();return true})()`, "What next? click") |
| + p.wait(`location.pathname==='/tasks/`+f.explore+`' && location.hash==='#decide' && !!document.querySelector('#decide [value="build"]')`, "the direction card") |
| + p.check(`(()=>{const b=document.querySelector('#decide').getBoundingClientRect();return b.top<innerHeight && b.bottom>0})()`, "the direction card is out of view") |
| + p.stop() |
| + } |
| + } |
| +} |
diff --git a/internal/thintest/rows_fixture_test.go b/internal/thintest/rows_fixture_test.go| new file mode 100644 |
| index 00000000..5b9bd1b6 |
| --- /dev/null |
| +++ b/internal/thintest/rows_fixture_test.go |
| @@ -0,0 +1,93 @@ |
| +package thintest |
| + |
| +import ( |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// rowsFixture is a Tasks list with one row for each kind of decision the |
| +// redesigned rows answer (Retry, Retry push, Another round, What next?), |
| +// three merged tasks for Done's "Show N more", a title too long for two |
| +// lines, and enough noted tasks to fill the list past twenty rows. |
| +type rowsFixture struct { |
| + r *toolRig |
| + retry, push, rounds, explore, long string |
| + done []string |
| + noted []string |
| +} |
| + |
| +const rowsLongTitle = "Make the compose sheet keep its draft, attachments and scroll position when the app comes back from the background" |
| + |
| +func newRowsFixture(t *testing.T, noted int) *rowsFixture { |
| + t.Helper() |
| + r := newToolRigAt(t, wire.ProtocolCurrent) |
| + f := &rowsFixture{r: r} |
| + sha := func(c string) string { return strings.Repeat(c, 40) } |
| + |
| + // Done: three tasks Equipo merged. |
| + for i, c := range []string{"a", "b", "c"} { |
| + key := "d" + itoa(i) |
| + id, _ := r.pushed(key, "Fix README typo number "+itoa(i+1), sha("1"), sha(c)) |
| + r.expect(wire.FrameWatchMerge) |
| + ch := r.dispatched(wire.SpecialistChecks, sha("1"), sha(c), 0) |
| + r.checks(key+"-c", ch, wire.ChecksPassed, exit(0), "", "ok\n") |
| + rv := r.dispatched(wire.SpecialistReview, sha("1"), sha(c), 0) |
| + r.verdict(key+"-r", rv, wire.VerdictApprove) |
| + m := r.dispatched(wire.SpecialistMerge, sha("1"), sha(c), 0) |
| + r.mergedStep(key+"-m", m, sha("d")) |
| + r.wait("merged", func(c *Conversation) bool { return c.Tasks[id].Stage == wire.StageDone }) |
| + f.done = append(f.done, id) |
| + } |
| + |
| + // Stopped: the model connection failed (Retry), the push failed |
| + // (Retry push). |
| + stopped := func(key, title, reason string) string { |
| + id := taskID(t, r.call(key+"-rec", wire.ToolRecordTask, map[string]any{"repo": "oficina/sample", "title": title, "brief": "Fix it.", "separate": true})) |
| + if res := r.call(key+"-start", wire.ToolStartTask, map[string]string{"task": id, "brief": "Fix it."}); res.IsError { |
| + t.Fatalf("start: %+v", res) |
| + } |
| + r.stop(key, r.nextDispatch(), reason) |
| + r.wait("stopped", func(c *Conversation) bool { return c.Tasks[id].NeedsYou == wire.NeedsRetry }) |
| + return id |
| + } |
| + f.retry = stopped("s1", "Show project and stream context on thinking indicators", "provider_failed") |
| + f.push = stopped("s2", "Create two clickable barber app mockups", "push_failed") |
| + |
| + // Still not approved after two fix rounds: Another round. |
| + cands := []string{sha("2"), sha("3"), sha("4")} |
| + f.rounds, _ = r.pushed("fr", "Add project rename control and ship the update", sha("1"), cands[0]) |
| + r.expect(wire.FrameWatchMerge) |
| + c := r.dispatched(wire.SpecialistChecks, sha("1"), cands[0], 0) |
| + r.checks("fr-c0", c, wire.ChecksFailed, exit(2), "", "--- FAIL: TestRename\nFAIL\n") |
| + fix := r.dispatched(wire.SpecialistEngineering, cands[0], "", 1) |
| + for round := 1; round <= 2; round++ { |
| + key := "fr" + itoa(round) |
| + r.step(key+"-done", wire.StepReport{TaskID: f.rounds, StepID: fix.StepID, Attempt: 1, State: wire.StepDone, BaseSHA: cands[round-1], CandidateSHA: cands[round], Pushed: true, Termination: true}) |
| + c = r.dispatched(wire.SpecialistChecks, sha("1"), cands[round], round) |
| + r.checks(key+"-c", c, wire.ChecksNone, nil, "", "") |
| + rv := r.dispatched(wire.SpecialistReview, sha("1"), cands[round], round) |
| + r.verdict(key+"-r", rv, wire.VerdictChanges, wire.Finding{Text: "Still wrong.", Path: "README.md", Line: 5}) |
| + if round == 1 { |
| + fix = r.dispatched(wire.SpecialistEngineering, cands[1], "", 2) |
| + } |
| + } |
| + r.wait("fix rounds", func(c *Conversation) bool { return c.Tasks[f.rounds].NeedsYou == wire.NeedsFixRounds }) |
| + |
| + // An exploration waiting on its direction: What next? |
| + f.explore, _ = r.toDirection("x", "Barber app mockups") |
| + |
| + // A title too long for two lines, and the noted tasks. |
| + f.long = taskID(t, r.call("long-rec", wire.ToolRecordTask, map[string]any{"repo": "oficina/sample", "title": rowsLongTitle, "brief": "Keep the draft.", "separate": true})) |
| + subjects := []string{"invite emails", "the sign-in page", "runner logs", "the merge card", "project stars", "the notebook", "dark mode charts", "machine names", |
| + "thread replies", "preview links", "budget alerts", "the composer", "file uploads", "team links", "housekeeping", "the stage track", "spend totals", "settings search"} |
| + for i := 0; i < noted; i++ { |
| + title := "Tidy up " + subjects[i%len(subjects)] |
| + id := taskID(t, r.call("n"+itoa(i)+"-rec", wire.ToolRecordTask, map[string]any{"repo": "oficina/equipo", "title": title, "brief": "Look at " + subjects[i%len(subjects)] + " when there is time.", "separate": true})) |
| + f.noted = append(f.noted, id) |
| + } |
| + want := 3 + 2 + 1 + 1 + 1 + noted |
| + r.wait("all rows", func(c *Conversation) bool { return len(c.Tasks) >= want }) |
| + return f |
| +} |
diff --git a/internal/thintest/rows_pages_test.go b/internal/thintest/rows_pages_test.go| new file mode 100644 |
| index 00000000..01ce90df |
| --- /dev/null |
| +++ b/internal/thintest/rows_pages_test.go |
| @@ -0,0 +1,113 @@ |
| +package thintest |
| + |
| +import ( |
| + "regexp" |
| + "strings" |
| + "testing" |
| +) |
| + |
| +// taskRow is one task's row on a list page. |
| +func taskRow(t *testing.T, page, id string) string { |
| + t.Helper() |
| + row := regexp.MustCompile(`(?s)<li equipo-row equipo-trow data-task="` + regexp.QuoteMeta(id) + `".*?\n</li>`).FindString(page) |
| + if row == "" { |
| + t.Fatalf("no row for %s in:\n%s", id, page) |
| + } |
| + return row |
| +} |
| + |
| +// TestPagesTaskRows: every row is one grid of project, task, status, |
| +// from, updated and the action slot. A Needs you row carries its one |
| +// action, mapped to the handler its decision card uses; an exploration |
| +// waiting on its direction leads with What next?, which opens the |
| +// direction card. Done shows the newest row and the rest behind "Show N |
| +// more". |
| +func TestPagesTaskRows(t *testing.T) { |
| + f := newRowsFixture(t, 2) |
| + r := f.r |
| + owner := r.inst.Cookie() |
| + tasks := r.get(owner, "/tasks", 200) |
| + |
| + // The column names, once, for the eye only. |
| + if n := strings.Count(tasks, `<div equipo-tcols aria-hidden="true">`); n != 1 { |
| + t.Fatalf("%d column heads", n) |
| + } |
| + for _, col := range []string{"<span>Project</span>", "<span>Task</span>", "<span>Status</span>", "<span>From</span>", "<span>Updated</span>"} { |
| + if !strings.Contains(tasks, col) { |
| + t.Fatalf("column head lacks %s", col) |
| + } |
| + } |
| + |
| + // One action per Needs you row, each the decision's own handler. |
| + for _, c := range []struct{ id, kind, label, open string }{ |
| + {f.retry, "retry", "Retry", `<form method="post" action="/conversation/tasks/` + f.retry + `/retry">`}, |
| + {f.push, "retry", "Retry push", `<form method="post" action="/conversation/tasks/` + f.push + `/retry">`}, |
| + {f.rounds, "round", "Another round", `<form method="post" action="/conversation/tasks/` + f.rounds + `/round">`}, |
| + {f.explore, "next", "What next?", `<a equipo-act href="/tasks/` + f.explore + `#decide" data-act="next">`}, |
| + } { |
| + row := taskRow(t, tasks, c.id) |
| + if strings.Count(row, "equipo-act ") != 1 || !strings.Contains(row, `data-act="`+c.kind+`"`) || !strings.Contains(row, "<span>"+c.label+"</span>") || !strings.Contains(row, c.open) { |
| + t.Fatalf("%s row's action is not %s:\n%s", c.kind, c.label, row) |
| + } |
| + if !strings.Contains(row, `data-group="needs"`) || !strings.Contains(row, `<svg class="icon"`) || strings.Count(row, `aria-hidden="true" viewBox="0 0 16 16"`) != 1 { |
| + t.Fatalf("%s row: group or icon:\n%s", c.kind, row) |
| + } |
| + } |
| + // The primary action is not repeated in the row's menu. |
| + if n := strings.Count(tasks, `action="/conversation/tasks/`+f.retry+`/retry"`); n != 1 { |
| + t.Fatalf("Retry %d times on its row", n) |
| + } |
| + // Under Needs you the status drops the heading's "Needs you:". |
| + rounds := taskRow(t, tasks, f.rounds) |
| + if !strings.Contains(rounds, ">Still not approved after two fix rounds</p>") || strings.Contains(rounds, "Needs you: still") { |
| + t.Fatalf("rounds status:\n%s", rounds) |
| + } |
| + // The project, the stepper's words, who and from where, the age. |
| + retry := taskRow(t, tasks, f.retry) |
| + for _, want := range []string{`<a equipo-trow-proj href="/projects/` + r.task(f.retry).ProjectID + `">`, "<span>Woodstar</span>", |
| + `role="img" aria-label="Step 3 of 6"`, ">Stopped: the model connection failed</p>", |
| + "<span data-short>Conversation, ", "<span data-long>From your conversation, ", ">You</span>", "equipo-ago data-at=", `aria-label="More actions"`, |
| + `href="/conversation?about=` + f.retry + `" data-ask-about>Ask about this</a>`} { |
| + if !strings.Contains(retry, want) { |
| + t.Fatalf("retry row lacks %q:\n%s", want, retry) |
| + } |
| + } |
| + // The detail line says its badges once, in words, with the whole line |
| + // as its tooltip. |
| + if row := taskRow(t, tasks, f.rounds); !strings.Contains(row, `<span equipo-trow-note title="No checks found. Changes requested.">`) { |
| + t.Fatalf("rounds detail:\n%s", row) |
| + } |
| + // Rows that wait on nobody carry no action, only the quiet menu. |
| + if row := taskRow(t, tasks, f.noted[0]); strings.Contains(row, "equipo-act") || !strings.Contains(row, "equipo-menu") { |
| + t.Fatalf("noted row:\n%s", row) |
| + } |
| + // The long title is whole in the page; the screen clamps it. |
| + if !strings.Contains(tasks, rowsLongTitle+"</a>") { |
| + t.Fatal("long title cut in the markup") |
| + } |
| + |
| + // Done: the newest, then "Show 2 more"; with ?done=all, all three. |
| + done := strings.Count(tasks, `data-group="done">`) |
| + if done != 1 || !strings.Contains(tasks, `<a equipo-trow-more href="/tasks?done=all#done">Show 2 more</a>`) || !strings.Contains(tasks, `<section equipo-group data-group="done" id="done">`) { |
| + t.Fatalf("Done shows %d rows, or no Show 2 more", done) |
| + } |
| + all := r.get(owner, "/tasks?done=all", 200) |
| + if n := strings.Count(all, `data-group="done">`); n != 3 || strings.Contains(all, "equipo-trow-more") { |
| + t.Fatalf("?done=all shows %d done rows", n) |
| + } |
| + // The filters keep their choice through Show N more. |
| + pid := r.task(f.done[0]).ProjectID |
| + if p := r.get(owner, "/tasks?project="+pid, 200); !strings.Contains(p, `href="/tasks?done=all&project=`+pid+`#done"`) { |
| + t.Fatal("Show N more drops the project filter") |
| + } |
| + |
| + // What next? opens the direction card on the task page. |
| + if p := r.get(owner, "/tasks/"+f.explore, 200); !strings.Contains(p, `id="decide"`) || !strings.Contains(p, `value="build"`) { |
| + t.Fatal("no direction card to open") |
| + } |
| + // The project page shares the rows, without the project column. |
| + project := r.get(owner, "/projects/"+pid, 200) |
| + if !strings.Contains(project, `<div equipo-tasklist data-scope="project">`) || !strings.Contains(project, `href="/projects/`+pid+`?done=all#done"`) || !strings.Contains(project, `data-act="next"`) { |
| + t.Fatal("project page rows") |
| + } |
| +} |