Needs you: say what holds up work, and answer cards in place
Paul on production: giant titles and buttons, and unclear what needs
him and what is expected. Each standalone card printed its question as
a page-size heading, with one full-width Conversation button.
The page now follows the approved mockup: one state line ("%d for you
· %d holding up work"), then Holding up work (task decisions through
the unchanged decision partial, coordinator questions and other cards
that stop work) and Project settings (ships, policy and place cards on
the quiet surface), then Waiting on others without the column header.
Empty groups are hidden. A new needs-card partial keeps the decision
anatomy: project or coordinator mark, the question at task-title size,
who asked and when, why it waits, and answers in place: option buttons
posting to the answer route with from=needs, a reply box with Send for
a free-text question (data-draft-key per card), No longer needed, and a
quiet link to the conversation. The rail count and the page agree. CSS
ported from the mockup with tokens only. Plan task T4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 files changed,
+354
−20
docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+16 −0internal/equipo/copy.go+22 −6internal/equipo/needs_view.go+132 −0internal/equipo/static/equipo.css+22 −0internal/equipo/templates/work_needs.html+12 −4internal/equipo/work_pages.go+21 −9internal/thintest/gallery_test.go+3 −1internal/thintest/needs_you_page_test.go+126 −0
CI failed — run details
CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/needs-you-ux: Type Size Avail | ext4 96G 84G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 84G
ci-box: bwrap: fetched and verified in 0.4s
ci-box: claude: fetched and verified in 1.6s
ci-box: codex: fetched and verified in 3.7s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.4s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.7s
ci-box: pi: installed and verified in 7.6s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 9.3s
ci-box: clone deepened in 4.1s
ci-box: file times set from content: 3779 files, 245 directories
ci-box: ready in 18.0s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
--- FAIL: TestReleaseCopyReviewed (0.09s)
task_pages_test.go:236: COPY REVIEW REQUIRED: copy-status.py verify found copy pending review or stale bookkeeping
FAIL
rastrillo-budget/v1 ran 88ms
FAIL amadan.net/oficina/equipo/internal/equipotest 0.239s
FAIL
make: *** [Makefile:260: copy-release-check] Error 1
amadan: step copy failed: exit status 2
amadan: job failed at step copy — its output is above, not at the tail of this log
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index 26856d31..d8039562 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -7225,6 +7225,22 @@ records remain unchanged. |
| | `chat.card.question_settled_answered` | Answered in the conversation. | Copy specialist | COPY REVIEW PENDING | |
| | `chat.card.question_settled_not_needed` | No longer needed. | Copy specialist | COPY REVIEW PENDING | |
| | `chat.activity.settle_question` | Closing a question… | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.counts` | %d for you · %d holding up work | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.group.blocking` | Holding up work | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.group.blocking_hint` | Work stops here until you decide. | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.group.settings` | Project settings | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.group.settings_hint` | Nothing waits on these. Answer once and Equipo remembers. | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.coordinator` | Your coordinator | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.asked` | asked %s | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.why.question` | Your coordinator stopped to ask. Nothing on this moves until you reply. | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.why.merge_ships` | Until you answer, Equipo asks you before it merges anything here without checks. | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.why.merge_policy` | Equipo keeps merging this project as it does now until you choose. | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.why.place` | The site is not published until you choose where it goes. | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.ships_after` | Saved to %s's merge settings. | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.reply` | Your answer | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.send` | Send | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.not_needed` | No longer needed | Copy specialist | COPY REVIEW PENDING | |
| +| `work.needs.open_conversation` | Open the conversation | Copy specialist | COPY REVIEW PENDING | |
| ## Task 21 |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 547eb857..8111d1db 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -2448,12 +2448,28 @@ var pageCopy = map[string]string{ |
| "chat.card.policy_chose_save": "Saved.", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
| "chat.card.policy_chose_cancel": "Left as it was.", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
| // Needs you UX pass (needs-you-ux, 2026-11-30): settled questions. |
| - "chat.card.ships_settled_ships": "The merge settings now say merging to main ships to users.", // COPY REVIEW PENDING |
| - "chat.card.ships_settled_not_ships": "The merge settings now say main is not a release.", // COPY REVIEW PENDING |
| - "chat.card.question_dismissed": "You closed this question.", // COPY REVIEW PENDING |
| - "chat.card.question_settled_answered": "Answered in the conversation.", // COPY REVIEW PENDING |
| - "chat.card.question_settled_not_needed": "No longer needed.", // COPY REVIEW PENDING |
| - "chat.activity.settle_question": "Closing a question…", // COPY REVIEW PENDING |
| + "chat.card.ships_settled_ships": "The merge settings now say merging to main ships to users.", // COPY REVIEW PENDING |
| + "chat.card.ships_settled_not_ships": "The merge settings now say main is not a release.", // COPY REVIEW PENDING |
| + "chat.card.question_dismissed": "You closed this question.", // COPY REVIEW PENDING |
| + "chat.card.question_settled_answered": "Answered in the conversation.", // COPY REVIEW PENDING |
| + "chat.card.question_settled_not_needed": "No longer needed.", // COPY REVIEW PENDING |
| + "chat.activity.settle_question": "Closing a question…", // COPY REVIEW PENDING |
| + "work.needs.counts": "%d for you · %d holding up work", // COPY REVIEW PENDING |
| + "work.needs.group.blocking": "Holding up work", // COPY REVIEW PENDING |
| + "work.needs.group.blocking_hint": "Work stops here until you decide.", // COPY REVIEW PENDING |
| + "work.needs.group.settings": "Project settings", // COPY REVIEW PENDING |
| + "work.needs.group.settings_hint": "Nothing waits on these. Answer once and Equipo remembers.", // COPY REVIEW PENDING |
| + "work.needs.coordinator": "Your coordinator", // COPY REVIEW PENDING |
| + "work.needs.asked": "asked %s", // COPY REVIEW PENDING |
| + "work.needs.why.question": "Your coordinator stopped to ask. Nothing on this moves until you reply.", // COPY REVIEW PENDING |
| + "work.needs.why.merge_ships": "Until you answer, Equipo asks you before it merges anything here without checks.", // COPY REVIEW PENDING |
| + "work.needs.why.merge_policy": "Equipo keeps merging this project as it does now until you choose.", // COPY REVIEW PENDING |
| + "work.needs.why.place": "The site is not published until you choose where it goes.", // COPY REVIEW PENDING |
| + "work.needs.ships_after": "Saved to %s's merge settings.", // COPY REVIEW PENDING |
| + "work.needs.reply": "Your answer", // COPY REVIEW PENDING |
| + "work.needs.send": "Send", // COPY REVIEW PENDING |
| + "work.needs.not_needed": "No longer needed", // COPY REVIEW PENDING |
| + "work.needs.open_conversation": "Open the conversation", // COPY REVIEW PENDING |
| // The daily roll-up (2026-11-12): earlier days on the conversation page. |
| "chat.day.today": "Today", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
diff --git a/internal/equipo/needs_view.go b/internal/equipo/needs_view.go| new file mode 100644 |
| index 00000000..176dc693 |
| --- /dev/null |
| +++ b/internal/equipo/needs_view.go |
| @@ -0,0 +1,132 @@ |
| +package equipo |
| + |
| +import ( |
| + "fmt" |
| + "net/url" |
| + "strconv" |
| + "strings" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/equipo/chat" |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// The Needs you page (needs-you-ux, Paul's "Giant titles and buttons. It |
| +// should be really clear what actually needs me here, and what the |
| +// expectations are."): one state line, then what holds up work (the |
| +// viewer's task decisions, coordinator questions and the other cards |
| +// that stop work) and the project settings that wait on nothing, each |
| +// card's question at task-title size with its answers in place. |
| + |
| +// settingsKinds are the cards that wait on nothing: a project setting |
| +// asked once and remembered. |
| +var settingsKinds = map[string]bool{wire.CardMergeShips: true, wire.CardMergePolicy: true, wire.CardPlace: true} |
| + |
| +// needsCard is one standalone card on Needs you, in the decision card's |
| +// anatomy: its mark, its question as the title, who asked and when, why |
| +// it waits, and its answers. |
| +type needsCard struct { |
| + chatCard |
| + // Mono is the project's mark; nil for a card with no project, which |
| + // the coordinator raised (its mark instead). |
| + Mono *monoLine |
| + // Who asked and When (the person's day); Asked says "asked <date>". |
| + Who, When string |
| + Asked bool |
| + Why string |
| + // Buttons answer in place, one per option; After says what an answer |
| + // does. Reply is a free-text question's reply box; Dismiss its No |
| + // longer needed. |
| + Buttons []needsChoice |
| + After string |
| + Reply bool |
| + Dismiss bool |
| + // Href is the card in its conversation; LinkKey the quiet link's |
| + // words. OpenButton: no answer in place, a normal-size Open instead. |
| + Href string |
| + LinkKey string |
| + OpenButton bool |
| + // Quiet: a project setting, on the plain surface. |
| + Quiet bool |
| +} |
| + |
| +// needsChoice is one in-place answer. |
| +type needsChoice struct { |
| + Value, Label string |
| + Primary bool |
| +} |
| + |
| +// needsCardOf is c as Needs you shows it, its day in loc. |
| +func needsCardOf(c chat.StandaloneCard, loc *time.Location) needsCard { |
| + v := cardView(c.Card, nil, nil) |
| + v.Job = c.Job |
| + n := needsCard{chatCard: v, When: c.CreatedAt.In(loc).Format("2 Jan"), Quiet: settingsKinds[c.Kind]} |
| + page := "/conversation" |
| + if c.Job != "" { |
| + page = "/jobs/" + c.Job |
| + } |
| + id := url.QueryEscape(c.ID) |
| + n.Href = page + "?card=" + id + "#card-" + id |
| + if c.ProjectID != "" && c.Name != "" { |
| + m := monoOf(c.Name, c.ProjectID) |
| + n.Mono, n.Who, n.Asked = &m, c.Name, true |
| + } else { |
| + n.Who = copyText("work.needs.coordinator") |
| + } |
| + n.Why = copyText("work.needs.why." + c.Kind) |
| + question := c.Kind == wire.CardQuestion && !c.PlacementQuestion |
| + switch { |
| + case c.Kind == wire.CardMergeShips && len(c.Options) > 0: |
| + for _, o := range c.Options { |
| + n.Buttons = append(n.Buttons, needsChoice{Value: o, Label: copyText("chat.card." + o)}) |
| + } |
| + n.After = fmt.Sprintf(copyText("work.needs.ships_after"), c.Name) |
| + case c.Kind == wire.CardMergePolicy && len(c.Options) > 0: |
| + for _, o := range c.Options { |
| + n.Buttons = append(n.Buttons, needsChoice{Value: o, Label: copyText("chat.card." + o), Primary: o == wire.ChoiceSave}) |
| + } |
| + case c.Kind == wire.CardPlace && len(v.PlaceChoices) > 0: |
| + for i, p := range v.PlaceChoices { |
| + n.Buttons = append(n.Buttons, needsChoice{Value: p.ID, Label: p.Label, Primary: i == 0}) |
| + } |
| + n.Buttons = append(n.Buttons, needsChoice{Value: wire.ChoiceNotNow, Label: copyText("chat.card.not_now")}) |
| + case question && len(c.Options) > 0: |
| + // The coordinator's options, its own words: none is the answer |
| + // Equipo suggests. |
| + for _, o := range c.Options { |
| + n.Buttons = append(n.Buttons, needsChoice{Value: o, Label: o}) |
| + } |
| + case question: |
| + n.Reply = true |
| + default: |
| + n.OpenButton = true |
| + } |
| + n.Dismiss = question |
| + n.LinkKey = "work.ask_about" |
| + if c.Kind == wire.CardQuestion { |
| + n.LinkKey = "work.needs.open_conversation" |
| + } |
| + return n |
| +} |
| + |
| +// countPart is a piece of the page's state line: words, or a count |
| +// shown in bold. |
| +type countPart struct { |
| + Text string |
| + Bold bool |
| +} |
| + |
| +// needsCounts is the page's state line: copy's format with each %d a |
| +// count in bold. |
| +func needsCounts(format string, counts ...int) []countPart { |
| + var out []countPart |
| + for i, part := range strings.Split(format, "%d") { |
| + if i > 0 && i-1 < len(counts) { |
| + out = append(out, countPart{Text: strconv.Itoa(counts[i-1]), Bold: true}) |
| + } |
| + if part != "" { |
| + out = append(out, countPart{Text: part}) |
| + } |
| + } |
| + return out |
| +} |
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css| index a7f57486..bbb867b2 100644 |
| --- a/internal/equipo/static/equipo.css |
| +++ b/internal/equipo/static/equipo.css |
| @@ -2281,3 +2281,25 @@ body[equipo-preview] { margin: 0; min-block-size: 100dvh; } |
| [equipo-task-page] [equipo-pause-act] { grid-column: 1 / -1; justify-items: stretch; } |
| } |
| [equipo-roster-report-head] > [equipo-needs-chip]:first-child { justify-self: start; } |
| +/* Needs you (needs-you-ux, the approved mockup): one state line, what |
| + holds up work, then the project settings that wait on nothing. A |
| + card's question reads at task-title size, never a heading's; its |
| + answers sit under it, sized to their words. */ |
| +[equipo-needs-head] { margin-block-end: var(--rst-sp-5); } |
| +[equipo-needs-head] p { font-variant-numeric: tabular-nums; } |
| +[equipo-needs-head] b { color: var(--rst-text); font-weight: 600; } |
| +#work-needs > [equipo-group] + [equipo-group] { margin-block-start: var(--rst-sp-6); } |
| +#work-needs [equipo-group] > [equipo-decision]:last-child { margin-block-end: 0; } |
| +[equipo-d-q] { margin: 0; color: var(--rst-text); font-weight: 500; flex: 1 1 24rem; min-inline-size: 0; text-wrap: pretty; } |
| +[equipo-mono][data-kind="coordinator"] { grid-column: 1; grid-row: 1 / span 4; color: var(--rst-text-muted); background: var(--rst-surface-2); box-shadow: inset 0 0 0 1px var(--rst-line); } |
| +[equipo-mono][data-kind="coordinator"] svg { inline-size: 1rem; block-size: 1rem; } |
| +[equipo-decision][data-tone="quiet"] { background: var(--rst-surface); border-color: var(--rst-line); } |
| +[equipo-d-after] { color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| +[equipo-d-actions] form[equipo-reply] { display: flex; gap: var(--rst-sp-2); flex: 1 1 22rem; max-inline-size: 36rem; } |
| +[equipo-reply] input { flex: 1 1 auto; min-inline-size: 0; min-block-size: 2rem; box-sizing: border-box; font: inherit; font-size: var(--rst-fs-sm); padding: var(--rst-sp-1) var(--rst-sp-3); color: var(--rst-text); background: var(--rst-surface); border: 1px solid var(--rst-line-strong); border-radius: var(--rst-radius); } |
| +[equipo-reply] input:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: 1px; } |
| +@container work (max-width: 600px) { |
| + [equipo-d-actions] form[equipo-reply] { flex-basis: 100%; max-inline-size: none; } |
| + [equipo-reply] input { min-block-size: 2.75rem; } |
| + [equipo-d-after] { flex-basis: 100%; } |
| +} |
diff --git a/internal/equipo/templates/work_needs.html b/internal/equipo/templates/work_needs.html| index a48afa04..f98a0069 100644 |
| --- a/internal/equipo/templates/work_needs.html |
| +++ b/internal/equipo/templates/work_needs.html |
| @@ -1,9 +1,17 @@ |
| {{define "title"}}{{copy "nav.needs-you"}}{{end}} |
| {{define "content"}} |
| <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 .DecisionCount 0}}{{copy "work.needs_empty"}}{{else}}{{printf (copy "roster.needs") .DecisionCount}}{{end}}</p></div> |
| -{{range .Questions}}<article equipo-decision><h2>{{.Line}}</h2><a equipo-btn href="{{if .Job}}/jobs/{{.Job}}{{else}}/conversation{{end}}?card={{.ID}}#card-{{.ID}}">{{copy "conversation.title"}}</a></article>{{end}} |
| -{{range .Decisions}}{{template "decision" (dict "Task" . "Head" true "From" "needs")}}{{end}} |
| -{{with .Groups}}{{template "work-groups" (dict "Groups" . "From" "needs")}}{{end}}{{end}} |
| +{{with .Thin}}<div equipo-page-head equipo-needs-head><h1>{{copy "nav.needs-you"}}</h1><p>{{if .Counts}}{{range .Counts}}{{if .Bold}}<b>{{.Text}}</b>{{else}}{{.Text}}{{end}}{{end}}{{else}}{{copy "work.needs_empty"}}{{end}}</p></div> |
| +{{if .HoldingCount}}<section equipo-group data-group="blocking"><h2>{{copy "work.needs.group.blocking"}} <span equipo-n>{{.HoldingCount}}</span><span equipo-hint>{{copy "work.needs.group.blocking_hint"}}</span></h2> |
| +{{range .Blocking}}{{template "needs-card" .}}{{end}}{{range .Decisions}}{{template "decision" (dict "Task" . "Head" true "From" "needs")}}{{end}}</section> |
| +{{end}}{{with .Settings}}<section equipo-group data-group="settings"><h2>{{copy "work.needs.group.settings"}} <span equipo-n>{{len .}}</span><span equipo-hint>{{copy "work.needs.group.settings_hint"}}</span></h2> |
| +{{range .}}{{template "needs-card" .}}{{end}}</section> |
| +{{end}}{{with .Others}}<div equipo-tasklist><section equipo-group data-group="others"><h2>{{copy "work.group.others"}} <span equipo-n>{{len .}}</span>{{with copy "work.group.others_hint"}}<span equipo-hint>{{.}}</span>{{end}}</h2><ol equipo-rows data-thin-tasks>{{range .}}{{template "task-row" (dict "T" . "From" "needs")}}{{end}}</ol></section></div> |
| +{{end}}{{end}} |
| </section> |
| {{end}} |
| +{{define "needs-card"}}<div equipo-decision{{if .Quiet}} data-tone="quiet"{{end}} data-need="{{.Kind}}" data-card="{{.ID}}"> |
| +{{with .Mono}}{{template "mono" .}}{{else}}<span equipo-mono data-kind="coordinator" aria-hidden="true">{{icon "message-circle"}}</span>{{end}}<div equipo-d-title><p equipo-d-q>{{.Line}}</p><div equipo-quiet>{{.Who}} · {{if .Asked}}{{printf (copy "work.needs.asked") .When}}{{else}}{{.When}}{{end}}</div></div> |
| +{{with .Why}}<p equipo-d-why>{{.}}</p> |
| +{{end}}<div equipo-d-actions>{{if .Reply}}<form method="post" action="/conversation/cards/{{.ID}}/answer" equipo-reply data-draft-key="needs-{{.ID}}"><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="from" value="needs"><input name="choice" required maxlength="2000" autocomplete="off" aria-label="{{copy "work.needs.reply"}}" placeholder="{{copy "work.needs.reply"}}"><button equipo-btn data-primary type="submit">{{copy "work.needs.send"}}</button></form>{{end}}{{with .Buttons}}<form method="post" action="/conversation/cards/{{$.ID}}/answer"><input type="hidden" name="revision" value="{{$.Revision}}"><input type="hidden" name="from" value="needs">{{range .}}<button equipo-btn{{if .Primary}} data-primary{{end}} type="submit" name="choice" value="{{.Value}}" data-needs-choice="{{.Value}}">{{.Label}}</button>{{end}}</form>{{end}}{{with .After}}<span equipo-d-after>{{.}}</span>{{end}}{{if .OpenButton}}<a equipo-btn href="{{.Href}}">{{copy "conversation.title"}}</a>{{end}}{{if or .Dismiss (not .OpenButton)}}<span equipo-d-quiet>{{if .Dismiss}}<form method="post" action="/conversation/cards/{{.ID}}/dismiss"><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="from" value="needs"><button equipo-link type="submit" data-needs-dismiss>{{copy "work.needs.not_needed"}}</button></form>{{end}}{{if not .OpenButton}}<a equipo-link href="{{.Href}}">{{copy .LinkKey}}</a>{{end}}</span>{{end}} |
| +</div></div>{{end}} |
diff --git a/internal/equipo/work_pages.go b/internal/equipo/work_pages.go| index 967afc6f..08f6cad4 100644 |
| --- a/internal/equipo/work_pages.go |
| +++ b/internal/equipo/work_pages.go |
| @@ -592,12 +592,16 @@ type workView struct { |
| Task taskLine |
| Projects []projectLine |
| Project *projectLine |
| - // Needs is the Needs you page: Decisions are the viewer's own, Others |
| - // the team's tasks waiting on someone else. |
| + // Needs is the Needs you page: Decisions are the viewer's own task |
| + // decisions, Blocking the other cards that hold up work and Settings |
| + // the project settings that wait on nothing; Others the team's tasks |
| + // waiting on someone else. Counts is its state line. |
| Needs bool |
| Decisions []taskLine |
| - Questions []chatCard |
| + Blocking []needsCard |
| + Settings []needsCard |
| Others []taskLine |
| + Counts []countPart |
| // Groups are the Tasks page's (or a project's) tasks by what matters. |
| Groups []taskGroup |
| // Filters: the project and person chosen (empty for all) and what can |
| @@ -751,10 +755,14 @@ func (a *application) workTasks(w http.ResponseWriter, r *http.Request) { |
| a.failure(w, r, chatError(err)) |
| return |
| } |
| + loc := a.store.Chat().Zone(address) |
| for _, c := range questions { |
| - v := cardView(c.Card, nil, nil) |
| - v.Job = c.Job |
| - data.Thin.Questions = append(data.Thin.Questions, v) |
| + n := needsCardOf(c, loc) |
| + if n.Quiet { |
| + data.Thin.Settings = append(data.Thin.Settings, n) |
| + } else { |
| + data.Thin.Blocking = append(data.Thin.Blocking, n) |
| + } |
| } |
| for _, t := range all { |
| switch { |
| @@ -766,8 +774,8 @@ 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}} |
| + if n := data.Thin.NeedsCount(); n > 0 { |
| + data.Thin.Counts = needsCounts(copyText("work.needs.counts"), n, data.Thin.HoldingCount()) |
| } |
| render(w, "work_needs", data) |
| return |
| @@ -1232,4 +1240,8 @@ func (a *application) workTaskContinueCopy(w http.ResponseWriter, r *http.Reques |
| }) |
| } |
| -func (v workView) DecisionCount() int { return len(v.Decisions) + len(v.Questions) } |
| +// NeedsCount is everything on Needs you for the viewer: the rail's count. |
| +func (v workView) NeedsCount() int { return v.HoldingCount() + len(v.Settings) } |
| + |
| +// HoldingCount is what on Needs you holds up work. |
| +func (v workView) HoldingCount() int { return len(v.Decisions) + len(v.Blocking) } |
diff --git a/internal/thintest/gallery_test.go b/internal/thintest/gallery_test.go| index 3150c8c2..912ed37b 100644 |
| --- a/internal/thintest/gallery_test.go |
| +++ b/internal/thintest/gallery_test.go |
| @@ -193,10 +193,12 @@ func TestPagesInnerScreens(t *testing.T) { |
| } |
| needs := a.get(owner, "/tasks?needs=you", 200) |
| - has(needs, "Needs you", "3 waiting for you", `data-decision="`+g.unchecked+`"`, "Merge without checks?", |
| + has(needs, "Needs you", "<b>3</b> for you · <b>2</b> holding up work", `data-group="blocking"`, `data-group="settings"`, `data-decision="`+g.unchecked+`"`, "Merge without checks?", |
| `data-merge-choice="merge"`, `data-merge-choice="wait_mac"`, `name="from" value="needs"`, `data-decision="`+g.stopped+`"`, "Try again?", `data-group="others"`, `data-task="`+g.noras+`"`) |
| // No card for duplicates: Equipo tidies them, or names them quietly. |
| not(needs, "Needs you", `data-decision="`+g.noras+`"`, "Fold it into the other task?", `action="/tasks/`+g.stopped+`/duplicate"`) |
| + // Waiting on others has no column header row on Needs you. |
| + not(needs, "Needs you", "equipo-tcols") |
| detail := a.get(owner, "/tasks/"+g.running, 200) |
| has(detail, "running task", `<ol equipo-track-full data-track`, "Engineering is on it now: editing internal/equipo/static/live.js.", |
diff --git a/internal/thintest/needs_you_page_test.go b/internal/thintest/needs_you_page_test.go| new file mode 100644 |
| index 00000000..9f8fb78a |
| --- /dev/null |
| +++ b/internal/thintest/needs_you_page_test.go |
| @@ -0,0 +1,126 @@ |
| +package thintest |
| + |
| +import ( |
| + "net/http" |
| + "net/url" |
| + "regexp" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// The Needs you page (needs-you-ux T4, the approved mockup): one state |
| +// line, "Holding up work" (task decisions, coordinator questions and the |
| +// other cards that stop work) and "Project settings" (ships, policy and |
| +// place cards, quiet), each card's question at task-title size, never a |
| +// heading, with its answers in place; empty groups are not shown, and |
| +// the rail counts what the page lists. |
| + |
| +// needsCardHTML is one card's markup on Needs you. |
| +func needsCardHTML(t *testing.T, page, id string) string { |
| + t.Helper() |
| + card := regexp.MustCompile(`(?s)<div equipo-decision[^>]*data-card="` + regexp.QuoteMeta(id) + `">.*?\n</div></div>`).FindString(page) |
| + if card == "" { |
| + t.Fatalf("Needs you lacks card %s:\n%s", id, page) |
| + } |
| + return card |
| +} |
| + |
| +func TestNeedsYouPage(t *testing.T) { |
| + r := newToolRigAt(t, wire.ProtocolCurrent) |
| + owner := r.inst.Cookie() |
| + project := r.project() |
| + q := r.openQuestion("n1", "I can't find anything called Patrix. Where does it live?") |
| + if err := r.inst.DB.G.Exec("INSERT INTO chat_cards (id, person, kind, state, project_id, name, question, options, undo, revision, created_at, updated_at, lane) VALUES ('c_ships', ?, ?, ?, ?, 'Sample', 'Does merging to Sample''s main branch ship to users?', '[\"ships\",\"not_ships\"]', '{\"policy_revision\":0}', 1, datetime('now'), datetime('now'), '')", Owner, wire.CardMergeShips, wire.CardOpen, project).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + |
| + page := r.get(owner, "/tasks?needs=you", http.StatusOK) |
| + for _, want := range []string{ |
| + `<h1>Needs you</h1><p><b>2</b> for you · <b>1</b> holding up work</p>`, |
| + `<section equipo-group data-group="blocking"><h2>Holding up work <span equipo-n>1</span><span equipo-hint>Work stops here until you decide.</span></h2>`, |
| + `<section equipo-group data-group="settings"><h2>Project settings <span equipo-n>1</span><span equipo-hint>Nothing waits on these. Answer once and Equipo remembers.</span></h2>`, |
| + `<small equipo-count data-count data-attention>2</small>`, |
| + } { |
| + if !strings.Contains(page, want) { |
| + t.Fatalf("Needs you lacks %q:\n%s", want, page) |
| + } |
| + } |
| + if strings.Contains(page, "equipo-tcols") || strings.Contains(page, `data-group="others"`) || strings.Contains(page, "<h2>I can") || strings.Contains(page, "<h2>Does merging") { |
| + t.Fatalf("a column header, an empty group, or a question as a heading:\n%s", page) |
| + } |
| + if strings.Index(page, `data-group="blocking"`) > strings.Index(page, `data-group="settings"`) { |
| + t.Fatal("Project settings before Holding up work") |
| + } |
| + |
| + // The coordinator's question: its mark, its words at task-title size, |
| + // who asked, why it waits, a reply box with Send, No longer needed and |
| + // the conversation. |
| + card := needsCardHTML(t, page, q.ID) |
| + for _, want := range []string{ |
| + `<span equipo-mono data-kind="coordinator" aria-hidden="true">`, |
| + `<p equipo-d-q>I can't find anything called Patrix. Where does it live?</p><div equipo-quiet>Your coordinator · `, |
| + `<p equipo-d-why>Your coordinator stopped to ask. Nothing on this moves until you reply.</p>`, |
| + `<form method="post" action="/conversation/cards/` + q.ID + `/answer" equipo-reply data-draft-key="needs-` + q.ID + `">`, |
| + `<input type="hidden" name="from" value="needs">`, |
| + `placeholder="Your answer"`, |
| + `<button equipo-btn data-primary type="submit">Send</button>`, |
| + `action="/conversation/cards/` + q.ID + `/dismiss"`, |
| + `data-needs-dismiss>No longer needed</button>`, |
| + `href="/conversation?card=` + q.ID + `#card-` + q.ID + `">Open the conversation</a>`, |
| + } { |
| + if !strings.Contains(card, want) { |
| + t.Fatalf("the question card lacks %q:\n%s", want, card) |
| + } |
| + } |
| + // The ships question: the project's mark, quiet, both answers equal, |
| + // what answering does. |
| + ships := needsCardHTML(t, page, "c_ships") |
| + for _, want := range []string{ |
| + `data-tone="quiet"`, |
| + `<span equipo-mono data-h=`, |
| + `<p equipo-d-q>Does merging to Sample's main branch ship to users?</p><div equipo-quiet>Sample · asked `, |
| + `<p equipo-d-why>Until you answer, Equipo asks you before it merges anything here without checks.</p>`, |
| + `<button equipo-btn type="submit" name="choice" value="ships" data-needs-choice="ships">It ships</button>`, |
| + `<button equipo-btn type="submit" name="choice" value="not_ships" data-needs-choice="not_ships">It doesn't</button>`, |
| + `<span equipo-d-after>Saved to Sample's merge settings.</span>`, |
| + `<form method="post" action="/conversation/cards/c_ships/answer"><input type="hidden" name="revision" value="1"><input type="hidden" name="from" value="needs">`, |
| + } { |
| + if !strings.Contains(ships, want) { |
| + t.Fatalf("the ships card lacks %q:\n%s", want, ships) |
| + } |
| + } |
| + if strings.Contains(ships, "data-primary") || strings.Contains(ships, "/dismiss") { |
| + t.Fatalf("the ships card has a primary answer or No longer needed:\n%s", ships) |
| + } |
| + |
| + // Answered in place from Needs you: the policy is set, and the page |
| + // comes back. |
| + status, at := r.post(owner, "/conversation/cards/c_ships/answer", url.Values{"choice": {wire.ChoiceNotShips}, "revision": {"1"}, "from": {"needs"}}) |
| + if status != http.StatusSeeOther || at != "/tasks?needs=you" { |
| + t.Fatalf("ships answer: %d %q", status, at) |
| + } |
| + if p, err := r.client.MergePolicy(r.ctx, project); err != nil || p.MainShips != "no" { |
| + t.Fatalf("policy %+v %v", p, err) |
| + } |
| + // A free-text reply reaches the conversation as the person's words |
| + // and closes the question. |
| + reply := "It lives in oficina/sample" |
| + status, at = r.post(owner, "/conversation/cards/"+q.ID+"/answer", url.Values{"choice": {reply}, "revision": {itoa(int(q.Revision))}, "from": {"needs"}}) |
| + if status != http.StatusSeeOther || at != "/tasks?needs=you" { |
| + t.Fatalf("reply: %d %q", status, at) |
| + } |
| + if state, choice, _ := r.cardState(q.ID); state != wire.CardAnswered || choice != reply { |
| + t.Fatalf("replied card %s %q", state, choice) |
| + } |
| + if n := r.rows("SELECT count(*) FROM chat_messages WHERE person = ? AND role = ? AND coalesce(lane, '') = '' AND text LIKE ?", Owner, wire.RolePerson, "%"+reply+"%"); n != 1 { |
| + t.Fatalf("%d person messages with the reply", n) |
| + } |
| + |
| + // Nothing left: the empty line, no groups, no count. |
| + page = r.get(owner, "/tasks?needs=you", http.StatusOK) |
| + if !strings.Contains(page, "<p>Nothing needs you right now.</p>") || strings.Contains(page, "<section equipo-group") || strings.Contains(page, "data-attention>") { |
| + t.Fatalf("empty Needs you:\n%s", page) |
| + } |
| +} |