Public: anyone can read this; the crew can change it.

The browser tab says how many leads are waiting on the agent, and a lead's page is titled with the lead's name #63

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The desk's browser tab now reads "(N) Speed to Lead" when N leads need the agent, and plain "Speed to Lead" when none do. I did not run the full suite, scripts/gate.ts or scripts/fast.ts, because they aren't in this clone.

Notes

shipped production is serving it deploy aba151a

opened this

The desk's browser tab now reads "(N) Speed to Lead" when N leads need the agent, and plain "Speed to Lead" when none do. I did not run the full suite, scripts/gate.ts or scripts/fast.ts, because they aren't in this clone. I ran src/server.test.ts, live.test.ts and design.test.ts, which pass, and readme.test.ts and openapi.test.ts, which also pass. The design lint ran, but I didn't check its output. bun x tsc --noEmit only printed tsc's help text (7.0.2, no tsconfig in the clone), so there was no type check.

  • Same query: the count is the "needs you" figure from countViews, the one the "Needs you" tab shows. It stays the same under ?show=closed or a search.
  • Live update: the #desk region now carries its title in a data-title attribute. When static/live.js swaps that region after a lead arrives or is answered, it also sets document.title from the new region. No new script file and no new inline script, so no layout shift and the CSP is untouched.
  • Signed out: the welcome page has no count and no data-title.
  • Lead page: already titled "<lead name> · Speed to Lead", escaped, so I changed nothing there. I added a test with a name containing <.
  • Tests: src/server.test.ts covers the title for zero, one and several waiting leads. It also covers a real desk matching its "Needs you" count, a filtered view, the signed-out page, and the escaped lead title.

Not done:

  • Pages other than the desk and the lead page (profile, activity) show no count. The issue asks only for the desk.
  • If a signed-in person has the desk open and the update stream drops, the count refreshes on the existing reconnect catch-up, not sooner.

To try it: open / signed in, press "Bring in a new inquiry", and watch the tab title change without a reload.

🤖 Generated with Claude Code

Closes #56

commented

The desk's browser tab now reads "(N) Speed to Lead" when N leads need the agent, and plain "Speed to Lead" when none do. I did not run the full suite, scripts/gate.ts or scripts/fast.ts, because they aren't in this clone. I ran src/server.test.ts, live.test.ts and design.test.ts, which pass, and readme.test.ts and openapi.test.ts, which also pass. The design lint ran, but I didn't check its output. bun x tsc --noEmit only printed tsc's help text (7.0.2, no tsconfig in the clone), so there was no type check.

  • Same query: the count is the "needs you" figure from countViews, the one the "Needs you" tab shows. It stays the same under ?show=closed or a search.
  • Live update: the #desk region now carries its title in a data-title attribute. When static/live.js swaps that region after a lead arrives or is answered, it also sets document.title from the new region. No new script file and no new inline script, so no layout shift and the CSP is untouched.
  • Signed out: the welcome page has no count and no data-title.
  • Lead page: already titled "<lead name> · Speed to Lead", escaped, so I changed nothing there. I added a test with a name containing <.
  • Tests: src/server.test.ts covers the title for zero, one and several waiting leads. It also covers a real desk matching its "Needs you" count, a filtered view, the signed-out page, and the escaped lead title.

Not done:

  • Pages other than the desk and the lead page (profile, activity) show no count. The issue asks only for the desk.
  • If a signed-in person has the desk open and the update stream drops, the count refreshes on the existing reconnect catch-up, not sooner.

To try it: open / signed in, press "Bring in a new inquiry", and watch the tab title change without a reload.

🤖 Generated with Claude Code

Approved

Clean, small change. The desk title uses the same needs count as the Needs you view, live.js updates document.title from the swapped #desk region (no new script, no layout shift), signed-out pages carry no count or data-title, the lead page title is escaped, and no contract cell or write path is touched. Tests cover zero, one and several, the filtered view, signed-out, and the escaped name. Minor, non-blocking: the fallback to leads.filter(inView needs) in desk.ts would be wrong under a filtered list if counts were ever absent.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs