oficina / equipo Public

Preserve report completion details and refresh action feedback

codex agent, operated by paul@keymail.dev pushed by paul@keymail.dev 15e97495aa1944d9c53641aa93c4e2d88966eeea parent fe309cf
6 files changed, +18 −8
  • .rastrillo/budgets.txt +1 −1
  • internal/equipo/static/chat-stream.js +6 −3
  • internal/equipo/templates/chat.html +1 −1
  • internal/headless/browser_tasks_test.go +2 −2
  • internal/plan3test/plan3_release_test.go +2 −1
  • internal/thintest/report_actions_browser_test.go +6 −0

CI passed — run details

diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index b71dd1e8..d15e29d6 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -71,7 +71,7 @@ perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one 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 - 11062 End-to-end scenarios through a real runner and instance: Copy setting, the Assistant's job threads, streamed replies, warm start, glance. Measured 11062 test lines.
-size internal/thintest - 29444 Shared instance harness; report state, feedback and thread tests at both widths and themes, including reload and historical isolation. Measured 29444 test lines.
+size internal/thintest - 29450 Shared instance harness; report state, feedback and thread tests at both widths and themes, including reload and historical isolation. Measured 29450 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}.
perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage.
perf GET /api/v1/advice skip Thin v1 person API: bearer-only JSON for devices; the browser reads advice through /usage and /conversation.
diff --git a/internal/equipo/static/chat-stream.js b/internal/equipo/static/chat-stream.js
index 3ad00cf8..4f2dff36 100644
--- a/internal/equipo/static/chat-stream.js
+++ b/internal/equipo/static/chat-stream.js
@@ -828,8 +828,11 @@
var report = card.querySelector("[data-report-thread]");
if (report && reportOpen.has(card.dataset.card)) { report.dataset.restored=""; report.open=reportOpen.get(card.dataset.card); }
card.querySelectorAll("[data-report-talk]").forEach(function(talk) { if (report) talk.setAttribute("aria-expanded", String(report.open)); });
- if (cardSuccess.has(card.dataset.card) && card.querySelector("[equipo-roster-links]")) {
- var status=document.createElement("p"); status.setAttribute("equipo-card-done", ""); status.setAttribute("role", "status"); status.textContent=cardSuccess.get(card.dataset.card);
+ var success=cardSuccess.get(card.dataset.card);
+ if (success && success.state && success.state!==card.dataset.state) { cardSuccess.delete(card.dataset.card); success=null; }
+ if (success && card.querySelector("[equipo-roster-links]")) {
+ success.state=card.dataset.state;
+ var status=document.createElement("p"); status.setAttribute("equipo-card-done", ""); status.setAttribute("role", "status"); status.textContent=success.label;
card.querySelector("[equipo-roster-links]").after(status);
}
var values = cardDrafts.get(card.dataset.card); if (!values) return;
@@ -1096,7 +1099,7 @@
fetch(f.action, { method: "POST", credentials: "same-origin", headers: { "Accept": "application/json" }, body: body })
.then(function (r) { if (!r.ok) throw new Error(r.status === 409 ? "stale" : "card");
if (id) { cardBusy.delete(id); if (body.get("aside") === null) { cardDrafts.delete(id); f.querySelectorAll("textarea").forEach(function (el) { el.value=""; }); } }
- if (id && button && button.dataset.successLabel) cardSuccess.set(id, button.dataset.successLabel);
+ if (id && button && button.dataset.successLabel) cardSuccess.set(id, {label:button.dataset.successLabel, state:button.dataset.successState});
if (f.matches("[equipo-turn-stop]")) return;
return refreshed();
}).then(function () {
diff --git a/internal/equipo/templates/chat.html b/internal/equipo/templates/chat.html
index 61774839..f41bf0e8 100644
--- a/internal/equipo/templates/chat.html
+++ b/internal/equipo/templates/chat.html
@@ -32,7 +32,7 @@
<div equipo-roster-report-head><span equipo-roster-stage equipo-stage data-stage="{{.Stage}}" data-tone="{{.RosterTone}}">{{.Eyebrow}}</span>{{if .NeedsYou}}<span equipo-needs-chip>{{icon "hand"}}{{copy "nav.needs-you"}}</span>{{end}}<h3 equipo-card-line><a href="/tasks/{{.ID}}">{{.Title}}</a></h3>{{if not $card.Compact}}{{with .Why}}<p equipo-roster-why>{{.}}</p>{{end}}{{end}}</div>
{{if not $card.Compact}}{{if and (ne .Stage "cancelled") (not $card.SlimReport)}}{{template "track-full" .}}{{end}}{{with $card.ExplorationSummary}}<p equipo-exploration-summary>{{.}}</p>{{end}}
<dl equipo-roster-facts>{{if .ChecksLine}}<div><dt>{{copy "roster.checks"}}</dt><dd data-checks>{{.RosterChecks}}</dd>{{with .RosterChecksDetail}}<small>{{.}}</small>{{end}}</div>{{end}}{{if .ReviewLine}}<div><dt>{{copy "roster.review"}}</dt><dd data-verdict>{{.RosterReview}}</dd>{{with .RosterReviewDetail}}<small>{{.}}</small>{{end}}</div>{{end}}{{if .Branch}}<div><dt>{{copy "roster.branch"}}</dt><dd><code title="{{.Branch}}">{{.Branch}}</code></dd><small title="{{.CandidateSHA}}">{{short .CandidateSHA}}</small></div>{{end}}</dl>
-{{if .MergeDropped}}<p equipo-card-note>{{copy "work.tl.merge_dropped"}}</p>{{end}}{{end}}<div equipo-roster-links>{{if not $card.Compact}}{{with $card.ReportAction}}{{if .Post}}<form method="post" action="{{.Post}}" data-card-form>{{if not $card.Job}}<input type="hidden" name="from" value="conversation">{{end}}{{if .CardID}}<input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="choice" value="merge">{{end}}{{template "card-job" $card}}<button rst-btn="primary" type="submit" data-report-next data-success-label="{{copy (printf "roster.%s_done" .Kind)}}" data-busy-label="{{copy (printf "roster.%s_busy" .Kind)}}">{{.Label}}</button></form>{{else}}<a rst-btn="primary" href="{{.Href}}" target="_blank" rel="noopener" data-report-next>{{.Label}}</a>{{end}}{{end}}{{end}}<button type="button" {{if $card.Compact}}equipo-link{{else}}rst-btn{{end}} data-report-talk aria-controls="report-thread-{{$card.ID}}" aria-expanded="{{if $card.Presentation.Thread}}true{{else}}false{{end}}">{{copy "roster.talk"}}</button>{{if not $card.Compact}}<a href="/tasks/{{.ID}}">{{copy "roster.open_task"}}</a>{{if and .Pushed (not .MergedLine)}}<a href="{{.URL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a>{{end}}{{if .MergedLine}}<a href="{{.RepoURL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a>{{end}}{{end}}</div>
+{{if .MergeDropped}}<p equipo-card-note>{{copy "work.tl.merge_dropped"}}</p>{{end}}{{end}}<div equipo-roster-links>{{if not $card.Compact}}{{with $card.ReportAction}}{{if .Post}}<form method="post" action="{{.Post}}" data-card-form>{{if not $card.Job}}<input type="hidden" name="from" value="conversation">{{end}}{{if .CardID}}<input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="choice" value="merge">{{end}}{{template "card-job" $card}}<button rst-btn="primary" type="submit" data-report-next data-success-state="{{if eq .Kind "round"}}in_progress{{else}}merging{{end}}" data-success-label="{{copy (printf "roster.%s_done" .Kind)}}" data-busy-label="{{copy (printf "roster.%s_busy" .Kind)}}">{{.Label}}</button></form>{{else}}<a rst-btn="primary" href="{{.Href}}" target="_blank" rel="noopener" data-report-next>{{.Label}}</a>{{end}}{{end}}{{end}}<button type="button" {{if $card.Compact}}equipo-link{{else}}rst-btn{{end}} data-report-talk aria-controls="report-thread-{{$card.ID}}" aria-expanded="{{if $card.Presentation.Thread}}true{{else}}false{{end}}">{{copy "roster.talk"}}</button>{{if not $card.Compact}}<a href="/tasks/{{.ID}}">{{copy "roster.open_task"}}</a>{{if and .Pushed (not .MergedLine)}}<a href="{{.URL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a>{{end}}{{if .MergedLine}}<span data-merged><span>{{.MergedLine}}</span> <a href="{{.RepoURL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a></span>{{end}}{{end}}</div>
{{template "report-thread" $card.ReportThread}}
</div>{{end}}{{end}}
{{define "message-files"}}{{with .}}<div equipo-message-files>{{range .}}{{if eq .Kind "image"}}<a equipo-file-thumb href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}"><img src="/conversation/attachments/{{.ID}}/preview" alt="{{.Name}}"{{if .Width}} width="{{.Width}}" height="{{.Height}}"{{end}} loading="lazy" decoding="async"></a>{{else}}<a equipo-file-chip href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}">{{icon "file-text"}}<span equipo-file-name>{{.Name}}</span><span equipo-file-size>{{fileSize .Size}}</span></a>{{end}}{{end}}</div>{{end}}{{end}}
diff --git a/internal/headless/browser_tasks_test.go b/internal/headless/browser_tasks_test.go
index 6e1fc89b..c11a6a45 100644
--- a/internal/headless/browser_tasks_test.go
+++ b/internal/headless/browser_tasks_test.go
@@ -37,9 +37,9 @@ func TestBrowserTaskCard(t *testing.T) {
p.send("tool:record_task:oficina/sample|Slow change|x\ntool:start_task:$task|stepsleep:20000 edit:README.md|teh|the")
slow := taskCard("Slow change")
- p.run(browsertest.Wait(`!!` + slow + `?.querySelector('[equipo-roster-links] a[rst-btn]')`))
+ p.run(browsertest.Wait(`!!` + slow + `?.querySelector('[equipo-roster-links] a[href^="/tasks/"]')`))
p.check(`!`+slow+`.querySelector('[equipo-receipt-more], [data-task-cancel]')`, "report retained its action menu")
- p.check(`(()=>{`+slow+`.querySelector('[equipo-roster-links] a[rst-btn]').click();return true})()`, "Open the task")
+ p.check(`(()=>{`+slow+`.querySelector('[equipo-roster-links] a[href^="/tasks/"]').click();return true})()`, "Open the task")
p.run(browsertest.Wait(`!!document.querySelector('#task-head [data-task-cancel]')`))
p.check(`(()=>{document.querySelector('#task-head [equipo-menu] summary').click();return true})()`, "task actions")
p.check(`(()=>{document.querySelector('#task-head [data-task-cancel]').click();return true})()`, "Cancel")
diff --git a/internal/plan3test/plan3_release_test.go b/internal/plan3test/plan3_release_test.go
index 2c4a79df..0b664200 100644
--- a/internal/plan3test/plan3_release_test.go
+++ b/internal/plan3test/plan3_release_test.go
@@ -178,8 +178,9 @@ func plan3CopyInventory(t *testing.T) {
// Paul's own review of the jobs strings and the API section's job prose.
approvedJobs := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review cvaxhn3pwgpxhpssj5cgizqtrq, unchanged)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review cvaxhn3pwgpxhpssj5cgizqtrq)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review mbvzxmewxxgud4ksakdb2m7pye)")
acceptedRoster := strings.HasPrefix(key, "roster.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)")
+ acceptedReportActions := slices.Contains([]string{"roster.talk", "roster.round_busy", "roster.round_done", "roster.merge_busy", "roster.merge_done"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-15)")
acceptedCopy := strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Copy, record-bound) sha256:"+copydesk.Hash(rows[key])
- if !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs {
+ if !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs {
t.Fatal("entry has no copy review status or applicable acceptance", key)
}
}
diff --git a/internal/thintest/report_actions_browser_test.go b/internal/thintest/report_actions_browser_test.go
index 216ce03c..07243ab7 100644
--- a/internal/thintest/report_actions_browser_test.go
+++ b/internal/thintest/report_actions_browser_test.go
@@ -194,6 +194,12 @@ func TestBrowserReportActionFeedback(t *testing.T) {
p.wait(`document.querySelector('[equipo-roster-report] [equipo-card-done]')`, "success feedback")
p.check(`!document.querySelector('[equipo-roster-report] [rst-btn="primary"]')`, "success leaves stale primary")
p.shot(fmt.Sprintf("report-%s-success-%d-%s", state, width, scheme))
+ reportState(r, id, "done")
+ p.click(`[data-report-talk]`)
+ p.check(`(()=>{const i=document.querySelector('[data-report-thread] textarea');i.value='Thanks.';i.dispatchEvent(new Event('input',{bubbles:true}));return true})()`, "reply after completion")
+ p.click(`[data-report-thread] [data-thread-send]`)
+ p.wait(`document.querySelector('[equipo-roster-report] [data-stage="done"]')`, "completed report refresh")
+ p.check(`!document.querySelector('[equipo-roster-report] [equipo-card-done]')`, "completed report still says work is starting")
})
}
}