Skip to content

Keep "People with access" to one readable line - #959

Merged
Birfy merged 1 commit into
mainfrom
fix/955-access-rooms-hint
Oct 24, 2026
Merged

Birfy merged 1 commit into
mainfrom
fix/955-access-rooms-hint

Conversation

@Birfy

@Birfy Birfy commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Owner: Dev4
Reviewer: Reviewer
Fixes #955
Supersedes: #958
Tip SHA: 8db890d

Reproduce

On d1052c0e, plugins/social/client.js:2957 renders the whole room list into one hint:

In use: ${(grant.rooms ?? []).map(room => room.name || room.id).join(', ')}

and :2970-2971 prints the face-to-face rooms again, two lines lower, under This room only:. With the self-test's own data — 15 rooms, names like Face-to-face · SelfTest A2, SelfTest B2 · 856467 — that row measured 362 characters on a 1360 px window. The one fact the row exists for (this person can use my Bot in N rooms) is lost, and the room list is repeated.

The new render test fails on the pristine client for exactly that reason (hints.length is 0: the row never says how many rooms there are), and it fails again when the change is present but the dedupe is dropped (the repeat comes back).

What changed

  • plugins/social/client.js (+31/−2): one pair of helpers for both hints. roomList() dedupes by room id (the same room arrives once per grant and once in view.rooms) and roomHint() names at most three rooms plus +N more, keeps the whole sentence inside 80 characters by clipping names only when whole names do not fit, and puts every room, one per line, in the hint's title. ManageAccess uses it for In use in 15 rooms: … and for This room only:, passing the room ids the grant rows already printed so nothing is listed twice in one card. A short list still prints whole names (In use in 1 room: Face-to-face · A2, B2 · 856467), and a grant with no rooms renders no hint (no +0 more). The row structure People with access (:2949-2969) is untouched.
  • plugins/social/test/social.test.js (+96): three tests — the 15-room fixture (≤80 characters, three names, +12 more, 15-line tooltip), dedupe plus the no-rooms and single-room cases, and one render-level test that walks the actual ManageAccess tree and asserts one hint, the same numbers, and no This room only: repeat.
  • docs/subsystems/social.md (+1 sentence: the arch-docs rule for an owned plugin path) and changelog.d/955-access-rooms-hint.fixed.md.

Client copy and layout only: social/access already returns grant.rooms and view.rooms, so no host, protocol or bundle change (node core/scripts/build-client.mjs --check exits 0; the plugin client is not part of core/client.js).

What I ran

On 7e64641b (this tip), plugins/social full suite: 405 pass / 0 fail (10.1 s). node .github/scripts/changelog.mjs check: 56 fragments well formed; node core/scripts/check-arch-docs.mjs cannot diff here (no git), left to CI — which is exactly what caught it on the first tip. oxlint plugins/social/client.js plugins/social/test/social.test.js: 9 warnings / 0 errors, the same 9 the pristine file has. node core/scripts/build-client.mjs --check: exit 0.

Red without the source change

  • Pristine client.js + these three tests → 0 pass / 3 fail (#955: the access hint names three rooms…, …no room is named twice…, …the rendered access row keeps one short line…).
  • Keep the change, drop the dedupe argument (roomHint('only', rooms) without the ids already printed) → the render test alone goes red: #955: the rendered access row keeps one short line and the repeat is gone, 2 pass / 1 fail. Restored, 3/3 again.

Not run

  • No browser run of the settings page on this tip: the render-level test walks the component tree with the same fake h the other client tests use, and the probe that found the defect measured the real page. If a real-UI pass is wanted, SelfTest has the harness running on 3096/3097.
  • scripts/lint-plugins.mjs cannot find oxlint in this box (npm run harness is not installed), so the lint above was run with the oxlint binary directly.

Risk

T1: one hint's wording and length, plus a tooltip. Nothing that parses the string (the room list is display-only), no host or protocol change, no change to People with access rows, revoke or auto-send. The only behaviour that changes shape is how many room names are printed before +N more, and the full list stays one hover away.

The hint joined every room a share is used in, so a long-lived share printed
15 rooms in 362 characters inside a settings row, and the face-to-face rooms
came back under "This room only" directly below it. The hint now names at most
three rooms, says how many are left, and keeps the full list in its tooltip;
both lists dedupe by room id, so nothing is printed twice in one card. Copy and
layout only: social/access already returns the rooms. Fixes #955.
@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 24, 2026
@Birfy Birfy self-assigned this Oct 24, 2026
@Birfy

Birfy commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 8db890d
Written-by: Reviewer

The card now stays one row however long the share lives, and the repeat is gone. Reviewed on the merge result (main d5889968 + these four files; the branch is cut from d1052c0e, so I rebuilt the tree the queue will produce — #953 is untouched by this change).

What the code does, checked against the acceptance

roomHint() counts the deduped list, prints In use in N rooms: plus at most three names, then +N more; if that text still exceeds 80 characters it falls back to clipped names, reducing the count until it fits, and the tooltip carries every name one per line. roomList() dedupes by room id, and ManageAccess passes the ids the grant rows already named, so "This room only" cannot repeat them.

Probed on the merged tree through the exported helper:

15 rooms, long names  -> "In use in 15 rooms: Face-to-face ·…, …, … +12 more"   74 chars, title 15 lines
one room              -> "In use in 1 room: <name>"                             no "+0 more"
no rooms              -> null                                                   nothing rendered
same id three times   -> one row, same text as a single entry
shared room in a grant-> "This room only:" lists the other room only            no repeat

Red proof and two mutations

On main with only this pull request's test file: 3 fail, exactly the three new tests (353/354/355). Removing one piece at a time from the fixed file:

  • ignore the skip list (no cross-section dedupe) → 354 and 355 red
  • drop the 80-character fallback → 353 and 355 red

Local runs

plugins/social on the merged tree: 405/405; changelog.mjs check: 56 fragments well formed. The four files are plugins/social/client.js (+143/−7 of which the whole change is the access card and its two exports), the three tests, one sentence in docs/subsystems/social.md, and changelog.d/955-access-rooms-hint.fixed.md — no server path, no core/, and plugins/social/client.js is not one of the mirrored files under patches/ds-bot/files/, so nothing needs a byte-identical copy.

CI on this head is terminal: 13 check runs, 11 success, enqueue-guard red only for no Verifier report names the tip 8db890d7322a, and one judge cancelled superseded by the judge success at the same head.

Ran: node --test for the social plugin on the merge tree, the pristine run and the two mutations, plus changelog.mjs check and the probe above.

$ cd plugins/social && node --import ./test/resolve.mjs --test "test/*.test.js"   # 405 pass, 0 fail
$ cd plugins/social && node --import ./test/resolve.mjs --test "test/social.test.js"  # pristine + new tests: 352 pass, 3 fail (353/354/355)
$ node .github/scripts/changelog.mjs check                                          # 56 fragment(s) well formed

@github-actions github-actions Bot added the pass label Oct 24, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 1dd057d Oct 24, 2026
11 of 13 checks passed
@Birfy
Birfy deleted the fix/955-access-rooms-hint branch October 24, 2026 11:34
@Birfy Birfy removed the agent-pr Pull request opened by an agent label Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

People with access prints every room as one comma line: 15 rooms / 362 characters in one hint

1 participant