oficina / equipo Public

Finish Roster responsive states and preserve streamed reply layout

Paul Campbell pushed by paul@keymail.dev 81ad2ee3497139ad3afc0eae4164642fff803122 parent 6af83fa
11 files changed, +74 −12
  • .rastrillo/budgets.txt +1 −1
  • internal/equipo/chat_roster.go +1 −1
  • internal/equipo/icons/icons.go +1 −0
  • internal/equipo/static/equipo.css +10 −5
  • internal/equipo/templates/chat.html +1 −1
  • internal/equipo/templates/work_needs.html +1 −1
  • internal/thintest/gallery_test.go +1 −1
  • internal/thintest/research_pages_test.go +1 −1
  • internal/thintest/rollup_browser_test.go +1 −1
  • internal/thintest/roster_browser_test.go +13 −0
  • internal/thintest/roster_reports_browser_test.go +43 −0

CI cancelled — superseded by a newer push — run details

diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index c1c50c10..d08d2447 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 - 10739 End-to-end scenarios through a real runner and instance: the Copy setting, wording flag and the Assistant's job threads. Measured 10739 test lines.
-size internal/thintest - 28256 The contract and browser tests share the instance harness; Roster adds real action states and desktop/phone captures in both themes. Measured 28256 test lines.
+size internal/thintest - 28312 The contract and browser tests share the instance harness; Roster adds real action states and desktop/phone captures in both themes. Measured 28312 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/chat_roster.go b/internal/equipo/chat_roster.go
index 0cf776c1..54e3f994 100644
--- a/internal/equipo/chat_roster.go
+++ b/internal/equipo/chat_roster.go
@@ -25,7 +25,7 @@ func (v *chatCard) rosterAuthor(tasks map[string]wire.Task) {
who, v.Verb = wire.SpecialistCopy, copyText("roster.holds")
}
v.Author = specialistName(who)
- v.AuthorIcon = map[string]string{wire.SpecialistEngineering: "code", wire.SpecialistResearch: "search", wire.SpecialistCopy: "file-text"}[who]
+ v.AuthorIcon = map[string]string{wire.SpecialistEngineering: "wrench", wire.SpecialistResearch: "search", wire.SpecialistCopy: "type"}[who]
}
}
diff --git a/internal/equipo/icons/icons.go b/internal/equipo/icons/icons.go
index a7f3a244..9df027b1 100644
--- a/internal/equipo/icons/icons.go
+++ b/internal/equipo/icons/icons.go
@@ -20,6 +20,7 @@ package icons
import "html/template"
var icons = map[string]template.HTML{
+ "wrench": `<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="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94z"/></svg>`,
"shield": `<svg class="icon" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true" viewBox="0 0 24 24"><path d="M12 3 3 7v5c0 5 9 9 9 9s9-4 9-9V7z"/></svg>`,
"users": `<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="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" /> <path d="M16 3.128a4 4 0 0 1 0 7.744" /> <path d="M22 21v-2a4 4 0 0 0-3-3.87" /> <circle cx="9" cy="7" r="4" /></svg>`,
"message-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"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>`,
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css
index 893fde60..dee61e0e 100644
--- a/internal/equipo/static/equipo.css
+++ b/internal/equipo/static/equipo.css
@@ -1769,6 +1769,7 @@ label[equipo-sp-label] { cursor: pointer; }
/* Roster: bylines sit on the page; only decisions are raised. */
[equipo-conversation] { -webkit-text-size-adjust: 100%; }
+[equipo-conversation] [equipo-scroll] { container: roster / inline-size; }
[equipo-conversation] [equipo-feed] { gap: 1.25rem; font-size: 1rem; }
[equipo-conversation] [equipo-card] { display: block; position: relative; inline-size: 100%; max-inline-size: 48rem; align-self: center; margin: 0; padding: 0 0 0 3rem; border: 0; border-radius: 0; background: transparent; font-size: 1rem; }
[equipo-roster-byline] { display: flex; align-items: center; gap: .375rem; min-block-size: 2.25rem; margin-block-end: .375rem; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); }
@@ -1800,7 +1801,7 @@ label[equipo-sp-label] { cursor: pointer; }
[equipo-conversation] [equipo-message-meta] [equipo-coordinator-mark] { position: absolute; inset-inline-start: 0; inline-size: 2.25rem; }
[equipo-conversation] [equipo-message-meta] time { margin-inline-start: 0; }
[equipo-conversation] [equipo-message="incoming"] [equipo-bubble] { font-size: 1rem; line-height: 1.55; }
-@media (max-width: 500px) {
+@container roster (max-width: 500px) {
[equipo-conversation] [equipo-card] { padding-inline-start: 0; }
[equipo-roster-byline] { padding-inline-start: 2.5rem; min-block-size: 1.875rem; }
[equipo-roster-avatar] { inline-size: 1.875rem; block-size: 1.875rem; }
@@ -1830,7 +1831,8 @@ label[equipo-sp-label] { cursor: pointer; }
[equipo-roster-toast][hidden] { display: none; }
[equipo-card-error] { color: var(--rst-tone-negative-fg); font-size: var(--rst-fs-sm); margin: 0; }
[equipo-card-error] button { margin-inline-start: .5rem; }
-@media (max-width: 500px) { [equipo-chat-header] > [equipo-header-button] { display: none; } [equipo-set-aside] button { inline-size: 2.75rem; } }
+@media (max-width: 500px) { [equipo-chat-header] > [equipo-header-button] { display: none; } }
+@container roster (max-width: 500px) { [equipo-set-aside] button { inline-size: 2.75rem; } }
/* A sub-chat is a full-width drawer under its card's actions. */
[equipo-subchat] { min-inline-size: 0; margin: .125rem -1rem -.875rem; padding: .75rem 1rem .875rem; background: var(--rst-surface-2); border-block-start: 1px solid var(--rst-line); border-end-start-radius: inherit; border-end-end-radius: inherit; }
[equipo-subchat][data-question-thread] { margin-block-start: 0; border-block-start: 0; background: transparent; }
@@ -1865,7 +1867,7 @@ label[equipo-sp-label] { cursor: pointer; }
[equipo-reading-dots] i { inline-size: .25rem; block-size: .25rem; background: currentColor; border-radius: 50%; }
[equipo-card-done] { font-weight: 600; margin: 0; }
[equipo-needs-pill] { display: flex; align-items: center; gap: .375rem; padding: .25rem .625rem; border: 1px solid var(--rst-line); border-radius: calc(4 * var(--rst-radius)); font-size: var(--rst-fs-sm); }
-@media (max-width:500px) { [equipo-subchat] { margin-inline: -.875rem; padding-inline: .875rem; } [equipo-mini-pill] button { min-inline-size: 2.75rem; } }
+@container roster (max-width:500px) { [equipo-subchat] { margin-inline: -.875rem; padding-inline: .875rem; } [equipo-mini-pill] button { min-inline-size: 2.75rem; } }
[equipo-roster-card][data-done] { background: transparent; border-color: transparent; padding: .25rem 0; box-shadow: none; }
[equipo-card-done] { display: flex; align-items: center; gap: .5rem; color: var(--rst-tone-positive-fg); }
[equipo-thread-avatar][equipo-coordinator-mark] { border-color: transparent; background: transparent; }
@@ -1919,7 +1921,7 @@ label[equipo-sp-label] { cursor: pointer; }
[equipo-roster-byline] { position: relative; }
[equipo-roster-avatar] { inset-inline-start: -3rem; }
[equipo-roster-card] + [equipo-roster-byline] { margin-block-start: 1.25rem; }
-@media (max-width:500px) {
+@container roster (max-width:500px) {
[equipo-roster-avatar] { inset-inline-start: 0; }
[equipo-roster-card] [equipo-actions] > form:has([rst-btn="primary"]) { grid-column: 1 / -1; }
[equipo-roster-card] [equipo-actions] > form { display: contents; }
@@ -1938,4 +1940,7 @@ label[equipo-sp-label] { cursor: pointer; }
[equipo-conversation]:not([data-task]) [equipo-thinking] [equipo-activity-line] { inline-size: 100%; min-inline-size: 0; }
[equipo-roster-report] [equipo-roster-stage][equipo-stage] { margin: 0; padding: 0; border: 0; background: transparent; font-size: var(--rst-fs-xs); }
[equipo-thread-error] { color: var(--rst-tone-negative-fg); font-size: var(--rst-fs-sm); }
-@media (max-width:500px) { [equipo-roster-card] [equipo-actions] [rst-btn]:not([rst-btn="primary"]) { font-size: var(--rst-fs-sm); } }
+@container roster (max-width:500px) { [equipo-roster-card] [equipo-actions] [rst-btn]:not([rst-btn="primary"]) { font-size: var(--rst-fs-sm); } }
+[equipo-conversation]:not([data-task]) [equipo-thinking][data-streaming] [equipo-bubble] { display: block; }
+[equipo-thinking][data-streaming] [equipo-turn-stop] { display: none; }
+[equipo-roster-facts] dd, [equipo-roster-facts] code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
diff --git a/internal/equipo/templates/chat.html b/internal/equipo/templates/chat.html
index 93ce8443..cde4c1a5 100644
--- a/internal/equipo/templates/chat.html
+++ b/internal/equipo/templates/chat.html
@@ -30,7 +30,7 @@
{{define "work-task-receipt"}}{{$card := .}}{{with .Task}}<div equipo-roster-report{{if $card.SlimReport}} data-slim{{end}}>
<div equipo-roster-report-head><div><span equipo-roster-stage equipo-stage data-stage="{{.Stage}}" data-needs="{{.NeedsYou}}">{{.StageLine}}</span><h3 equipo-card-line><a href="/tasks/{{.ID}}">{{.Title}}</a></h3></div>{{if .NeedsYou}}<span rst-badge="warning">{{copy "nav.needs-you"}}</span>{{end}}</div>
{{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>{{.ChecksLine}}</dd></div>{{end}}{{if .ReviewLine}}<div><dt>{{copy "roster.review"}}</dt><dd data-verdict>{{.ReviewLine}}</dd></div>{{end}}{{if .Branch}}<div><dt>{{copy "roster.branch"}}</dt><dd><code>{{.Branch}}</code></dd><small>{{.CandidateSHA}}</small></div>{{end}}</dl>
+<dl equipo-roster-facts>{{if .ChecksLine}}<div><dt>{{copy "roster.checks"}}</dt><dd data-checks title="{{.ChecksLine}}">{{.ChecksLine}}</dd></div>{{end}}{{if .ReviewLine}}<div><dt>{{copy "roster.review"}}</dt><dd data-verdict title="{{.ReviewLine}}">{{.ReviewLine}}</dd></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}}<div equipo-roster-links><a href="/tasks/{{.ID}}">{{copy "roster.open_task"}}</a>{{if and .Pushed (not .MergedLine)}}<span data-pushed><span>{{.Pushed}}</span></span><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}}{{if .PreviewURL}}<a href="{{.PreviewURL}}" rel="noopener" target="_blank" data-preview>{{copy "chat.card.preview_link"}}</a>{{end}}</div>
</div>{{end}}{{if .Open}}<button type="button" equipo-receipt-more aria-expanded="false" aria-controls="acts-{{.ID}}" aria-label="{{copy "chat.card.more"}}">⋯</button><span equipo-receipt-actions id="acts-{{.ID}}">{{template "work-task-actions" .Task}}</span>{{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/equipo/templates/work_needs.html b/internal/equipo/templates/work_needs.html
index 968ec0ed..a48afa04 100644
--- a/internal/equipo/templates/work_needs.html
+++ b/internal/equipo/templates/work_needs.html
@@ -1,7 +1,7 @@
{{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 if eq .DecisionCount 1}}{{copy "work.needs.one"}}{{else}}{{printf (copy "work.needs.many") .DecisionCount}}{{end}}</p></div>
+{{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}}
diff --git a/internal/thintest/gallery_test.go b/internal/thintest/gallery_test.go
index 9089beec..d8de32cc 100644
--- a/internal/thintest/gallery_test.go
+++ b/internal/thintest/gallery_test.go
@@ -193,7 +193,7 @@ func TestPagesInnerScreens(t *testing.T) {
}
needs := a.get(owner, "/tasks?needs=you", 200)
- has(needs, "Needs you", "2 decisions, each in one tap.", `data-decision="`+g.unchecked+`"`, "Merge without checks?",
+ has(needs, "Needs you", "3 waiting for you", `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"`)
diff --git a/internal/thintest/research_pages_test.go b/internal/thintest/research_pages_test.go
index b88d6cbe..e684395c 100644
--- a/internal/thintest/research_pages_test.go
+++ b/internal/thintest/research_pages_test.go
@@ -218,7 +218,7 @@ func TestResearchTaskPage(t *testing.T) {
"<li>No phone number found</li>",
`<img src="/tasks/` + id + `/files/` + file + `" alt="The shop&#39;s logo." width="5" height="4" loading="lazy" decoding="async">`,
"<figcaption><b>Logo</b> The shop&#39;s logo.</figcaption>",
- `<details equipo-tl-more data-fetch-log>`, "Web requests (5)", "<code>https://shop.example.com/search?q=&lt;script&gt;alert(3)&lt;/script&gt;</code>",
+ `<details equipo-tl-more data-fetch-log id="research-` + s.ID + `">`, "Web requests (5)", "<code>https://shop.example.com/search?q=&lt;script&gt;alert(3)&lt;/script&gt;</code>",
"<code>https://shop.example.com/</code>", "text/html&#34;&gt;&lt;script&gt;alert(2)&lt;/script&gt;", "<span>5 KB</span>",
"<code>https://shop.example.com/hours</code>", "https://shop.example.com/opening-hours",
"<code>https://cdn.example.net/x.webp</code>", "type_refused",
diff --git a/internal/thintest/rollup_browser_test.go b/internal/thintest/rollup_browser_test.go
index 11824742..a7d9cd1c 100644
--- a/internal/thintest/rollup_browser_test.go
+++ b/internal/thintest/rollup_browser_test.go
@@ -21,7 +21,7 @@ func TestBrowserRollup(t *testing.T) {
for i, tc := range []struct {
width int64
scheme string
- }{{1280, "light"}, {390, "dark"}} {
+ }{{1280, "light"}, {1280, "dark"}, {390, "light"}, {390, "dark"}} {
t.Run(fmt.Sprintf("%d-%s", tc.width, tc.scheme), func(t *testing.T) {
p := openInner(t, r.inst.URL, r.inst.Cookie(), tc.width, 844, tc.width == 390, tc.scheme, "no-preference")
defer p.stop()
diff --git a/internal/thintest/roster_browser_test.go b/internal/thintest/roster_browser_test.go
index 1c1c23c2..6435a0b7 100644
--- a/internal/thintest/roster_browser_test.go
+++ b/internal/thintest/roster_browser_test.go
@@ -27,6 +27,11 @@ func TestBrowserRosterVisual(t *testing.T) {
p.fits("Roster")
p.check(`(()=>{const s=document.querySelector('[equipo-scroll]');s.scrollTop=0;s.dispatchEvent(new Event('scroll'));return true})()`, "top")
p.shot(fmt.Sprintf("roster-%d-%s", width, scheme))
+ if width == 1280 {
+ p.check(`(()=>{document.querySelector('[equipo-conversation]').style.inlineSize='440px';return true})()`, "narrow conversation container")
+ p.check(`getComputedStyle(document.querySelector('[equipo-roster-avatar]')).width==='30px'`, "narrow container did not use phone roster")
+ }
+
})
}
}
@@ -93,6 +98,14 @@ func TestBrowserRosterSubchat(t *testing.T) {
p.wait(`document.querySelector('[equipo-roster-toast] [data-aside-undo]')`, "question toast")
p.click(`[equipo-roster-toast] [data-aside-undo]`)
p.wait(`document.querySelector('[equipo-mini-composer] textarea')?.value==='The sign-in page.'`, "undo retains the draft")
+ p.check(`(()=>{window.__fetch=window.fetch;window.fetch=(url,opts)=>opts?.method==='POST'?new Promise(resolve=>{window.__fail=()=>resolve(new Response('{}',{status:503}))}):window.__fetch(url,opts);return true})()`, "hold question send")
+ p.click(`[equipo-mini-composer] [data-thread-send]`)
+ p.check(`document.querySelector('[data-thread-send]').getAttribute('aria-busy')==='true'`, "question busy")
+ p.shot(fmt.Sprintf("roster-thread-busy-%d-%s", width, scheme))
+ p.check(`(()=>{window.__fail();window.fetch=window.__fetch;return true})()`, "question send fails")
+ p.wait(`document.querySelector('[data-question-thread]').parentElement.querySelector('[equipo-card-error]:not([hidden])')`, "question send error")
+ p.shot(fmt.Sprintf("roster-thread-error-%d-%s", width, scheme))
+
p.click(`[equipo-mini-composer] [data-thread-send]`)
f, body := r.expect(wire.FrameMessage)
m := body.(*wire.MessageCommand)
diff --git a/internal/thintest/roster_reports_browser_test.go b/internal/thintest/roster_reports_browser_test.go
index 67288050..91f0b290 100644
--- a/internal/thintest/roster_reports_browser_test.go
+++ b/internal/thintest/roster_reports_browser_test.go
@@ -6,6 +6,7 @@ import (
"amadan.net/oficina/equipo/internal/wire"
"fmt"
"testing"
+ "time"
)
func TestBrowserRosterReports(t *testing.T) {
@@ -28,6 +29,12 @@ func TestBrowserRosterReports(t *testing.T) {
for _, width := range []int64{1280, 390} {
for _, scheme := range []string{"light", "dark"} {
t.Run(fmt.Sprintf("%d-%s", width, scheme), func(t *testing.T) {
+ if _, err := r.inst.DB.Writer().Exec("UPDATE chat_steps SET state='queued',reason='copy_budget',note='',withdrawn=0,terminated=0 WHERE id='roster-copy-step'"); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := r.inst.DB.Writer().Exec("UPDATE chat_tasks SET copy_hold=1 WHERE id=?", held); err != nil {
+ t.Fatal(err)
+ }
p := openInner(t, r.inst.URL, r.inst.Cookie(), width, 844, width == 390, scheme, "reduce")
defer p.stop()
p.open("/conversation")
@@ -50,6 +57,42 @@ func TestBrowserRosterReports(t *testing.T) {
p.open("/conversation")
p.click(`[equipo-aside-stub] [data-aside-undo]`)
p.wait(`document.querySelector('[equipo-copy-meter]')`, "Copy restored")
+ p.check(`(()=>{window.__fetch=window.fetch;window.fetch=(url,opts)=>opts?.method==='POST'?new Promise(resolve=>{window.__fail=()=>resolve(new Response('{}',{status:503}))}):window.__fetch(url,opts);return true})()`, "hold Copy action")
+ p.click(`[data-copy-continue]`)
+ p.check(`document.querySelector('[data-copy-continue]').getAttribute('aria-busy')==='true' && document.querySelector('[equipo-copy-hold]').closest('[data-card]').querySelector('[data-set-aside]').disabled`, "Copy busy state")
+ p.shot(fmt.Sprintf("roster-copy-busy-%d-%s", width, scheme))
+ p.check(`(()=>{window.__fail();window.fetch=window.__fetch;return true})()`, "fail Copy action")
+ p.wait(`document.querySelector('[equipo-copy-hold]').parentElement.querySelector('[equipo-card-error]:not([hidden])')`, "Copy error")
+ p.shot(fmt.Sprintf("roster-copy-error-%d-%s", width, scheme))
+ p.click(`[equipo-copy-hold] ~ [equipo-card-error] button`)
+ p.wait(`[...document.querySelectorAll('[equipo-card-done]')].some(e=>e.textContent.includes('Continuing without Copy.'))`, "Copy success")
+ p.shot(fmt.Sprintf("roster-copy-done-%d-%s", width, scheme))
+ })
+ }
+ }
+}
+
+func TestBrowserRosterQuietDay(t *testing.T) {
+ r := newToolRig(t)
+ r.runner.Send(r.ctx, "quiet-reply", wire.FrameReply, wire.Reply{TurnID: r.turn, Attempt: 1, Text: "Nothing else today."})
+ r.wait("quiet reply", func(c *Conversation) bool { return c.Turns[r.turn].State == wire.TurnReplied })
+ now := r.inst.Store.Chat().Now()
+ y := time.Date(now.Year(), now.Month(), now.Day()-1, 12, 0, 0, 0, time.UTC)
+ if _, err := r.inst.DB.Writer().Exec("UPDATE chat_messages SET created_at=?", y); err != nil {
+ t.Fatal(err)
+ }
+ for _, width := range []int64{1280, 390} {
+ for _, scheme := range []string{"light", "dark"} {
+ t.Run(fmt.Sprintf("%d-%s", width, scheme), func(t *testing.T) {
+ p := openInner(t, r.inst.URL, r.inst.Cookie(), width, 844, width == 390, scheme, "reduce")
+ defer p.stop()
+ p.open("/conversation")
+ p.check(`!!document.querySelector('[equipo-day-quiet]') && !document.querySelector('[equipo-daybar]')`, "quiet day invents work")
+ p.shot(fmt.Sprintf("roster-quiet-%d-%s", width, scheme))
+ p.click(`[data-day-toggle]`)
+ p.wait(`document.querySelector('[equipo-day-feed]')?.textContent.includes('Nothing else today.')`, "quiet transcript")
+ p.fits("quiet day")
+ p.shot(fmt.Sprintf("roster-quiet-open-%d-%s", width, scheme))
})
}
}