Repository navigation
fix(members): reopen the crewmate last opened, not the last chatted one - #19346
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Check that a remembered crewmate the search had hidden still shows as the selected row in the roster when the page reopens it. [UX-REVIEWED] dcd96a1 Description read[DESCRIPTION-READ] f516f1e34a670acf5257ba3700c53e78f345f04f7e22dc029f0bbcb6f2321e3c That sha256 names everything this verdict read: the PR description, plus the 3 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 |
First Principles Review (Opus 5.5) — ✅ human override accepted@CrysisDeu overrode this lane for |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the product owner's #19341 decision is recorded the way a reversal must be: this undoes #17808's accepted landing order, and the only record is this PR's own RFC amendment. [DESIGN-REVIEWED] dcd96a1 Description read[DESCRIPTION-READ] 5e3683dddc918bb28601ca352aa2c308a587d4d821b216f24e7e3dc93965535f 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
0599a55 to
a623ed8
Compare
Leaving the Crewmates page and coming back landed on the crewmate the user last CHATTED with, not the one they had open. A row that was only clicked never moves `last_chat_ts`, so ranking the server's last-chatted crewmate above the browser memory (the order #17808 chose for the restart case) reopened a different thread on every ordinary return. The landing now reads the browser memory first (`rememberedMember`: any row still on the roster, `default` included, never a default-only roster), then falls back to the last-chatted crewmate, then to the most recently used one. localStorage survives a gateway restart, so the restart case lands on the same row the user had open; a new browser or a cleared storage still gets the server's record. The `mc-members-last-member-chat-mark` key, `chatMarkOf`, `rememberedDefaultPick` and the restore-only `stamp` branch of `activate` existed only to rank a remembered `default` against the last chat; with the memory first they have no job and are removed. `resolveDefaultMember` loses its `remembered` parameter for the same reason: every production caller passed `null`. Spec (`crew-mode.md`) and the decision record (`rfc-crewmates-chatted-list.md`, new §3.1) are amended in the same change. §3.1 also records the product owner's answer to a generalized chat-mark tie-break: a crewmate's conversation is its Crewmates thread, there is no other place to chat with one, so the memory alone is the rule. Closes #19341
a623ed8 to
dcd96a1
Compare
|
/ai-review override first-principles dcd96a1: Product owner decision (Zezhen, #19341) — the Crewmates landing reopens the crewmate last opened; a crewmate's conversation is its Crewmates thread, there is no other place to chat with one, so last_chat_ts is only the no-memory fallback. RFC rfc-crewmates-chatted-list.md amended in §3.1 in this PR. |
Human judgment recorded@CrysisDeu marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Problem / Motivation
Goal: Coming back to the Crewmates page lands on the crewmate the user last opened.
Open crewmate B on
/membersby clicking its row (send nothing). Go to another page (Chat, Settings). Click Crewmates again. The page reopens crewmate A — whoever was most recently chatted with — not B. Reported in #19341 ("去了别的页面再回mate页不会回到最后点开的mate").Why it matters
Every return to the Crewmates page after a click-without-send drops the user into a thread they did not come back for. On a roster where one crewmate is chatted with often, every other crewmate is effectively impossible to "leave open".
Not a goal
last_chat_tskeeps those jobs).resolveMateLanding) or to the phone (no auto-open below md).last_chat_tsis recorded on the server.What changed (motivation → approach → change)
Symptom → cause → change:
/members(desktop)rememberedDefaultPick→lastChattedMember→ browser memory →resolveDefaultMemberrememberedMember(browser memory, any row still on the roster,defaultincluded) →lastChattedMember→resolveDefaultMemberresolveDefaultMember(remembered, ordered): last chatted → remembered →last_active_ts(ordered): last chatted →last_active_ts— therememberedparameter is dropped (every production caller passednull;rememberedMemberowns the memory)mc-members-last-member-chat-mark,chatMarkOf,rememberedDefaultPick,activate'sstamparg,restoredRefdefaultagainst the last chatCause: a row that is only opened never moves
last_chat_ts, so with the server's last-chatted crewmate ranked above the browser memory (#17808's order, chosen for the restart case) the memory could never win while any other crewmate had a newer chat stamp.Why memory-first still covers #17808's restart case: localStorage survives a gateway restart, so the restored row is the one the user had open.
lastChattedMemberstays as the fallback for a browser with no usable memory (new browser, cleared storage, remembered crewmate since deleted), where it still beats background recency.Product-shape: this reverses the landing row of
docs/request-for-change/rfc-crewmates-chatted-list.md(accepted, on main). The RFC is amended in this PR (§3.1, tracking-issues: 19341) on the product owner's direction in #19341 — a maintainer decision is needed for the First Principles lane since the amendment ships here.Why the memory alone, with no chat-mark tie-break (Design lane, round 1): the product owner's call is that a crewmate's conversation is its Crewmates thread — there is no other place to chat with one — so "chatted with another crewmate elsewhere since the open" is not a case the landing weighs. §3.1 records it under "Considered and rejected".
Spec
docs/system-specs/modules/crew-mode.md(landing rule) updated in the same commit.Backwards compatibility
Compatible: no API, schema or config change. The
mc-members-last-member-chat-marklocalStorage key is no longer read or written; a stale value is inert.Reader:
website/src/pages/members/MembersPage.tsx:activate-- crew page -- the only writer ofmc-members-last-member-chat-mark; its read site (the restore effect) is removed in the same diff, so no reader of the key remains (grep -rn chat-mark website/src src→ none).Reader:
website/src/pages/members/MembersPage.test.tsx-- crew page -- the tests that pinnedchatMarkOf/rememberedDefaultPickare replaced by therememberedMembertests below.Tests
website/src/pages/members/MembersPage.test.tsx:rememberedMember: the row the user last opened, whatever anyone chatted since (#19341)— unit: memory wins over a newerlast_chat_ts;defaultremembered like any row; null/''/gone → undefined; default-only roster → undefined.with no memory, the crewmate the user last CHATTED with outranks background activity—resolveDefaultMember(…)picks the last chatted;rememberedMember('alpha', …)picks the memory.a crewmate opened but not messaged since is the one a return lands on (#19341)— page-level, the issue's shape: alpha has the newestlast_chat_ts, beta an older one (so it is listed); click beta (no send), unmount, re-render bare/members→ beta opens, URL?member=beta, memory unchanged.a remembered crewmate that is gone falls back to the last-chatted one— page-level fallback.a remembered default is restored over the last-chatted crewmate— the fix(members): restore the default crewmate when it was opened last #17972 case, now without a chat mark.…with the chat mark,restoring default keeps the chat mark…,a default opened before the last chat … yields to that crewmate) — the behaviour they pinned is the one this PR reverses.with no memory, opens the last-chatted crewmate; the roster lists only chatted ones…— the listing test no longer seeds a memory it expected to be overridden.Pattern harvest
Not generalizable: a ranking order chosen for one case (restart) that was wrong for the common case (click without send); no lint can see which of two valid orderings the product wants.
Manual verification
N/A — unit coverage sufficient: the page-level test drives the exact click → leave → return sequence from the issue through the real
MembersPagewith the roster API stubbed.Screenshots / video
Why no screenshot: no component, layout or style changes; the diff changes which already-existing thread the page opens on return, and both before/after frames are the same Crewmates page with a different row selected.
Related Issues
Closes #19341