Repository navigation
Keep "People with access" to one readable line - #959
Conversation
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.
|
Verdict: PASS at 8db890d The card now stays one row however long the share lives, and the repeat is gone. Reviewed on the merge result ( What the code does, checked against the acceptance
Probed on the merged tree through the exported helper: Red proof and two mutationsOn
Local runs
CI on this head is terminal: 13 check runs, 11 Ran: |
Owner: Dev4
Reviewer: Reviewer
Fixes #955
Supersedes: #958
Tip SHA: 8db890d
Reproduce
On
d1052c0e,plugins/social/client.js:2957renders the whole room list into one hint:and
:2970-2971prints the face-to-face rooms again, two lines lower, underThis room only:. With the self-test's own data — 15 rooms, names likeFace-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.lengthis 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 inview.rooms) androomHint()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'stitle.ManageAccessuses it forIn use in 15 rooms: …and forThis 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 structurePeople with access(:2949-2969) is untouched.plugins/social/test/social.test.js(+96): three tests — the 15-room fixture (≤80characters, three names,+12 more, 15-line tooltip), dedupe plus the no-rooms and single-room cases, and one render-level test that walks the actualManageAccesstree and asserts one hint, the same numbers, and noThis room only:repeat.docs/subsystems/social.md(+1 sentence: the arch-docs rule for an owned plugin path) andchangelog.d/955-access-rooms-hint.fixed.md.Client copy and layout only:
social/accessalready returnsgrant.roomsandview.rooms, so no host, protocol or bundle change (node core/scripts/build-client.mjs --checkexits 0; the plugin client is not part ofcore/client.js).What I ran
On
7e64641b(this tip),plugins/socialfull suite: 405 pass / 0 fail (10.1 s).node .github/scripts/changelog.mjs check: 56 fragments well formed;node core/scripts/check-arch-docs.mjscannot 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
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…).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
hthe other client tests use, and the probe that found the defect measured the real page. If a real-UI pass is wanted,SelfTesthas the harness running on 3096/3097.scripts/lint-plugins.mjscannot findoxlintin this box (npm run harnessis 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 accessrows, 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.