Skip to content

feat(members): show a crewmate is on watch while its loop runs - #17910

Merged
iamwhatever merged 1 commit into
mainfrom
feat/crewmate-loop-indicator
Oct 8, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/crewmate-loop-indicator

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On the Crewmates page you can see at a glance that a crewmate's automation loop is on, without seeing the loop's details.

A crewmate whose own thread runs a monitor (monitor_start) or a goal loop (autonudge) acts again without anyone asking. The Crewmates page did not show that well. The roster had a small static badge that only knew about goal loops, not structured monitors. Its tooltip showed cycle counts ("On patrol · 3 of 24"). The open thread's header pill showed nothing.

Why it matters

A user scanning the roster or reading a thread cannot tell which crewmates are on watch, so a crewmate that is about to act on its own reads the same as one that is resting. The user asked for a friendly "on watch" sign with no loop internals.

Not a goal

  • Showing loop details (nudge text, cycle counts, banners, next fire time) anywhere on the roster or the pill. The drawer's existing patrol block keeps those.
  • The crewmate switcher's stacked faces and list (CrewmateSwitcher.tsx), which sibling PRs own.
  • Any backend or API change.

What changed (motivation → approach → change)

Goal → one small mark on the avatar, driven by the live state the dashboard already has → a new component wired into two places.

  • Source. The sidebar's own live-automation selector (selectSidebarAutomationRunningKeys), read as-is: it covers structured monitors and goal loops, and the existing autonudge_state WebSocket frames and connect-time seed keep it current. The page's existing registry read (activePatrolOf) still counts too, so nothing that showed before goes dark. No new polling.
  • Look. CrewLoopIndicator (new, components/crew/): a faint accent ring around the face with one small accent dot orbiting it slowly (4s). It is accent-coloured and moves around the face, while the working state animates the face itself and shows the green presence dot bottom-right, so the two never look alike. Under prefers-reduced-motion the ring and orbit are hidden and one static accent dot shows top-right instead. It fades in and out (0.2s) as a loop starts or stops, as the old badge did; under reduced motion it cuts straight. Theme tokens only (accent, bg).
  • Label. "On watch", shown as a visible word so the mark reads without a tooltip (touch, reduced motion): a small accent Badge (the shared status primitive) leading the roster row's preview line, and appended to the pill's activity line ("Idle · 2m ago · On watch") and its screen-reader copy. The ring itself is decorative (aria-hidden, tooltip kept), so the word is read once and the pill button stays named after the crewmate.
  • Wiring in MembersPage.tsx. isLoopOn (registry OR live record) feeds the roster row, the header pill and signalsOf().patrolling, so the "patrolling" status filter agrees with the mark. The old static badge (and its AnimatePresence block) is replaced.
  • Strings. pages.membersPage.patrol_badge, patrol_cycles_of and patrol_cycles_unlimited were read only by that badge. They are replaced by pages.membersPage.loop_on in every locale; en-XA is regenerated by i18n:pseudo.
  • website/scripts/capture-members-patrol.mjs now counts the new mark (member-loop-indicator).

Backwards compatibility

Compatible: front-end only; no API, config or stored data changes.

