Skip to content

client: a read-only room approval card draws no decision and says why - #2382

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/2-room-approvals-readonly
Nov 4, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/2-room-approvals-readonly

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2381

Owner: Dev-2
Reviewer: Birfy
Claim-Id: a08289a30428444bbafe5b2dc15e16db
Branch: dev/2-room-approvals-readonly
Tip: ee2abe5
Tree: 81cdcb0919083fe8a09f32b4125c9a1493f7351e
Base: 205bd44
Diff: 10 files, +1030/-588 (5 hand-written, 222 changed lines; 5 generated)
Tier: T1
why: []
basis: core/client.js=T1, core/src/client/details-drawer.js=T1, core/src/client/i18n.js=T1, core/test/room-approvals-readonly.test.js=T1, patches/ds-bot/0001-core-fixes.patch=T1, patches/ds-bot/0008-client-bundle.patch=T1, patches/ds-bot/0012-room-membership.patch=T1, patches/ds-bot/files/test/room-approvals-readonly.test.js=T1, docs/subsystems/core-client.md=T0, changelog.d/2381-room-approvals-readonly.fixed.md=T1; lines 222, files 5, generated 5
Docs: docs/subsystems/core-client.md — the Owns section gains one SharedRoomApprovals bullet: the shared room overview card draws no Approve/Reject in a read-only window and carries the host sentence in one role="status" line, a decision the host still refuses writes one role="alert" line (bt-error) instead of vanishing, both try/finally swallowed it before, and core/test/room-approvals-readonly.test.js covers it.

What changed

A window that holds the team read-only no longer draws Approve / Reject on the shared room overview's "Waiting for your approval" card (details-drawer.js SharedRoomApprovals). A decision is a write (social/decide-approval), so the host refuses it there with bot/read-only — or bot/blocked-shared in a room with several members — and the two buttons could only earn that refusal after the click.

Before: the card was mounted with h(SharedRoomApprovals, { key: 'approvals', room }), so it had no roster and no lock of its own, and it drew both buttons in a window that cannot decide; decide was a try/finally with no catch, so the refusal it got back was swallowed and the card said nothing at all.

After: SharedRoomApprovals({ room, roster }) reads lockedWindow(roster) — the same helper the drawer's own Settings view already used (details-drawer.js:270) — and in a read-only window replaces the two buttons with one div.bt-hint.bt-read-only line (role="status") carrying hostText(roster.readOnly). The headline, the count and each request's own text stay. A decision the host still refuses now writes one div.bt-error line (role="alert") with the failure's own sentence, or The decision was not sent. when it carries none (zh added in core/src/client/i18n.js), instead of vanishing.

Generated: core/client.js and patches/ds-bot/0008 from core && npm run build + generate; 0001 carries the i18n line, 0012 the component, patches/ds-bot/files/test/ the new test.

Verification at the tip

Tip SHA: ee2abe5

Ran:

  • Red first, on a clean 205bd44f worktree carrying only core/test/room-approvals-readonly.test.js from this branch: 3 tests, 0 pass, 3 fail, 0 cancelled — a read-only window draws neither Approve nor Reject on the room approval card (actual ['Approve','Reject']), the read-only room card carries the host sentence in one status line (0 !== 1), a refused decision says so in one alert line instead of vanishing (the refusal is written once — 0 !== 1).
  • After the fix: the same file 3/3, and the eight neighbouring client files (details-bot-settings-readonly, details-copy, ui-clickthrough, link-room-title, looks, approvals-readonly, i18n, this one) 44/44.
  • TZ=UTC ARCH_DOCS_BASE=205bd44f npm run verify — exit 0: 2800 + 570 + 132 + 140 + 411 + 671 + 37 + 26 = 4787 pass, 0 fail, 0 cancelled; lint 0 errors (core 75 warnings, plugin 36/9/2/16, scripts 1); arch-docs: OK (10 changed file(s)).
  • node scripts/ds-bot-patches.mjs generate — second run a no-op (clean tree).
  • node scripts/ds-bot-patches.mjs check exit 0 (10 patches apply cleanly in order, core/ equals ds-bot/ + patches/ds-bot/), canonical exit 0, node core/scripts/build-client.mjs --check exit 0.
  • node .github/scripts/changelog.mjs check exit 0 (18 fragments), check-empty-catch.mjs exit 0, check-mojibake.mjs exit 0 (0 occurrences in 1440 files).
  • Live 205bd44f .github/scripts/enqueue-rules.mjs checkpointReasons(body, { pr, files }) on this body and this diff: [].

Not run (and why): no hand walkthrough against a running host — none is installed on this box; the client behaviour above is measured through the fake React renderer approvals-readonly.test.js already uses, not jsdom. Nothing in npm run verify was skipped.

Checkpoint

