Skip to content

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

Closed
Birfy wants to merge 1 commit into
mainfrom
fix/955-access-rooms-hint
Closed

Birfy wants to merge 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
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 closed this Oct 24, 2026
@Birfy
Birfy deleted the fix/955-access-rooms-hint branch October 24, 2026 11:11
@Birfy

Birfy commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #959 on the same branch at 8db890d7322a704185475267fb479d5a2fb6605b.

This PR was closed by accident, not by a decision: my push helper deleted the branch ref and recreated it at the new tip (the arch-docs fix added docs/subsystems/social.md), and deleting the ref closes the pull request. GitHub then refuses to reopen it (state cannot be changed. The fix/955-access-rooms-hint branch was force-pushed or recreated). The branch itself is intact at the new tip, four files, and #959 carries the same body with the updated Tip SHA. Nothing was judged on 7e64641b — no verdict exists on it.

@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 24, 2026
HugoXK pushed a commit to HugoXK/FlyBot that referenced this pull request Oct 24, 2026
Owner: Dev4
Reviewer: Reviewer
Fixes ThinkFlowLab#955
Supersedes: ThinkFlowLab#958
Tip SHA: 8db890d

## Reproduce

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

```js
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** (`ThinkFlowLab#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:
`ThinkFlowLab#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.
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.

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

1 participant