Reader: website/src/pages/members/MembersPage.tsx:MemberRow member-patrol-dot -- crew page -- replaced by member-loop-indicator in the same row; MembersPage.loop.test.tsx covers it
Reader: website/scripts/capture-members-patrol.mjs:expectBadges -- release (screenshot harness) -- selector moved to member-loop-indicator, same one-per-active-loop count
Reader: website/src/i18n/locales/*.json:pages.membersPage.patrol_badge / patrol_cycles_of / patrol_cycles_unlimited -- crew page -- the only reader was the removed badge (git grep on origin/main); i18n:check passes

Tests

  • website/src/components/crew/CrewLoopIndicator.test.tsx: renders nothing when off; the mark is decorative (aria-hidden) with tooltip "On watch"; orbit spins only under motion-safe and the static dot shows only under reduced motion, never animating and never using the green working colour.
  • website/src/pages/members/MembersPage.loop.test.tsx: a live monitor dispatched into Redux marks only that crewmate's roster row, with the visible "On watch" word, and clears when the monitor finishes; an active legacy loop shows the same label and no cycle count anywhere; the open thread's pill gets the mark (decorative) and both its visible activity line and its screen-reader line carry the label.
  • Ran locally: these two files plus every src/pages/members/ test (17 files, 483 tests), the frontend scoped set, and the backend tests that reference changed files (725 tests). Gates: build, tsc, eslint at the CI ceiling, i18n:check, i18n:render, phantom-classes, restyle-ratchet, jscpd, bundle size, and the Python static gates. test:electron could not run here (no electron module on this host); this diff touches no Electron files.

Manual verification

Captured from the built SPA, gateway-free (stubDashboardApi), with a radar crewmate whose goal loop is active and a builder crewmate mid-turn, so both states are on screen at once. Light and dark, 320px and 1280px, loop on and off, plus reduced motion. "Before" is the same harness on main's build.

Screenshots / video

Each row: before (main, loop on) | after, loop off | after, loop on. Top: roster row. Bottom: thread header pill.

compare light 320

compare dark 1280

Reduced motion: the ring and orbit go away and one static accent dot shows.

reduced motion

More variants and full frames

compare dark 320

compare light 1280

full roster light 320

full roster dark 1280

full thread dark 1280

Related Issues

N/A — requested directly by the user (Crew page polish).

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested a review from a team as a code owner October 7, 2026 22:29
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of df90ece6dda5e855cf31e7c8b41219116783b873 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that when a WebSocket frame stops a goal loop, the activePatrolOf registry read updates too; otherwise the OR in isLoopOn leaves "On watch" lit.

[DESIGN-REVIEWED] df90ece

Description read

[DESCRIPTION-READ] 3fd29890798a4d8700b6e20e7bbbfec47628f5fbee126e3837efc9ecea12c647

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of df90ece6dda5e855cf31e7c8b41219116783b873 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

isLoopOn checks two sources for one fact: the page's registry read activePatrolOf and the Redux automation store, which already holds goal loops.

Not justified as shipped

  • Item 3 — duplicate of website/src/store/chat/automations.ts:selectSidebarAutomationRunningKeys: the description keeps the registry read only "so nothing that showed before goes dark". But the selector already counts kind === 'legacy_goal_loop' ? record.active, filled from the REST snapshot and the live frames. After this diff activePatrolOf has 1 consumer (grepped activePatrolOf in MembersPage.tsx at HEAD: the definition plus the one call inside isLoopOn). The OR also means a loop that a live frame has stopped keeps its mark until the registry is polled again.
    Subtraction: drop the if (activePatrolOf(m)) return true branch and the activePatrolOf callback, so isLoopOn reads only loopRunningKeys.
    Clears when: the branch is removed, or a case is shown where the registry has an active loop that the store does not.

What this change ships

Inventory (8 items) — 7 justified

Intent: let a user see at a glance which crewmates have an automation loop running, without loop details. ADDITION.

  1. The avatar's goal-glyph badge becomes a ring with an orbiting dot (a static dot under reduced motion) — justified
  2. The tooltip loses the cycle count ("On patrol · 3 of 24" → "On watch") — justified
  3. Structured monitors now light the mark, as goal loops already did — duplicate of selectSidebarAutomationRunningKeys for the goal-loop half
  4. A visible "On watch" badge leads the roster row's preview line — justified
  5. The thread header pill shows the mark — justified
  6. The pill's visible and screen-reader activity lines end with "· On watch" — justified
  7. The "patrolling" filter now includes monitors — justified
  8. Three i18n keys replaced by loop_on; the capture script now counts the new selector — justified

[FIRST-PRINCIPLES-REVIEWED] df90ece

Description read

[DESCRIPTION-READ] 94b314faf1d1bfcf5531d24174ff8c8debbc2edea62c743e8dc8fcf5df1cda5f

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of df90ece6dda5e855cf31e7c8b41219116783b873 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The same state has two names: rows say "On watch" while the status filter for it says "Scheduled check-ins", and the pill reads "Idle · On watch".

Watch

  • Two names for one state. isLoopOn now drives both the roster's "On watch" mark and the status filter (patrolling: isLoopOn(m)). That filter's label is still filter_status_patrolling: "Scheduled check-ins", described as "run automatically on a schedule". A user who sees "On watch" on a row won't find a filter by that name. A live monitor is also not "on a schedule", so the description is wrong for half of what the filter now matches. This hits every user who filters, every time. Fix: rename the filter to "On watch" and say "keeps acting on its own" in its description.
  • The pill line reads as a contradiction. It shows ${pillActivity.label} · On watch, so the user sees "Idle · 2m ago · On watch". The blind reader said: "these seem to contradict each other. 'Idle' sounds like doing nothing and 'On watch' sounds like doing something." This is on the thread header, the most-seen surface, every time a loop is on. Fix: when a loop is on, put "On watch" first and drop "Idle" (e.g. "On watch · 2m ago").
  • The main mark is understood, but only as a guess. The reader read the ring, the dot and the "On watch" tag correctly ("radar seems to be busy watching or keeping an eye on something"), but rated it "a guess". They also couldn't tell the purple corner dot from builder's green dot ("can't tell what different colours mean"). Under reduced motion only the dot is left, which makes this worse. Fix: keep the visible word on every surface (it already is). Consider giving the reduced-motion static dot a different shape, such as a ring outline, not a filled dot.

Suggestions

  • The reader asked: "what is radar watching, and can I stop it?" The CrewLoopIndicator tooltip (title) only repeats "On watch". Change it to say where to see or stop the loop, e.g. "On watch — open details to manage". Its only job now is restating the visible word.

[UX-REVIEWED] df90ece

Description read

[DESCRIPTION-READ] 1b8fac4db0411e57d8562396cea2a2fca5fdd7805742122805d417cca1b8b70b

That sha256 names everything this verdict read: the PR description, plus the 11 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of df90ece6dda5e855cf31e7c8b41219116783b873 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] df90ece

False positive or not applicable? A repository writer can comment:
/ai-review override gpt df90ece6dda5e855cf31e7c8b41219116783b873: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed df90ece6dda5e855cf31e7c8b41219116783b873 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] df90ece

Verdict parsed from the review's SHA-scoped output markers for commit df90ece6dda5e855cf31e7c8b41219116783b873.

False positive or not applicable? A repository writer can comment:
/ai-review override fable df90ece6dda5e855cf31e7c8b41219116783b873: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 7, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=429854b7ea1f

rebutted
The pill's "Idle · " stays true: between checks the crewmate is idle, and the mark says only that a loop will wake it.
The task asked for the label as aria + tooltip and for no loop text in the header; a visible line would be the banner the user excluded.
Screen readers get the label on the pill's existing sr-only activity line, so both channels say the same two facts.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=0dcdbd29a2a6

rebutted
Tooltip + accessible name is the spec the user set for this mark (aria + tooltip, no visible loop text).
It is told apart from working by colour (accent vs green), corner and motion (orbit around the face vs the face itself), shown side by side in the screenshots.
The roster's existing status filter names the same set in words, for touch and scanning.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=95d6a504f760

rebutted
"Scheduled check-ins" (the filter, a category) and "Checking on work" (the mark, a present state) already share the one word "check".
Renaming the filter would touch rosterFilter.ts / the filter strings that sibling PRs #17808 and #17835 are editing; out of this PR's goal.

@iamwhatever
iamwhatever force-pushed the feat/crewmate-loop-indicator branch from 60662cb to cbe637b Compare October 8, 2026 07:46
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 8, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=24964b36aa6b

fixed
CrewLoopIndicator now mounts and unmounts through AnimatePresence with a 0.2s opacity fade, as the old badge did; duration 0 under reduced motion. Commit cbe637b.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=e25ae44fc82e

fixed
automationLoopOn is gone; isLoopOn reads selectSidebarAutomationRunningKeys directly (plus the existing registry read). Commit cbe637b.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 8, 2026
@iamwhatever
iamwhatever force-pushed the feat/crewmate-loop-indicator branch from cbe637b to 5e2dd03 Compare October 8, 2026 08:21
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The mark on the main path can't be read without its tooltip

fixed
The label is now a visible word: an accent "On watch" leads the roster row's preview line, and the pill's activity line reads "Idle · · On watch".
The ring is aria-hidden so the word is read once; the reduced-motion dot now sits beside that word, not alone.
Label renamed from "Checking on work" to "On watch" in every locale, per the suggestion. Commit 5e2dd03.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 8, 2026
A small accent ring with one slow orbiting dot around the crewmate's avatar, in the roster row and the thread header pill, while the crewmate's own thread has a live monitor or goal loop. Labelled "Checking on work" (aria + tooltip); no nudge text or cycle count. Under prefers-reduced-motion it is one static accent dot. Reads the Redux automation record kept by autonudge_state frames (monitors and goal loops), plus the existing registry read; replaces the roster's static patrol badge.
@iamwhatever
iamwhatever force-pushed the feat/crewmate-loop-indicator branch from 5e2dd03 to df90ece Compare October 8, 2026 08:55
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=e7ac5689c151

fixed
The roster's "On watch" word now renders through the shared Badge primitive (variant muted, accent tokens via className), keeping the label and test id. Commit df90ece.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=3745ed26ad10

fixed
The decorative prop and its non-decorative branch are removed; the mark is always aria-hidden with its tooltip, since every host shows the visible word. Commit df90ece.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=b9b1d793ad98

rebutted
Both words are true at once: Idle says no turn is running now; On watch says a loop will wake the crewmate.
The previous round's BLOCK asked for exactly this visible word in the pill; dropping Idle would hide the time-since line the pill exists to show.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=2c2d01e95a58

rebutted
The filter label and its icon live in rosterFilter.ts / filter strings that sibling PRs #17808 and #17835 are editing now.
Renaming them here collides with those PRs and widens this PR past its goal (the avatar mark); the filter still selects the same set.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=b61f1c3eaf36

rebutted
The user asked for a gentle animated pulse/orbit while a loop is active; a stop-after-N orbit would read as the loop ending.
It is a 6px dot at a slow 4s period, and all motion stops under prefers-reduced-motion (a static dot plus the visible word).

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=fe6c47d0ac16

rebutted
activePatrolOf is main's existing roster source (the old badge and the patrolling filter read it); this PR keeps it and adds the store, it does not introduce it.
The store is seeded best-effort (a failed REST seed is unknown, not empty), while this query refetches on reconnect; dropping it is a behaviour change outside this PR's goal.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=6f50b1f413d6

rebutted
Same as span 2c2d01e95a58 on the prior head: the filter strings live in rosterFilter.ts/filter keys that sibling PRs #17808 and #17835 are editing.
The filter still selects exactly the crewmates that show the mark; the wording follows in those PRs' lane.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=6561342260bf

rebutted
Same as span b9b1d793ad98 on the prior head: Idle (no turn running now) and On watch (a loop will wake it) are both true.
The visible word in the pill was the prior round's BLOCK fix; removing Idle would drop the time-since line.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=0674b40f8553

rebutted
The reader read the mark correctly with the visible word; the residual is colour alone, which is why the word exists.
Working stays green bottom-right and animates the face; the loop mark is accent, orbits, and is named in text, so the two are told apart without colour.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=9f83a89cccf2

rebutted
The user asked for no loop details on this mark; managing the loop lives in the drawer's patrol block and the composer's automation popover.
The tooltip restating the word is harmless; a 'manage' hint would point at a control this mark does not open.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 8, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Self-review (crew-pr-reviewer, read-only): RECOMMEND APPROVE

The PR replaces the roster's goal-loop-only patrol badge with a CrewLoopIndicator ring plus a visible "On watch" word, driven by selectSidebarAutomationRunningKeys (structured monitors and goal loops) OR'd with the existing activePatrolOf registry read. That fixes the root gap, which was that monitors never showed. I read the full diff (CrewLoopIndicator.tsx, MembersPage.tsx wiring into the row, the pill and signalsOf().patrolling, the capture script and the locale key swap) and both new test files; MembersPage.loop.test.tsx dispatches a real sseAutomation monitor frame and would fail on base, where no member-loop-indicator exists. I checked the Design lane's warning that the OR could leave a stopped loop lit: MembersPage.tsx:2482 notes that the WS hook invalidates AUTONUDGE_LOOPS_QUERY_KEY on every autonudge_state frame, so the registry half refetches on the same frame and the stale window is one refetch, not a poll interval. The First Principles CONCERNS (the duplicate source) and the UX CONCERNS (the "Scheduled check-ins" filter name, "Idle · On watch") are advisory and answered on the current head with reasoned rebuttals; the filter rename is reasonably left to the sibling PRs that own rosterFilter.ts. Base is main, there are no non-green checks or reviews, the change is front-end only and medium-sized, and the GPT and Opus lanes have no findings. — crew-pr-reviewer

@iamwhatever
iamwhatever enabled auto-merge (squash) October 8, 2026 15:51

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve at df90ece6dda5e855cf31e7c8b41219116783b873.

Verified at head:

  • website/src/store/chat/automations.ts:11-18: selectSidebarAutomationRunningKeys keeps active legacy goal loops and active, non-terminal structured monitors, so structured monitors now count.
  • automations.ts:39-45: a seed completion drops only records of the completed kind and never a protected slot.
  • website/src/pages/members/MembersPage.tsx:2531-2539: a crewmate is "on watch" when it has an active patrol or its slot key is among the running automation keys. No per-row requests are added; it reads the existing Redux state fed by hooks/websocket/automationSeed.ts:96-172.

Fail-open / closed: no new error path. If a reseed fails, the mark can stay on after a monitor stopped; that seed rule is inherited, not introduced. Upgrade impact / audience fit: display-only; the roster tooltip drops the cycle count but the drawer still has the details. Rows without a live loop are unchanged.

Tests / mutation: CrewLoopIndicator.test.tsx + MembersPage.loop.test.tsx 6 passed. Forcing the slot-key branch of isLoopOn to false reddens a live monitor (Redux, from WS frames) marks only that crewmate, with no loop details and the open thread header shows it too, keeping the pill named by the crewmate.

Non-blocking follow-ups:

  1. fr loop_on = "En veille" usually reads as standby/sleep; consider "En garde" or "Sous surveillance".
  2. The filter says "Scheduled check-ins" / "run automatically on a schedule" while the mark says "On watch"; a structured PR monitor is not schedule-driven, so align the filter copy.
  3. The comment at MembersPage.tsx:2486 mentions an interval floor, but the query sets no refetchInterval (pre-existing).
  4. docs/feature-map/README.md (Crew Members) could list components/crew/CrewLoopIndicator.tsx.

CI: 85 success, 13 skipped, 0 failing. Not run: tsc, eslint, screenshots, a browser check.

@iamwhatever
iamwhatever merged commit 43e7f5a into main Oct 8, 2026
102 checks passed
@iamwhatever
iamwhatever deleted the feat/crewmate-loop-indicator branch October 8, 2026 16:27
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 8, 2026
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.

2 participants