Repository navigation
client: a read-only window's face-room overview still draws the Room lead's Change, and a hint that is false there - #2513
Merged
Conversation
HugoXK
marked this pull request as draft
November 5, 2026 07:11
HugoXK
force-pushed
the
dev/2-face-lead-readonly
branch
from
November 5, 2026 08:03
aed40ab to
fc6a6fa
Compare
HugoXK
marked this pull request as ready for review
November 5, 2026 08:12
HugoXK
marked this pull request as draft
November 5, 2026 08:18
The face room's lead card (FaceLead) offered Change whenever the room said canPick, and the host keeps canPick: true for the creator in a read-only window while refusing social/face-lead with bot/read-only. The card now reads lockedWindow(roster) too: the lead's name and its sentence stay, the button, its picker and the "only the person who created this room" hint go. A writable window is unchanged.
HugoXK
force-pushed
the
dev/2-face-lead-readonly
branch
from
November 5, 2026 08:59
fc6a6fa to
b8e4b8f
Compare
HugoXK
marked this pull request as ready for review
November 5, 2026 09:29
Contributor
Author
|
Enqueue request — PR #2513 at
Please enqueue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2512
Owner: Dev-2
Reviewer: Birfy
Written-by: FlyBot Dev-2
Claim-Id: 660434858f894844b50bfa7688ee56ae
Risk tier: T1
What changes
A read-only (locked) window's Drawer overview of a face-to-face room still drew the Room lead card's Change, and, for anyone the host reports as not able to pick, the sentence
Only the person who created this room can change it.. Neither belongs there:social/face-leadis registered without{ read: true }(plugins/social/src/social.js:4684), so the host's channel layer answers itbot/read-only. Pressing Change is therefore a live-looking control whose only possible result is a refusal.FaceLead(core/src/client/group-settings.js) decided withlead.canPick === true && typeof pick === 'function', and the host reportscanPick: truefor the room's creator regardless of the window (plugins/social/src/face-rooms.js:519,core/src/host/face-lead.js:29passes it through). The card already receives the roster, so it can tell a locked window from a writable one itself; nothing has to be threaded down fromdetails-drawer.js.The fix is one guard in the card:
FaceLeadreadslockedWindow(roster)(the same helper every other read-only surface uses,core/src/client/schedules.js:141), folds it intocanPick(!locked && lead.canPick === true && typeof pick === 'function'), and skips the only-the-person hint whenlocked. A locked card keeps the lead's name, itsBot (person)label, its Lead tag and the sentence about what the lead does; it draws no Change, no picker, no Make lead, no Use the default lead and no refusal hint. A writable window is byte-identical to the base: Change → picker → one press sends exactly onesocial/face-lead, and a non-creator still reads the only-the-person sentence.Rebased onto
523a384298f9f7989147ca25a2fd2b219ffd1d46(#2510, merged after this branch was first pushed). The rebase again mergedpatches/ds-bot/0008-client-bundle.patchandpatches/ds-bot/0012-room-membership.patchwithout a textual conflict;build-client+ds-bot-patches generatethen rewrote the same bytes, sogit status --porcelainis empty and no patch file was hand-edited.Scope:
core/src/client/group-settings.js, one new test file, one doc sentence, one changelog fragment, and the regeneratedcore/client.jsplus thepatches/ds-bot/copies the repo's build requires.details-drawer.js, the host'ssocial/face-leadregistration,face-rooms.jsand every other read-only surface are untouched.Acceptance
In a read-only window, opening a face room's Drawer overview:
Room lead,Chief (Ann)) with the sentence about what the lead does;buttonLabels(card)is[], not merely that a drawn button is disabled — so Change, Make lead and Use the default lead are all absent;Only the person who created this room can change it.hint is not drawn (it is false for the creator here), for the creator and for a non-creator alike;hostCallsis empty), so nothing is attempted and nobot/read-onlycan come back.The neighbouring writable control, in the same test file, is unchanged: Change is drawn, pressing it lists the other seat with Make lead, one press is exactly
[['social/face-lead', { roomId: 'face', bot: '@writer.bob.home' }]], someone who is not the creator still sees no Change and does read the only-the-person sentence.Red first
On the clean base
523a384298f9f7989147ca25a2fd2b219ffd1d46(the rebased base), in a throwaway detached worktree at that commit with the base source untouched and only this branch's test file added,node --import ./test/harness-resolve.mjs --test test/details-face-lead-readonly.test.jsunderTZ=UTC:These are the same two
not oklines the pre-rebase run produced one5fc62dea0c067a308fbf8f122d691a35e455fb1:3tests,1pass,2fail. With the fix in place the same file is 3/3 green, and the writable positive control is unchanged from the base.What I ran at
b8e4b8fa66f7b00afacc8a5c9480c140d5c479b6(TZ=UTC, clean tree, treeb50e5031)node core/scripts/build-client.mjsthennode scripts/ds-bot-patches.mjs generateon the committed tree: both wrote the same bytes back (git status --porcelainempty afterwards), andnpm run verify's owncanonicalgate reportsok patches/ds-bot/ is what generate writes (generate is a no-op).node scripts/ds-bot-patches.mjs check(insideverify) — threeoklines:ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5),ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/;canonical—ok patches/ds-bot/ is what generate writes (generate is a no-op); a secondgenerate+build-clientrun afterwards leavesgit status --porcelainempty (idempotent).TZ=UTC ARCH_DOCS_BASE=523a384298f9f7989147ca25a2fd2b219ffd1d46 npm run verify— exit 0. Segment counts, each# fail 0and# cancelled 0: core 2927 success + 0 cancelled, plugins/social 577 + 0, plugins/tree 137 + 0, plugins/timeline 141 + 0, plugins/workflow 440 + 0,.github/scripts+policy671 + 0,test:interop37 + 0,test:live-e2e26 + 0 — 4956 success + 0 cancelled, 0 failed.arch-docs: OK (8 changed file(s)); every lint stage exit 0 with 0 errors (warning counts 81/36/9/2/16, unchanged from the base commit);build-client.mjs --checkexit 0 in the same run.face-lead,settings-readonly-pages,settings-readonly-head,details-bot-settings-readonly,details-face-lead-readonly,details-group-overview-readonly,details-group-settings-readonly,details-overview-readonly,room-approvals-readonly,group-create-readonly,composer-send-readonly,readonly-window-reads,approvals-readonly): 52/52, 0 failed.git status --porcelain— empty on the committed tree.What I did not run
core/src/client/**), no host code.#2509/#2510's surfaces and any other read-only card — out of scope for this issue and untouched here.Files
8 files, +400/−11 (
git diff --numstat 523a3842...b8e4b8fa), treeb50e5031:core/src/client/group-settings.js(+8/−2) —FaceLeadreadslockedWindow(roster), folds it intocanPick, and skips the only-the-person hint when locked; hand-written.core/test/details-face-lead-readonly.test.js(+187, new) — the two read-only cases plus the writable positive control; hand-written.docs/subsystems/core-client.md(+1/−1) — the face-room lead paragraph gains the locked-window sentence and points at the test.changelog.d/2512-face-lead-readonly.fixed.md(+1, new).core/client.js(+3/−2),patches/ds-bot/0008-client-bundle.patch(+4/−3),patches/ds-bot/0012-room-membership.patch(+9/−3),patches/ds-bot/files/test/details-face-lead-readonly.test.js(+187, new) — generated by build +generate, never hand-edited.{ "pr": 2513, "claim": "Dev-2", "issue": 2512, "summary": "A read-only window's face-room overview no longer draws the Room lead card's Change: social/face-lead is a write the host answers bot/read-only, and the host still reports canPick true for the room's creator. FaceLead now reads lockedWindow(roster) itself, so canPick is false even for the creator and the 'only the person who created this room' hint is skipped as false there. A locked card keeps the lead's name and its sentence only; a writable window is unchanged, one press still sends exactly one social/face-lead.", "files": [ "core/src/client/group-settings.js", "core/test/details-face-lead-readonly.test.js", "docs/subsystems/core-client.md", "changelog.d/2512-face-lead-readonly.fixed.md" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=523a3842 npm run verify (plus build-client and ds-bot-patches check/generate)", "result": "green", "at": "b8e4b8fa66f7b00afacc8a5c9480c140d5c479b6" }, "next": "none — ready for review" }