Skip to content

fix(members): reopen the crewmate last opened, not the last chatted one - #19346

Merged
CrysisDeu merged 1 commit into
mainfrom
fix/19341-members-restore-last-opened
Oct 12, 2026
Merged

CrysisDeu merged 1 commit into
mainfrom
fix/19341-members-restore-last-opened

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Coming back to the Crewmates page lands on the crewmate the user last opened.

Open crewmate B on /members by 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

  • No change to which crewmates are listed, or to the recent order (last_chat_ts keeps those jobs).
  • No change to Mate's first-visit landing (resolveMateLanding) or to the phone (no auto-open below md).
  • No change to how last_chat_ts is recorded on the server.

What changed (motivation → approach → change)

Symptom → cause → change:

Part Before After
Landing on a bare /members (desktop) rememberedDefaultPick → lastChattedMember → browser memory → resolveDefaultMember rememberedMember (browser memory, any row still on the roster, default included) → lastChattedMember → resolveDefaultMember
resolveDefaultMember (remembered, ordered): last chatted → remembered → last_active_ts (ordered): last chatted → last_active_ts — the remembered parameter is dropped (every production caller passed null; rememberedMember owns the memory)
mc-members-last-member-chat-mark, chatMarkOf, rememberedDefaultPick, activate's stamp arg, restoredRef rank a remembered default against the last chat removed — the memory ranks first, so there is nothing to tie-break

Cause: 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. lastChattedMember stays 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-mark localStorage 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 of mc-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 pinned chatMarkOf / rememberedDefaultPick are replaced by the rememberedMember tests 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 newer last_chat_ts; default remembered 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 newest last_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.
  • Removed: the three chat-mark tests (…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 MembersPage with 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

@CrysisDeu
CrysisDeu requested review from a team and KiroCrewCaptain as code owners October 12, 2026 08:17
@CrysisDeu
CrysisDeu requested a review from bolichen97 October 12, 2026 08:17
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

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 .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 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@CrysisDeu overrode this lane for dcd96a17192096fa3336e183f3207710eb8d6f2d via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

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 .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 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] dcd96a1

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

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

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] dcd96a1

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

@CrysisDeu
CrysisDeu force-pushed the fix/19341-members-restore-last-opened branch from 0599a55 to a623ed8 Compare October 12, 2026 08:45
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 12, 2026
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
@CrysisDeu
CrysisDeu force-pushed the fix/19341-members-restore-last-opened branch from a623ed8 to dcd96a1 Compare October 12, 2026 10:09
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

/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.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@CrysisDeu marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for dcd96a17192096fa3336e183f3207710eb8d6f2d.

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.

This decision applies only to this commit. A new push requires a new judgment.

@CrysisDeu
CrysisDeu merged commit c4c51aa into main Oct 12, 2026
101 of 103 checks passed
@CrysisDeu
CrysisDeu deleted the fix/19341-members-restore-last-opened branch October 12, 2026 10:48
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Oct 12, 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.

Crewmates page reopens the last chatted crewmate, not the last opened one, after leaving and returning

2 participants