{
  "pr": 2382,
  "claim": "Dev-2",
  "issue": 2381,
  "summary": "The shared room overview's approval card no longer draws Approve or Reject in a read-only window: it reads lockedWindow(roster) like the drawer's Settings view and prints the host's own sentence in one status line, keeping the headline, the count and each request's text. A decision the host still refuses — a writable window, or a room with several members — now writes that reason in one alert line instead of vanishing. Tests: core/test/room-approvals-readonly.test.js, 3 red then 3 green on 205bd44f; verify 4787 pass.",
  "files": [
    "core/src/client/details-drawer.js",
    "core/test/room-approvals-readonly.test.js",
    "core/src/client/i18n.js",
    "core/client.js",
    "patches/ds-bot/0012-room-membership.patch",
    "patches/ds-bot/0008-client-bundle.patch",
    "patches/ds-bot/0001-core-fixes.patch",
    "patches/ds-bot/files/test/room-approvals-readonly.test.js",
    "docs/subsystems/core-client.md",
    "changelog.d/2381-room-approvals-readonly.fixed.md"
  ],
  "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=205bd44f npm run verify (4787 pass, 0 fail); generate no-op; patches check+canonical; build-client --check; changelog; empty-catch; mojibake; lint 0 errors; red-first 3/0/3 then 3/3", "result": "green", "at": "ee2abe5ff7268082a21236fd230ae8af30ad0d9f" },
  "next": "none — ready for review"
}

@HugoXK
HugoXK marked this pull request as ready for review November 4, 2026 10:27
@Birfy
Birfy added this pull request to the merge queue Nov 4, 2026
@HugoXK

HugoXK commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy — queue request for a T1 head (one comment, this tip only).

  • PR client: a read-only room approval card draws no decision and says why #2382 — client: a read-only room approval card draws no decision and says why, base 205bd44fa57cf1c1e4d520e04018b9c12774ad0b
  • Tip ee2abe5ff7268082a21236fd230ae8af30ad0d9f, tree 81cdcb0919083fe8a09f32b4125c9a1493f7351e, single parent, 1 commit
  • 10 files +1030/−588 (5 hand-written, 222 changed lines; 5 generated): core/src/client/details-drawer.js +23/−4, core/src/client/i18n.js +1/−0, core/test/room-approvals-readonly.test.js +192/−0, docs/subsystems/core-client.md +1/−0, changelog.d/2381-room-approvals-readonly.fixed.md +1/−0, core/client.js +13/−5, patches/ds-bot/0001-core-fixes.patch +2/−1, patches/ds-bot/0008-client-bundle.patch +581/−573, patches/ds-bot/0012-room-membership.patch +24/−5, patches/ds-bot/files/test/room-approvals-readonly.test.js +192/−0
  • Tier T1 (computed), and enqueue-guard says so itself: enqueue #2382: no \hold` and the gate passes/no PASS needed: computed tier T1`
  • Checks at this tip: 17 success + 0 cancelled + 0 failure (tests-ok, merge-gate, judge, policy-sign, package, four plugins (…), reviewed tip, risk tier, enqueue-guard, Node 24 · DSH 0.2.0-rc.2, agent-audience)
  • Non-draft since 2026-11-04T10:27:21Z, maintainer_can_modify: true, mergeable_state: clean, body opens with Fixes #2381

Request: send this head to the merge queue. T1 carries no Verdict requirement, so the only thing this PR is waiting on is the queue itself.

Advisory from FlyBot Test, run independently at this same tip (advisory, not a gate): PASS at ee2abe5f — red first on base 205bd44f with only the new test file is 3 = 0 pass + 3 fail (a read-only card still offered ["Approve","Reject"], 0 read-only lines, 0 alert lines), and at the tip the new file is 3/3 with seven neighbouring client files 40/40/0; TZ=UTC ARCH_DOCS_BASE=205bd44f npm run verify → 4787 pass, 0 fail, 0 cancelled; build-client --check and a second generate are clean.

On the base field: main has since moved to 9a0a106b (#2380). This head was not rebased, deliberately and on measurement: merging it into 9a0a106b locally is conflict-free, scripts/ds-bot-patches.mjs check on the merged tree reports 10 patches apply cleanly in order plus core/ equals ds-bot/ + patches/ds-bot/, canonical reports generate is a no-op, build-client --check exits 0, and room-approvals-readonly 3/3, details-bot-settings-readonly 3/3, questions-readonly 6/6, approvals-readonly 6/6, diagnostics 41/41, store 20/20 on that merged tree. The tip is unchanged, so the advisory above still names it.

What it changes, in one line: the shared room overview's approval card read lockedWindow(roster) (already used by the drawer's Settings view) and in a read-only window replaces Approve/Reject with one role="status" line carrying the host's own sentence, keeping the headline, the count and each request's text; a decision the host still refuses writes that reason in one role="alert" line instead of vanishing in a try/finally with no catch.

Merged via the queue into ThinkFlowLab:main with commit 1848d0d Nov 4, 2026
17 checks passed
@Birfy
Birfy deleted the dev/2-room-approvals-readonly branch November 4, 2026 10:37
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.

client: a read-only window still draws Approve/Reject on the room overview card, and the refusal vanishes

2 participants