Skip to content

feat(first-session): Scout's welcome offers two starts as buttons (direction B) - #2194

Merged
lilyshen0722 merged 1 commit into
mainfrom
lily/first-screen-b
Oct 15, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
lily/first-screen-b

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

The first open of My Workspace as ruled on 2026-10-15, direction B from UX Lead's first-session artboards. Scout's welcome ends in two starts, Connect an agent I already use and Start a pod for a project. A click sends the start as the person's own message, and Scout answers it. Direction A (start from a repo) waits on three builds, and C is dropped. Board: TASK-247, whose acceptance criteria A1–A12 were written before the build.

What changes

Scout's welcome (authController, config/native-agents/scout.ts)

  • New signups get the artboard's shared copy: "I'm Scout. This pod is yours, and I work in it with you. Start with one of these, or tell me what you're working on. 中文也可以,直接说。"
  • The starts ride as a server-composed payload: { kind: 'starts', starts }, the ADR-020 D3 pattern the approval card uses, so the client renders them from structure, never from text.
  • The labels live in SCOUT_STARTS, the one source for the payload, Scout's prompt and the recorded pick.
  • Scout's prompt gains two lines on how to answer each start: ask which tool and OS, then the connect card; or ask the project, then create_pod.

The buttons (V2Thread, V2ThreadMessages, v2.css)

  • They render under Scout's message in the shared side-row slot, the same indent the delivery cue and no-agent row use, pinned by v2-layout-invariants.
  • Signal styling: bordered, 4px radius, 44px tall on a phone.
  • A start goes away only once this person has sent it. A join row, Scout following up, or another member posting never removes it. Typing something else leaves "Connect an agent I already use" in place, so a person who types still has a visible way to connect at every width.
  • A start click posts a root message and leaves the composer's draft and reply target alone.
  • Messages without starts, including every existing welcome, render as before.

Recording the pick (services/onboardingMarks.ts, models/User.ts, messageController)

First-run card (V2FirstRunHero)

  • It no longer opens on its own. A modal over Scout's offer put a second, heavier connect path on top of the first screen. Feedback, then Guide opens it.
  • Its stored skip and 7-day expiry are removed. Nothing re-offers the card now, so they had nothing left to suppress: Skip ends the setup.
  • After Say hello it closes over the agent's room, instead of sticking on "Opening…" over the message box (First-run card stays on "Opening…" over the 1:1 room after Say hello, covering the composer #2192). The card is mounted above the route, so it must end its own state.

Bring your own: "Run it here" loses its "recommended" label. Its kicker now reads "on Commonly", quiet like "your machine", so nothing steers the first choice.

Tests

suite covers
V2ThreadStarts.test.tsx (new, 7) buttons render as one labelled group; a click sends a root message, keeps the draft, and removes that start; a join row, Scout's follow-up or another member doesn't remove them; typing keeps them; a sent start stays gone on reload; both sent leaves no group; a message without starts has no buttons
V2FirstRunHero.test.tsx (14) no automatic open and no polling for a person with no agent; asking opens it; Skip ends the setup across a reload; Say hello closes the card (#2192); a failed hand-over keeps it open with the error
v2-layout-invariants starts in the shared slot; 4px radius; the 44px phone minimum comes after the 32px base in the sheet, so it wins
onboardingMarks.test.js write-once pick by label, own pod only, non-starts ignored, retried on failure, independent of the open mark
authController.guideIdentity, messageController the welcome carries the starts payload; every sent message is handed to the pick mark
  • Mutations, each failing its arm: any later message hides a start; a start click clears the draft; the card opens on its own again; Say hello leaves the card up.
  • Local runs: 27 frontend suites pass (513 tests), and 187 backend suites touching these files pass (1,938). Lint shows 0 errors on the changed files, and tsc --noEmit is clean.

Browser check

Production, a fresh account and a new tab, at 1440 and 390: before on dbb49f13, and after this deploys. Cofounder's grading session runs it against TASK-247's A1–A12, including A5, the minutes from signup to the agent's first post on macOS. The PNGs and the number will follow in a comment.

🤖 Generated with Claude Code

https://claude.ai/code/session_015NDyNbwmCco62PAAviSL1k

…rection B)

The first open of My Workspace, as ruled on 2026-10-15 (TASK-247): Scout's
welcome ends in two starts, "Connect an agent I already use" and "Start a pod
for a project". A click sends the start as the person's own message and Scout
answers it. Direction A (start from a repo) waits on three builds; C is dropped.

- Scout's welcome is posted at signup with the shared copy and a
  server-composed payload { kind: 'starts', starts } (the ADR-020 D3 pattern
  the approval card uses), so the client renders the buttons from structure.
  The labels live in config/native-agents/scout.ts, the one source for the
  payload, Scout's prompt and the recorded pick.
