UX1 round 2: honest summaries, source link, live relative times
A stopped step's summary names its reason once; a merge without checks says so. "From your conversation" opens the conversation at that message (older history loaded back to it), scrolled into view and highlighted. Relative times tick once a minute and after live swaps. Tests: TestTaskSummaryWords, page and browser checks. Staging notes for c14b833 in UX1-PROGRESS.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 files changed,
+216
−19
docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+2 −1docs/superpowers/plans/UX1-PROGRESS.md+35 −6internal/equipo/chat_page.go+2 −0internal/equipo/copy.go+2 −1internal/equipo/render.go+25 −1internal/equipo/static/chat-anchor.js+25 −0internal/equipo/static/equipo.css+5 −0internal/equipo/static/nav-stream.js+21 −0internal/equipo/static/work-stream.js+1 −0internal/equipo/templates/chrome.html+2 −2internal/equipo/templates/work_parts.html+1 −1internal/equipo/templates/work_project.html+2 −2internal/equipo/templates/work_projects.html+1 −1internal/equipo/templates/work_task.html+1 −1internal/equipo/work_pages.go+26 −0internal/equipo/work_views.go+10 −3internal/equipo/work_views_test.go+32 −0internal/thintest/gallery_test.go+12 −0internal/thintest/inner_browser_test.go+11 −0
CI passed — run details
Intent
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index 682ee926..9fe7aebe 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -4961,11 +4961,12 @@ records remain unchanged. |
| | `work.decide.cancel` | Cancel this task | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `work.summary.you` | you | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `work.summary.merged` | Merged into %s. Checks and review passed before it went in. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `work.summary.merged_unchecked` | Merged into %s without checks: Review approved it, and checks could not run here. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `work.summary.done` | Done. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `work.summary.folded` | Folded into %s. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `work.summary.cancelled` | Cancelled. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `work.summary.merging` | Approved and checked. Equipo is merging it now. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| -| `work.summary.stopped` | %s stopped (%s). It waits on %s. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `work.summary.stopped` | %s stopped: %s. It waits on %s. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `work.summary.running` | %s is on it now: %s. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `work.summary.unchecked` | Approved, but checks could not run here, so it waits on %s. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `work.summary.ready` | Fixed, checked and approved. Equipo merges it next. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
diff --git a/docs/superpowers/plans/UX1-PROGRESS.md b/docs/superpowers/plans/UX1-PROGRESS.md| index 981ec51d..fb5f665b 100644 |
| --- a/docs/superpowers/plans/UX1-PROGRESS.md |
| +++ b/docs/superpowers/plans/UX1-PROGRESS.md |
| @@ -117,6 +117,40 @@ pass". Conventions as in `SLICE1-PROGRESS.md` to `SLICE4C-PROGRESS.md`. |
| `internal/equipo` 13500, `internal/equipo/chat` 6800, |
| `internal/runner/thin` 8800. |
| +6. Merged `thin-v1-slice4c` final fixes at cfae4f8 (c5cadfb): the |
| + quiet Merge on a task left at Ready to merge (after Not now or Wait) |
| + joins the creator's ⋯ on rows and the task page; asking follows |
| + `ask_open` (14 days after a merge). Conflicts: `Task` keeps 4c's |
| + `ask_open` and `merge_offered`, then the UX1 fields; fixtures merged |
| + key by key; both API routes (`duplicate`, `merge`). |
| + |
| +7. Round 2 (coordinator, after staging c14b833): |
| + - Summaries: a stopped step reads "Checks stopped: the runner |
| + restarted. It waits on you." (not "Stopped:" twice); a merge without |
| + checks says so and never claims checks passed |
| + (`TestTaskSummaryWords`). |
| + - "From your conversation, 18:39" opens |
| + `/conversation?message=<id>#m-<id>`: the page loads older history |
| + back to that message when it is past the newest 50 (up to 1,000), |
| + and `chat-anchor.js` scrolls it to the middle and highlights it for |
| + four seconds (static under reduced motion). |
| + - Relative times tick on their own once a minute in the server's words |
| + (`data-at`, `data-format`, the words on the sidebar as |
| + `data-ago-formats`, no "%" in any page), and after each live swap. |
| + - Browser: the source link lands on the highlighted message in view; |
| + a relative time re-renders on the tick. |
| + |
| +## Staging |
| + |
| +Release c14b833 (built by `scripts/staging-thin.py build`, deployed with |
| +`--swap hold` at 12:05:14, serving 12:06:26, both runner units on |
| +c14b833 the same second). Rendered as the owner and the suite person on |
| +the live data: Tasks, Projects and Needs you 200 with six tasks (the |
| +older Woodstar and suite tasks: Ready with a merge decision, a stopped |
| +retry, a teammate's task "Waiting for Suite", three Done), each task page 200 |
| +with its track, timeline and summary; both runners online. Found the two |
| +summary lines fixed in item 7. |
| + |
| ## Decisions |
| - Needs you for the viewer: retry, review_blocked, fix_rounds, |
| @@ -136,11 +170,6 @@ pass". Conventions as in `SLICE1-PROGRESS.md` to `SLICE4C-PROGRESS.md`. |
| ## Open issues |
| -- The source link goes to `/conversation#m-<id>`; the conversation does |
| - not yet scroll to a message by fragment, and only loads its newest |
| - page. |
| -- Relative times ("12 min ago") are rendered by the server and refresh |
| - with the next event, not on their own. |
| - Times are server-formatted (UTC on staging), like the rest of the app. |
| - Version skew as before: an old instance refuses the runner's |
| `step_activity` frame and the catalog's new fields; install runners |
| @@ -149,7 +178,7 @@ pass". Conventions as in `SLICE1-PROGRESS.md` to `SLICE4C-PROGRESS.md`. |
| ## Copy for review |
| Accepted for now with the existing marker in `copy.go` and listed in the |
| -plan 3 inventory (159 strings, `work.*` and `nav.*`): stage track, |
| +plan 3 inventory (160 strings, `work.*` and `nav.*`; round 2 changed `work.summary.stopped` and added `work.summary.merged_unchecked`): stage track, |
| badges, chips, sources, groups and hints, filters, menu, decisions, |
| summaries, timeline, Details, projects, notes, spread and legend, |
| relative times and durations. See the inventory rows tagged "Thin v1 UX1 |
diff --git a/internal/equipo/chat_page.go b/internal/equipo/chat_page.go| index 5f51c807..b9a9e529 100644 |
| --- a/internal/equipo/chat_page.go |
| +++ b/internal/equipo/chat_page.go |
| @@ -143,6 +143,8 @@ func (a *application) chatPage(w http.ResponseWriter, r *http.Request) { |
| a.failure(w, r, chatError(err)) |
| return |
| } |
| + // A task's "From your conversation" link: older history up to it. |
| + snap.Messages = a.withMessage(ctx, address, snap.Messages, r.URL.Query().Get("message")) |
| data, err := a.page(r, "conversation") |
| if err != nil { |
| a.failure(w, r, err) |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 5f591f65..5e708cab 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -682,11 +682,12 @@ var pageCopy = map[string]string{ |
| "work.decide.cancel": "Cancel this task", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "work.summary.you": "you", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "work.summary.merged": "Merged into %s. Checks and review passed before it went in.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "work.summary.merged_unchecked": "Merged into %s without checks: Review approved it, and checks could not run here.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "work.summary.done": "Done.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "work.summary.folded": "Folded into %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "work.summary.cancelled": "Cancelled.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "work.summary.merging": "Approved and checked. Equipo is merging it now.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| - "work.summary.stopped": "%s stopped (%s). It waits on %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "work.summary.stopped": "%s stopped: %s. It waits on %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "work.summary.running": "%s is on it now: %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "work.summary.unchecked": "Approved, but checks could not run here, so it waits on %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "work.summary.ready": "Fixed, checked and approved. Equipo merges it next.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
diff --git a/internal/equipo/render.go b/internal/equipo/render.go| index 0c1f9658..e68c8cc6 100644 |
| --- a/internal/equipo/render.go |
| +++ b/internal/equipo/render.go |
| @@ -4,9 +4,12 @@ import ( |
| "amadan.net/oficina/equipo/internal/chatmarkdown" |
| "bytes" |
| "embed" |
| + "encoding/json" |
| "fmt" |
| + "html" |
| "html/template" |
| "net/http" |
| + "strings" |
| "time" |
| "amadan.net/rastrillo/rastrillo" |
| @@ -33,7 +36,7 @@ func init() { |
| for _, name := range []string{"person_devices", "person_device", "teams", "onboarding", "invite", "playbooks", "playbook_form", "playbook_diff", "specialist_form", "template_library", "template_diff", "conversation", "chat", "thread", "plan", "coordinator", "preferences", "index", "empty", "projects", "project", "project_form", "people", "settings", "specialist", "errors", "signin_page", "form_error", "runners", "tasks", "task", "task_form", "question", "merge", "connections", "recovery", "recovery_form", "rendered_approval", "notebook", "work_tasks", "work_task", "work_projects", "work_project", "work_needs"} { |
| page := template.Must(template.New("layout"). |
| Funcs(ui.Funcs(ui.WithIcons(icons.Icon, icons.Assets))). |
| - Funcs(template.FuncMap{"chatMarkdown": chatmarkdown.Render, "since": sinceMillis, "elapsed": elapsedText, "short": short, "projectAllows": library.ProjectAllowed, "asset": assets.Path, "copy": copyText, "taskGroups": func() []string { return []string{"needs-person", "running", "queued", "finished"} }, |
| + Funcs(template.FuncMap{"chatMarkdown": chatmarkdown.Render, "since": sinceMillis, "elapsed": elapsedText, "short": short, "agoData": agoData, "agoFormats": agoFormats, "projectAllows": library.ProjectAllowed, "asset": assets.Path, "copy": copyText, "taskGroups": func() []string { return []string{"needs-person", "running", "queued", "finished"} }, |
| "kindKey": func(k ProjectKind) string { return "kind." + string(k) }, |
| "ownerKey": func(k string) string { return "owner." + k }, |
| "roleKey": func(k Role) string { return "role." + string(k) }, |
| @@ -110,3 +113,24 @@ func elapsedText(v any) string { |
| } |
| return fmt.Sprintf("%d:%02d", s/60, s%60) |
| } |
| + |
| +// agoData marks a relative time for nav-stream.js to keep current: its |
| +// instant and, when the words wrap it ("Changed %s"), the wrapping. |
| +func agoData(v any, key string) template.HTMLAttr { |
| + format := "{t}" |
| + if key != "" { |
| + format = strings.Replace(copyText(key), "%s", "{t}", 1) |
| + } |
| + return template.HTMLAttr(fmt.Sprintf(` data-at="%d" data-format="%s"`, sinceMillis(v), html.EscapeString(format))) |
| +} |
| + |
| +// agoFormats are the relative time's words for the client, with {n} for |
| +// the number. |
| +func agoFormats() string { |
| + out := map[string]string{} |
| + for _, k := range []string{"now", "minutes", "hours", "yesterday", "days"} { |
| + out[k] = strings.Replace(copyText("work.ago."+k), "%d", "{n}", 1) |
| + } |
| + raw, _ := json.Marshal(out) |
| + return string(raw) |
| +} |
diff --git a/internal/equipo/static/chat-anchor.js b/internal/equipo/static/chat-anchor.js| new file mode 100644 |
| index 00000000..a6bc5ba8 |
| --- /dev/null |
| +++ b/internal/equipo/static/chat-anchor.js |
| @@ -0,0 +1,25 @@ |
| +// A task's "From your conversation, 18:39" link opens the conversation |
| +// at that message (/conversation?message=<id>#m-<id>): it is scrolled to |
| +// the middle of the feed and highlighted for a moment. The server has |
| +// already loaded the history back to it. |
| +(function () { |
| + "use strict"; |
| + var m = /^#m-(.+)$/.exec(location.hash); |
| + if (!m) return; |
| + var id = decodeURIComponent(m[1]); |
| + function show() { |
| + var el = [].find.call(document.querySelectorAll("[data-message]"), function (e) { return e.getAttribute("data-message") === id; }); |
| + if (!el) return; |
| + var scroll = el.closest("[equipo-scroll]"); |
| + if (scroll) { |
| + scroll.scrollTop += el.getBoundingClientRect().top - scroll.getBoundingClientRect().top - Math.max(0, (scroll.clientHeight - el.offsetHeight) / 2); |
| + scroll.dispatchEvent(new Event("scroll")); |
| + } else { |
| + el.scrollIntoView({ block: "center" }); |
| + } |
| + el.setAttribute("data-highlight", ""); |
| + setTimeout(function () { el.removeAttribute("data-highlight"); }, 4000); |
| + } |
| + if (document.readyState === "complete") show(); |
| + else window.addEventListener("load", show, { once: true }); |
| +})(); |
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css| index f63bf6d5..5b1c3b59 100644 |
| --- a/internal/equipo/static/equipo.css |
| +++ b/internal/equipo/static/equipo.css |
| @@ -689,3 +689,8 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [rst-shell-sidebar~="index"] [equipo-spec] > summary .icon:first-child { color: var(--rst-accent); } |
| [rst-shell-sidebar~="index"] [equipo-spec-panel] { margin: 0 var(--rst-sp-3) var(--rst-sp-3) calc(1rem + 1em + var(--rst-sp-3)); font-size: var(--rst-fs-sm); } |
| } |
| +/* The message a task was noted from, opened from the task: a soft tint |
| + that fades. */ |
| +[equipo-message] { transition: background-color 1.2s ease, box-shadow 1.2s ease; border-radius: calc(2 * var(--rst-radius)); } |
| +[equipo-message][data-highlight] { background-color: color-mix(in oklab, var(--rst-accent-soft) 70%, transparent); box-shadow: 0 0 0 .5rem color-mix(in oklab, var(--rst-accent-soft) 70%, transparent); transition: none; } |
| +@media (prefers-reduced-motion: reduce) { [equipo-message] { transition: none; } } |
diff --git a/internal/equipo/static/nav-stream.js b/internal/equipo/static/nav-stream.js| index 837e3c9d..e7fe6729 100644 |
| --- a/internal/equipo/static/nav-stream.js |
| +++ b/internal/equipo/static/nav-stream.js |
| @@ -40,6 +40,27 @@ |
| } |
| tick(); |
| setInterval(tick, 1000); |
| + // Relative times ("12 min ago") keep current on their own, once a |
| + // minute, in the server's words. |
| + var words = {}; |
| + try { words = JSON.parse((rail && rail.dataset.agoFormats) || "{}"); } catch (e) {} |
| + function ago(ms) { |
| + var d = Date.now() - ms, M = 60000, H = 60 * M, D = 24 * H; |
| + if (d < M) return words.now; |
| + if (d < H) return words.minutes.replace("{n}", String(Math.round(d / M))); |
| + if (d < D) return words.hours.replace("{n}", String(Math.round(d / H))); |
| + if (d < 2 * D) return words.yesterday; |
| + return words.days.replace("{n}", String(Math.floor(d / D))); |
| + } |
| + function ages() { |
| + if (!words.now) return; |
| + document.querySelectorAll("[equipo-ago][data-at]").forEach(function (el) { |
| + var ms = Number(el.dataset.at); |
| + if (ms) el.textContent = (el.dataset.format || "{t}").replace("{t}", ago(ms)); |
| + }); |
| + } |
| + window.equipoAges = ages; |
| + setInterval(ages, 60000); |
| // Now and then the larger marks flourish, never under reduced motion. |
| var still = window.matchMedia && matchMedia("(prefers-reduced-motion: reduce)"); |
| setInterval(function () { |
diff --git a/internal/equipo/static/work-stream.js b/internal/equipo/static/work-stream.js| index ff652bd3..2b32690f 100644 |
| --- a/internal/equipo/static/work-stream.js |
| +++ b/internal/equipo/static/work-stream.js |
| @@ -31,6 +31,7 @@ |
| for (var i = had; had > 0 && i < items.length; i++) items[i].setAttribute("data-new", ""); |
| if (focus) { var f = next.querySelector('a[href="' + CSS.escape(focus) + '"]'); if (f) f.focus(); } |
| }); |
| + if (window.equipoAges) window.equipoAges(); |
| var title = doc.querySelector("title"); |
| if (title) document.title = title.textContent; |
| }); |
diff --git a/internal/equipo/templates/chrome.html b/internal/equipo/templates/chrome.html| index 313194fd..a635ab58 100644 |
| --- a/internal/equipo/templates/chrome.html |
| +++ b/internal/equipo/templates/chrome.html |
| @@ -1,12 +1,12 @@ |
| {{define "rail-brand"}}<span hidden></span>{{end}} |
| {{define "title"}}{{copy .Title}} · {{copy "brand"}}{{end}} |
| -{{define "head"}}{{.Live.Head (T "rastrillo.ui.live.paused") (T "rastrillo.ui.live.unconfirmed")}}<link rel="stylesheet" href="{{asset "static/equipo.css"}}"><script defer src="{{asset "static/nav-stream.js"}}"></script><script defer src="{{asset "static/work-stream.js"}}"></script>{{if .ChatStream}}<script defer src="{{asset "static/chat-stream.js"}}"></script><script defer src="{{asset "static/chat-compose.js"}}"></script><script defer src="{{asset "static/ask-target.js"}}"></script>{{else if eq .Key "conversation"}}<script defer blocking="render" src="{{asset "static/chat-navigation.js"}}"></script><script defer src="{{asset "static/chat.js"}}"></script><script defer src="{{asset "static/chat-send.js"}}"></script>{{end}}{{end}} |
| +{{define "head"}}{{.Live.Head (T "rastrillo.ui.live.paused") (T "rastrillo.ui.live.unconfirmed")}}<link rel="stylesheet" href="{{asset "static/equipo.css"}}"><script defer src="{{asset "static/nav-stream.js"}}"></script><script defer src="{{asset "static/work-stream.js"}}"></script>{{if .ChatStream}}<script defer src="{{asset "static/chat-stream.js"}}"></script><script defer src="{{asset "static/chat-compose.js"}}"></script><script defer src="{{asset "static/ask-target.js"}}"></script>{{if eq .Key "conversation"}}<script defer src="{{asset "static/chat-anchor.js"}}"></script>{{end}}{{else if eq .Key "conversation"}}<script defer blocking="render" src="{{asset "static/chat-navigation.js"}}"></script><script defer src="{{asset "static/chat.js"}}"></script><script defer src="{{asset "static/chat-send.js"}}"></script>{{end}}{{end}} |
| {{define "up"}}/work{{if .Key}}#nav-{{.Key}}{{end}}{{end}} |
| {{define "up-label"}}{{.TeamName}}{{end}} |
| {{define "brand"}}<a rst-shell-brand href="/work">{{icon "users"}}{{.TeamName}}</a>{{end}} |
| {{define "nav"}} |
| {{template "region:rail" .}}{{end}} |
| -{{define "region:rail"}}<nav rst-shell-nav id="rail" data-nav-stream data-cursor="{{.Rail.Cursor}}" data-key="{{.Key}}"> |
| +{{define "region:rail"}}<nav rst-shell-nav id="rail" data-nav-stream data-cursor="{{.Rail.Cursor}}" data-key="{{.Key}}" data-ago-formats="{{agoFormats}}"> |
| <div equipo-team-heading>{{template "brand" .}}</div> |
| {{$key := .Key}}{{$rail := .Rail}} |
| {{range .Nav}}{{if eq .Group "team"}}{{template "rail-specialists" $rail}}<p equipo-nav-group>{{copy "nav.team"}}</p>{{end}}<a id="nav-{{.Key}}" href="{{.Href}}"{{if eq .Key $key}} aria-current="page"{{end}}>{{icon .Icon}}<span>{{copy .CopyKey}}</span>{{if eq .Key "tasks"}}{{template "rail-count" $rail.Tasks}}{{else if eq .Key "projects"}}{{template "rail-count" $rail.Projects}}{{else if eq .Key "needs-you"}}{{template "rail-count-attention" $rail.Needs}}{{end}}</a> |
diff --git a/internal/equipo/templates/work_parts.html b/internal/equipo/templates/work_parts.html| index a9155d9d..e736c651 100644 |
| --- a/internal/equipo/templates/work_parts.html |
| +++ b/internal/equipo/templates/work_parts.html |
| @@ -23,7 +23,7 @@ |
| <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>{{template "task-menu" (dict "ID" .ID "Menu" .Menu "From" "tasks")}}<span equipo-ago title="{{.Changed.Format "2006-01-02 15:04"}}">{{.Ago}}</span></span><span equipo-badges>{{range .Badges}}{{template "badge" .}}{{end}}</span></div> |
| +<div equipo-row-side><span equipo-row-top>{{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}}"> |
diff --git a/internal/equipo/templates/work_project.html b/internal/equipo/templates/work_project.html| index 767a1c11..b352e11b 100644 |
| --- a/internal/equipo/templates/work_project.html |
| +++ b/internal/equipo/templates/work_project.html |
| @@ -10,8 +10,8 @@ |
| <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> |
| <aside> |
| -<section equipo-p-section><h2>{{copy "work.project.attachments"}}</h2><ul equipo-attach>{{range .Repos}}<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 .Ago}}<span>{{.}}</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 datetime="{{.At.Format "2006-01-02T15:04:05Z07:00"}}">{{.Ago}}</time><span>{{template "recent" .}}</span></li>{{end}}</ol></section>{{end}} |
| +<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}} |
| <section equipo-p-section><h2>{{copy "work.project.notes"}}</h2>{{if $.Thin.Notes}}<ul equipo-notes>{{range $.Thin.Notes}}<li equipo-note2><p>{{.Text}}</p><p equipo-cap>{{.From}}</p></li>{{end}}</ul>{{else}}<p equipo-quiet>{{copy "work.project.notes_empty"}}</p>{{end}}</section> |
| </aside> |
| </div> |
diff --git a/internal/equipo/templates/work_projects.html b/internal/equipo/templates/work_projects.html| index f405d54c..31343ed7 100644 |
| --- a/internal/equipo/templates/work_projects.html |
| +++ b/internal/equipo/templates/work_projects.html |
| @@ -13,5 +13,5 @@ |
| {{with .Description}}<p equipo-desc>{{.}}</p>{{end}} |
| <p equipo-facts>{{template "project-facts" .}}{{if .People}}<span equipo-avs>{{range .People}}{{template "av" .}}{{end}}</span>{{end}}</p> |
| </div> |
| -<div equipo-row-side><span equipo-ago>{{.Last}}</span><span equipo-spread><span equipo-bar>{{range .Spread}}<i data-k="{{.Key}}" style="inline-size:{{.Width}}" title="{{.Title}}"></i>{{end}}</span><a href="/tasks?project={{.ID}}" equipo-n>{{if eq .Tasks 1}}{{copy "work.project.one_task"}}{{else}}{{printf (copy "work.project.tasks") .Tasks}}{{end}}</a></span>{{with .Words}}<span equipo-quiet>{{.}}</span>{{end}}</div> |
| +<div equipo-row-side>{{if .Last}}<span equipo-ago{{agoData .LastAt ""}}>{{.Last}}</span>{{end}}<span equipo-spread><span equipo-bar>{{range .Spread}}<i data-k="{{.Key}}" style="inline-size:{{.Width}}" title="{{.Title}}"></i>{{end}}</span><a href="/tasks?project={{.ID}}" equipo-n>{{if eq .Tasks 1}}{{copy "work.project.one_task"}}{{else}}{{printf (copy "work.project.tasks") .Tasks}}{{end}}</a></span>{{with .Words}}<span equipo-quiet>{{.}}</span>{{end}}</div> |
| </li>{{end}} |
diff --git a/internal/equipo/templates/work_task.html b/internal/equipo/templates/work_task.html| index 2a6fa002..ca06a682 100644 |
| --- a/internal/equipo/templates/work_task.html |
| +++ b/internal/equipo/templates/work_task.html |
| @@ -6,7 +6,7 @@ |
| <div> |
| <p equipo-crumbs><a href="/tasks">{{copy "nav.tasks"}}</a><span aria-hidden="true">›</span><a href="/projects/{{.ProjectID}}">{{.Project}}</a></p> |
| <h1>{{.Title}}</h1> |
| -<div equipo-filed>{{template "who" .Creator}}{{template "source" .}}<span equipo-ago title="{{.Changed.Format "2006-01-02 15:04"}}">{{printf (copy "work.changed") .Ago}}</span>{{template "task-menu" (dict "ID" .ID "Menu" .Menu "From" "task")}}</div> |
| +<div equipo-filed>{{template "who" .Creator}}{{template "source" .}}<span equipo-ago{{agoData .Changed "work.changed"}} title="{{.Changed.Format "2006-01-02 15:04"}}">{{printf (copy "work.changed") .Ago}}</span>{{template "task-menu" (dict "ID" .ID "Menu" .Menu "From" "task")}}</div> |
| </div> |
| {{template "track-full" .}} |
| <p equipo-t-summary data-summary>{{if .Live}}{{template "mark" ""}}{{end}}<span data-stage-line>{{.Summary}}</span></p> |
diff --git a/internal/equipo/work_pages.go b/internal/equipo/work_pages.go| index 0b31b6b9..537195af 100644 |
| --- a/internal/equipo/work_pages.go |
| +++ b/internal/equipo/work_pages.go |
| @@ -202,6 +202,7 @@ type projectLine struct { |
| Words string |
| People []personLine |
| Last string |
| + LastAt time.Time |
| Repos []repoLine |
| StackLine string |
| } |
| @@ -593,6 +594,31 @@ func workBack(r *http.Request, id string) string { |
| var taskIDPattern = regexp.MustCompile(`^tk[a-z0-9]{1,40}$`) |
| +// withMessage extends the conversation's newest messages back to want |
| +// (at most 1,000 older ones), so a task's link to the message it was |
| +// noted from finds it. |
| +func (a *application) withMessage(ctx context.Context, address string, msgs []wire.Message, want string) []wire.Message { |
| + has := func(ms []wire.Message) bool { |
| + return slices.ContainsFunc(ms, func(m wire.Message) bool { return m.ID == want }) |
| + } |
| + if want == "" || len(msgs) == 0 || has(msgs) { |
| + return msgs |
| + } |
| + before := msgs[0].ID |
| + for range 5 { |
| + page, err := a.store.Chat().Messages(ctx, address, before, 200) |
| + if err != nil || len(page.Items) == 0 { |
| + return msgs |
| + } |
| + msgs = append(append([]wire.Message{}, page.Items...), msgs...) |
| + if has(page.Items) || page.Before == "" { |
| + return msgs |
| + } |
| + before = page.Before |
| + } |
| + return msgs |
| +} |
| + |
| // workDuplicate folds the task into the open task it duplicates: the |
| // creator's one tap, the same MarkDuplicate a device makes. |
| func (a *application) workDuplicate(w http.ResponseWriter, r *http.Request) { |
diff --git a/internal/equipo/work_views.go b/internal/equipo/work_views.go| index bc53a2fc..fa5c3062 100644 |
| --- a/internal/equipo/work_views.go |
| +++ b/internal/equipo/work_views.go |
| @@ -3,6 +3,7 @@ package equipo |
| import ( |
| "fmt" |
| "hash/fnv" |
| + "net/url" |
| "slices" |
| "strings" |
| "time" |
| @@ -377,7 +378,7 @@ func (v *taskLine) richOf(t wire.Task, viewer string, card *wire.Card, now time. |
| if v.Mine { |
| v.Source = fmt.Sprintf(copyText("work.source.yours"), v.SourceAt.Format("15:04")) |
| if t.SourceMessageID != "" { |
| - v.SourceHref = "/conversation#m-" + t.SourceMessageID |
| + v.SourceHref = "/conversation?message=" + url.QueryEscape(t.SourceMessageID) + "#m-" + url.PathEscape(t.SourceMessageID) |
| } |
| } else { |
| v.Source = fmt.Sprintf(copyText("work.source.theirs"), v.Creator.Name, v.SourceAt.Format("15:04")) |
| @@ -499,6 +500,8 @@ func summaryOf(t wire.Task, v taskLine) string { |
| waiter = v.Creator.Name |
| } |
| switch { |
| + case t.Stage == wire.StageDone && t.Merged != nil && t.Merged.WithoutChecks: |
| + return fmt.Sprintf(copyText("work.summary.merged_unchecked"), t.Merged.Into) |
| case t.Stage == wire.StageDone && t.Merged != nil: |
| return fmt.Sprintf(copyText("work.summary.merged"), t.Merged.Into) |
| case t.Stage == wire.StageDone: |
| @@ -510,7 +513,11 @@ func summaryOf(t wire.Task, v taskLine) string { |
| case t.Stage == wire.StageMerging: |
| return copyText("work.summary.merging") |
| case v.Stopped != nil: |
| - return fmt.Sprintf(copyText("work.summary.stopped"), specialistName(v.Stopped.Specialist), v.StageLine, waiter) |
| + reason := copyText("work.reason." + v.Stopped.Reason) |
| + if reason == "" { |
| + reason = copyText("work.reason.other") |
| + } |
| + return fmt.Sprintf(copyText("work.summary.stopped"), specialistName(v.Stopped.Specialist), reason, waiter) |
| case v.Running != nil: |
| return fmt.Sprintf(copyText("work.summary.running"), specialistName(v.Running.Specialist), strings.ToLower(lastActivity(v.Running))) |
| case t.NeedsYou == wire.NeedsMerge && v.Card != nil || !v.Mine && t.Stage == wire.StageReadyToMerge && (t.Checks == wire.ChecksCannotRun || t.Checks == wire.ChecksNone): |
| @@ -745,7 +752,7 @@ func projectLineOf(p wire.Project, tasks []taskLine, viewer string, now time.Tim |
| } |
| } |
| if !last.IsZero() { |
| - line.Last = ago(now, last) |
| + line.Last, line.LastAt = ago(now, last), last |
| } |
| var words []string |
| for _, k := range workGroups { |
diff --git a/internal/equipo/work_views_test.go b/internal/equipo/work_views_test.go| new file mode 100644 |
| index 00000000..eb63f048 |
| --- /dev/null |
| +++ b/internal/equipo/work_views_test.go |
| @@ -0,0 +1,32 @@ |
| +package equipo |
| + |
| +import ( |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// The task page's one line says what happened in words: a stopped step |
| +// with its reason (never "Stopped:" twice), and a merge without checks |
| +// never claims they passed. |
| +func TestTaskSummaryWords(t *testing.T) { |
| + now := time.Now() |
| + stopped := wire.Task{ID: "tk1", Creator: "a@example.com", Stage: wire.StageInReview, Steps: []wire.Step{{Specialist: wire.SpecialistChecks, State: wire.StepFailed, Reason: "runner_restarted", Attempt: 1, Terminated: true}}, NeedsYou: wire.NeedsRetry} |
| + v := taskLineOf(stopped, "a@example.com") |
| + v.richOf(stopped, "a@example.com", nil, now) |
| + if got := summaryOf(stopped, v); got != "Checks stopped: the runner restarted. It waits on you." { |
| + t.Fatalf("stopped: %q", got) |
| + } |
| + merged := wire.Task{ID: "tk2", Creator: "a@example.com", Stage: wire.StageDone, Merged: &wire.Merged{SHA: strings.Repeat("e", 40), Into: "main", WithoutChecks: true, At: now}} |
| + v = taskLineOf(merged, "b@example.com") |
| + v.richOf(merged, "b@example.com", nil, now) |
| + if got := summaryOf(merged, v); strings.Contains(got, "passed") || !strings.Contains(got, "without checks") { |
| + t.Fatalf("merged without checks: %q", got) |
| + } |
| + merged.Merged.WithoutChecks = false |
| + if got := summaryOf(merged, v); got != "Merged into main. Checks and review passed before it went in." { |
| + t.Fatalf("merged: %q", got) |
| + } |
| +} |
diff --git a/internal/thintest/gallery_test.go b/internal/thintest/gallery_test.go| index 6579284a..2f51b1ca 100644 |
| --- a/internal/thintest/gallery_test.go |
| +++ b/internal/thintest/gallery_test.go |
| @@ -208,6 +208,18 @@ func TestPagesInnerScreens(t *testing.T) { |
| if strings.Count(ready, "data-open-amadan") != 1 || strings.Index(ready, "data-open-amadan") < strings.Index(ready, "equipo-details") { |
| t.Fatal("Open on Amadan outside Details") |
| } |
| + stopped := a.get(owner, "/tasks/"+g.stopped, 200) |
| + has(stopped, "stopped task", "Engineering stopped: the runner restarted. It waits on you.") |
| + not(stopped, "stopped task", "(Stopped:") |
| + // The source link opens the conversation at that message; relative |
| + // times carry their instant so they keep current. |
| + src := a.conv.Tasks[g.unchecked].SourceMessageID |
| + if src == "" { |
| + t.Fatal("no source message") |
| + } |
| + has(ready, "unchecked task", `href="/conversation?message=`+src+`#m-`+src+`"`, `equipo-ago data-at="`, `data-format="Changed {t}"`) |
| + has(a.get(owner, "/conversation?message="+src, 200), "conversation", `data-message="`+src+`"`) |
| + has(tasks, "Tasks", `data-ago-formats="{"days":"{n} days ago"`) |
| done := a.get(owner, "/tasks/"+g.nora, 200) |
| has(done, "merged task", "Merged into main. Checks and review passed before it went in.", `<li data-kind="merged">`, "<b>Merged into main</b>", "c7d0a52. The coordinator told Nora in the conversation.") |
| not(done, "merged task", "data-task-cancel", "data-task-retry") |
diff --git a/internal/thintest/inner_browser_test.go b/internal/thintest/inner_browser_test.go| index 3808eba6..f94cb677 100644 |
| --- a/internal/thintest/inner_browser_test.go |
| +++ b/internal/thintest/inner_browser_test.go |
| @@ -250,6 +250,17 @@ func TestBrowserInnerScreens(t *testing.T) { |
| p.check(`document.querySelectorAll('[equipo-decision]').length===2`, "two decisions") |
| p.check(`(()=>{const b=document.querySelector('[data-decision="`+g.unchecked+`"] [data-merge-choice="merge"]').getBoundingClientRect();return b.width>0 && b.height>=`+map[bool]string{true: "44", false: "30"}[size.touch]+`})()`, "Merge out of reach") |
| p.fits("needs") |
| + |
| + // Relative times keep current on their own (the minute tick). |
| + p.check(`(()=>{const e=document.querySelector('[equipo-ago][data-at]');e.dataset.at=String(Date.now()-5*60000-1000);window.equipoAges();return e.textContent==='5 min ago'})()`, "relative time did not tick") |
| + |
| + // "From your conversation" opens the conversation at that message, |
| + // in view and highlighted. |
| + p.open("/tasks/" + g.unchecked) |
| + src := a.conv.Tasks[g.unchecked].SourceMessageID |
| + p.check(`(()=>{const l=document.querySelector('#task-head a[equipo-source]');l.click();return true})()`, "source link") |
| + p.wait(`location.pathname==='/conversation' && document.querySelector('[data-message="`+src+`"]')?.hasAttribute('data-highlight')`, "the highlighted source message") |
| + p.check(`(()=>{const r=document.querySelector('[data-message="`+src+`"]').getBoundingClientRect();return r.top>=0 && r.bottom<=innerHeight})()`, "source message out of view") |
| p.stop() |
| } |