- The thread renders the starts in the shared side-row slot under that
  message. A start goes away only once this person has sent it: a join row,
  Scout's follow-ups or another member never take the offer away, and typing
  something else leaves "Connect an agent I already use" in place at every
  width. A start click posts a root message and leaves the draft alone.
- Scout's prompt says how to answer each start.
- The pick is recorded server-side the #2170 way: write-once
  User.onboarding.firstStartId and firstStartAt when a person posts a start's
  exact label in a pod they created.
- The first-run card no longer opens on its own: a modal over Scout's offer
  was a second, heavier connect path on the first screen. Feedback, then Guide
  opens it. Its stored skip and 7-day expiry had nothing left to suppress and
  are removed; Skip ends the setup.
- After "Say hello", the card closes over the agent's room instead of sticking
  on "Opening..." and covering the message box (#2192).
- Bring your own: "Run it here" no longer carries a "recommended" label; its
  kicker reads "on Commonly", quiet like the others.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015NDyNbwmCco62PAAviSL1k

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Written by Sprint Review, a Commonly agent — gate requested in pod thread 77611.

Gated at f2412912978bc4d95665d647d048e4144d6a7b98. 12 checks pass, Test & Coverage pending, 2 skipping; backend .ts eslint 0 errors across the four changed files. All three claims hold. Two terms inside the start rule are unpinned, and there is one data-level drift worth a line — none of it blocking.

Both halves reproduce

run result
BASE — onboardingMarks + authController.guideIdentity + messageController 3 suites, 40 tests
BASE — V2ThreadStarts + V2FirstRunHero + v2-layout-invariants 3 suites, 232 tests
main's V2Thread.tsx 5 failed, every starts arm, by name
main's onboardingMarks.ts 6 failed, every markStartPicked arm, by name
RESTORED 40/40 and 232/232, clean
mutation site result
M1 — any later message counts, not only the viewer's own 1 1 failed — a join row, Scout following up, or another member does not take the starts away
M2 — messages before the offer count too (slice(index+1) → messages) 1 232/232 green
M3 — a sent start no longer closes the offer 1 3 failed — the click arm, the reload arm, both starts sent: no group is left behind
M4 — a start inherits the composer's reply target 1 232/232 green
M5 — a start label is reworded 1 4 failed — three markStartPicked arms and the welcome-payload arm
M6 — the start mark drops the own-pod check 1 1 failed — a start posted in someone else's pod is not a first-session pick
M7 — the start mark drops its write-once clause 1 1 failed — records which start a person posted…, write-once, never for bots

1. startsByMessageId — sound, and two of its terms are vacuously green

Nothing can take the offer away before it is seen. Three independent reasons, and I tried to break each: only the viewer's own later messages are counted (M1 proves that term is load-bearing), only messages after the offering one, and the match is exact trimmed-label equality — so Scout's follow-ups, a join row, another member, or the viewer typing something else all leave it standing. A failed send also leaves it: nothing is appended and sending resets, so the buttons re-enable with the offer intact.

Nothing leaves it stuck, either — but that depends on a contract the suite stubs rather than exercises. The offer closes when a later own message's content equals the label, so the echo of the click must come back with user_id equal to the viewer's. Harness.sendMessage hands back user_id: 'u1' directly; in the app the echo goes through normalizeMessage, which resolves user_id from raw.user_id, else a string userId, else userObject._id (useV2PodDetail.ts:215). So the real path satisfies it — worth saying because the arm alone could not tell you, and a populated-object userId with a bare === is exactly how this class fails.

M2 — slice(index + 1) is unpinned. Counting messages before the offer too leaves all 232 green. It is unreachable today, and for a precise reason: the welcome is the first message in a fresh workspace, so there is nothing before it to match. The term becomes load-bearing the moment any later message offers starts — which the payload shape permits, and which the arm named "including an older welcome" already gestures at.

M4 — the root-ness of a start is unpinned, and this one is a clean instance of checklist rule 50. The arm is named a click sends the start as a root message… and it does assert toHaveBeenCalledWith(POD_START, 'text', undefined, undefined). But its fixture never aims the composer, so replyTarget is null and replyTarget?.id || undefined is undefined — the same value the isStart branch produces. The fixture supplies only the input where the two branches agree, so the assertion is green either way.

Measured with an aim actually set — click Reply on a peer's message, then click a start:

{ "placeholderWhileAimed": "Reply to rae",
  "sentWith": ["Start a pod for a project", "text", undefined, undefined],
  "placeholderAfterStart": "Reply to rae" }

So the term is correct — the start posts as a root even while aimed — and the composer keeps showing the aim afterwards, having silently not used it. That second half is a design call rather than a defect (the diff deliberately skips clearing targets on a start), but it is the one user-visible consequence nothing currently asserts. One arm that aims first pins the term and fixes its name's promise.

Instrument note, because it nearly became a false finding: my probe reported through JSON.stringify, which renders an undefined array element as null — so the raw report read […, null, null] and looked like a defect. The toEqual([…, undefined, undefined]) in the same arm is what settles it. A JSON-serialised probe cannot distinguish undefined from null.

2. The removed skip and expiry were dead — mechanically, and by construction

  • Mechanically: FIRST_RUN_DISMISSED_KEY and the literal v2.firstRun.dismissed have zero remaining references anywhere in frontend/src or backend. The orphaned localStorage values are read by nothing, so no migration is owed.
  • By construction: visible = !closed && engaged, engaged initialises from the started latch alone, and the if (!next.issued) setEngaged(true) auto-engage is gone. Nothing re-offers the card, so a stored skip has nothing left to suppress and its clock has nothing to re-offer. The population the TTL existed for — skipped, never connected — is now served by the in-pod starts, which persist until that person sends one rather than for seven days. That is a strictly longer-lived offer, which is what makes the removal safe rather than merely tidy.
  • One thing I checked because it would have been a silent regression: V2Layout initialises firstRunVisible to true, and V2Thread suppresses the starter panel and the empty state while it is true (:632, :1624, :1676). With the card no longer opening on its own, the flag has to come down some other way — it does: the hero's effect calls onVisibilityChange(shouldProbe) on mount, and shouldProbe is now engaged, false for a new signup, so it flips in the first commit. Pre-existing nuance, now less reachable: it reports shouldProbe rather than visible, so someone who asks for the guide and then closes it with Escape keeps the empty state suppressed until reload.

3. The pick mark — write-once, own pod, fail-open all hold

Each clause is pinned: M6 reddens the other-pod arm, M7 the write-once filter arm, and the existing arms cover the retry-after-failure and the isBot clause. The filter keys existence on firstStartAt while $setting both firstStartId and firstStartAt — one check for a pair, the same shape as markPodOpened. Placement is right: it runs after the message is created, so nothing unauthorised reaches it, and after the socket emit, so a telemetry stall cannot delay the broadcast.

The drift worth a line: the label is the join key, and it lives in two places with different lifetimes. SCOUT_STARTS is read now by the matcher; each workspace's stored welcome payload is a snapshot written at signup. M5 shows a reword cannot ship silently — it reddens four arms. But going green again means updating those tests, not migrating the stored payloads: every existing workspace keeps rendering the old label, a click sends the old text, and the matcher no longer recognises it, so firstStartId quietly stops being recorded for exactly the users who already have a workspace. The payload already carries id alongside label; matching the pick by id (which the client could echo, or which the server could resolve from the offering message) would make the mark survive a copy change. Worth knowing before the first reword, not before this merge.

One note on the welcome-payload arm itself: expect(welcome.payload.starts).toEqual(SCOUT_STARTS.map(…)) has both sides derived from the same constant, so it pins that the writer uses the constant — a real property, and the thing that would catch hard-coded labels in authController — but it structurally cannot catch a change to the constant. M5's reds come from the markStartPicked arms' hard-coded literals, which is the right place for them.

Also checked

  • The CSS parses, and the new layout guards are the right shape. main 1819 → PR 1823 top-level rules, same final rule (no unbalanced brace silently dropping selectors). The added invariant asserting that the 32px base precedes the 44px phone block is exactly the failure that file exists to catch — a later base rule would win at equal specificity and render 32 on a phone, invisibly to every render test.
  • The starts are server-composed, from payload, never from model prose — so Scout cannot invent a button, and the matcher's input is the same string the server offered.
  • i18n: podChat.starts.label ("Ways to start") is present in both locales, and the start labels are deliberately not translated — they are data in the payload and the match is on that exact string, so translating at render would break the pick. Correct as built; worth a comment at the render site, since "why isn't this label translated" is the obvious next edit.

GATE: PASS

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit 49f85a8 Oct 15, 2026
17 checks passed
samxu01 pushed a commit that referenced this pull request Oct 15, 2026
A third write-once first-session mark beside podOpenedAt (#2170) and the
first-start pick (#2194): User.onboarding.byoOpenedAt, set the first time a
person loads the Bring your own page. It is read server-side from the page's
own load request, GET /api/hosted/availability, which nothing else calls, so
it needs no client event and no analytics vendor. It splits "never looked at
setup" from "looked and left", which today we cannot tell apart.

markByoOpened follows the existing marks exactly: its own in-process set, the
write-once database filter, bots excluded, and failures never reach the
request. The reset seam clears all three sets. A comment at the page's call
site says the request carries the mark.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018ajWuL8XiGBSHWiurjqm7B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant