Skip to content

feat(v2): Tools on the Connectors page — the granted half (piece 4, option A) - #1669

Merged
lilyshen0722 merged 4 commits into
mainfrom
wave/piece4-tools-page
Sep 12, 2026
Merged

lilyshen0722 merged 4 commits into
mainfrom
wave/piece4-tools-page

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Piece 4 of the connectors build, option A — the page half that reads only what is on main (docs/plans/tools-catalogue-room-grants.md §6). Depends on the read routes in #1668 (/api/pods/:podId/grants, /api/grants/:id/calls); renders nothing until they are live.

What renders (V2ConnectorTools.tsx, mounted under the channels list in V2ConnectorsPage):

  • Heading Tools + mono count (N granted), search field, segment (All / Granted / Not yet) on one line.
  • One row per grant in the connector row grammar and grid (200px minmax(0, 1fr) 200px 120px, measured): cobalt dot, pulsing when the newest trail row is <10 min old; hollow when revoked/expired; line 1 granted to **{room}** by **{member}**; line 2 {agents} may use it · {what asks first} or revoked/expired {rel}; mono granted {rel}; Manage (bordered, 32 tall).
  • Aside: granted by/ends, agents allowed (effectiveAudience → display labels from the pod roster), the allow-list under its write mode as chips, what asks first, budget, Revoke (two-click → POST /api/grants/:id/revoke, then reload).
  • Trail: calls / refused / awaiting a person in display 22 + mono 11 from counts (COUNT(*) by outcome), then {agent} · {tool} · {outcome} lines in muted mono, newest first. Outcomes are words, never coloured (invariant pinned).
  • 390: rows collapse like the channels (two lines, act top-right), aside stacks under; scrollWidth 390.

SEAM (Wren 67724/67725, Kai 67726): the not-yet row, Add and Change access wait on the builtin GitHub Installable landing in GET /api/installables with McpServer.enabledTools (and the server-derived brokerId). catalog is empty until then and those controls do not render — the page draws no control the server does not enforce. Two spec lines I could not source and left as words: "the list of irreversible tools" under write reads irreversible writes ask first until the catalogue carries the flags; revoked by {member} reads revoked {rel} because the grant record has no revokedBy.

Proof (fixture-fed build with the real v2.css, pw/shot-tools.js): before/after at 1440 and 390 — sent to Sam. Measured after: row grid 200px 242px 200px 120px at 1440, minmax(0,1fr) auto at 390; acts 73×32; counts 22px/11px; trail lines rgb(102,112,133) IBM Plex Mono; min font 11 (mono) / 12 (sans); scrollWidth 1440/390.

Tests: V2ConnectorTools.test.tsx 4 (states table, aside + trail + counts, two-click Revoke, search/segment/empty), V2ConnectorsPage unchanged 12/12, v2-layout-invariants 112/112 (+4 pins: trail muted mono, 22/11 counts, zh reset). tsc clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_016DspLEe1mFV94dPGCqA1u5

@samxu01
samxu01 force-pushed the wave/piece4-tools-page branch from 0c081c9 to 23c0d92 Compare September 11, 2026 22:25
@lilyshen0722

Copy link
Copy Markdown
Contributor Author

Refreshed onto main aef4c27d (#1670) and the seam is closed — head 23c0d92f, two Lily commits, seven frontend files.

From the catalogue (GET /api/installables, list: 'tools'): a not-yet row per tool Installable with no live grant (dashed dot, muted name, what it does, read, or read and write, not granted, Add ink); without a Connection or on an unconfigured instance the row says so and offers no Add. Add opens in the aside: room, connection (when >1), writeMode segment, the allow-list the mode admits (read → read tools; write modes → all), what asks first (the catalogue's irreversible tools under write), every non-internal seat checked, expiry 7/30/90, Grant. Body = connectionId, installationId, target, tools, writeMode, audience, expiresAt — never brokerId (pinned). Change access pre-fills from effectiveAudience and is a new grant + revoke of the old; Grant again on a dead row only mints. Direction A: mode and outcome carry a 14px mark with the word in title; the granted row no longer repeats the tool's description.

One contract note for Vera: the mint's installationId is sent as the Connection's connectionId (the catalogue's publicConnection exposes only that key, and findConnection matches on Integration.installationId) — if the field is meant to carry something else, say which and I'll wire it.

Measured (pw/shot-tools.js, real v2.css): rows granted to Launch pod by sam / granted to Ops by sam, grid 200px 242px 200px 120px at 1440 and minmax(0,1fr) auto at 390, count 0 granted · 1 more in the not-yet state, scrollWidth 1440/390. Screenshots (before/after/Add at 1440, before/after/Add at 390) sent to Sam.

Tests: V2ConnectorTools 7/7 (+3: not-yet + Add mint body, no-Connection state, Change access → mint then revoke + Grant again), V2ConnectorsPage 13/13, v2-layout-invariants 108/108, tsc 0. glyphs.tsx is byte-identical to #1671's copy, so the two branches merge clean in either order.

lilyshen0722 and others added 4 commits September 11, 2026 17:07
…ption A)

Tools plan §6: a second list under the channels in the same row grammar, one
row per RoomGrant the person can see (live · pulsing when used in the last
10 min · hollow when revoked or expired), the aside from the projected grant
(who granted it and when it ends, the agents allowed, the allow-list under its
write mode, what asks a person first, budget, two-click Revoke) and the trail
from the broker's rows — one muted mono line per ToolCall with the three
COUNT(*) numbers in display 22 / mono 11. Heading with the mono count, a
search field and a segment on the same line. 390 as the channels list.

SEAM (Wren 67724/67725): the not-yet row, the Add form and Change access wait
on the builtin GitHub Installable landing in GET /api/installables with its
McpServer.enabledTools; the server derives brokerId. Until then `catalog` is
empty and those controls do not render — nothing pretends to grant.

Reads only /api/pods/:podId/grants, /api/grants/:id/calls,
/api/registry/pods/:podId/agents (#1668). GitHub glyph added to the platform
set. Layout invariants: trail line is muted mono with no semantic colour;
counts are 22/11; the display titles reset under :lang(zh).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016DspLEe1mFV94dPGCqA1u5
… from the catalogue (#1670), with direction-A marks

The seam closes on Wren's catalogue: GET /api/installables now lists the
GitHub tool Installable (list: 'tools') with its projected allow-list and the
caller's Connections, so the page draws what the server enforces:

- not-yet row per tool Installable with no live grant — dashed dot, muted name,
  what it does, `read, or read and write`, `not granted`, Add (ink); without a
  Connection or on an unconfigured instance the row says so and offers no Add.
- Add opens in the aside: room, connection (when more than one), a writeMode
  segment, the allow-list the mode admits (read → read tools; write modes →
  all), what asks first (the catalogue's irreversible tools under `write`),
  every non-internal seat in the room checked, expiry 7/30/90 days, Grant (ink).
  The mint body is the server's: connectionId, installationId, target, tools,
  writeMode, audience, expiresAt — never a brokerId (Vera 67728).
- Change access pre-fills from the grant (effectiveAudience, not the raw
  snapshot — Vera 67568) and is a new grant plus a revoke of the old one;
  Grant again on an expired/revoked row only mints.
- "what asks first" under `write` lists the catalogue's irreversible tools.
- direction A (Sam 2026-09-11): the grant's mode and a trail line's outcome
  carry a 14px mark with the word in `title`; the granted row no longer repeats
  the tool's description sentence.

glyphs.tsx is the same file #1671 adds (identical content, merges clean).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016DspLEe1mFV94dPGCqA1u5
…m the Connection (#1677)

Vera 67821 via #1677: a grant on connection A must not be able to name
installation B, so the mint derives installationId from the Connection and
refuses a client-supplied one. The body is now exactly the six keys the route
takes — audience, connectionId, expiresAt, target, tools, writeMode — pinned
by key list, with brokerId and installationId both asserted absent.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016DspLEe1mFV94dPGCqA1u5
… revoke after Change access is retried alone; the trail says "awaiting a person"

Vera 67912 / Wren 67913 on 0368992:
- Revoke and Change access render only when grant.grantedBy is the viewer —
  the route 403s anyone else, so the page never draws a control the server
  would refuse. A member still reads the grant and its trail.
- Change access keeps the minted grant whatever happens next. If the revoke
  of the old grant fails, the aside says the old one is still live and offers
  "Revoke the old grant", which retries only the revoke — never a third mint.
- A trail line's outcome reads like the count: pending_approval → "awaiting a
  person" (the mark's title too).

Tests: "Revoke renders only for the granter"; the failed-revoke retry pins the
three POSTs as mint, revoke, revoke.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016DspLEe1mFV94dPGCqA1u5
@samxu01
samxu01 force-pushed the wave/piece4-tools-page branch from 0368992 to 830e3c8 Compare September 12, 2026 00:09
@lilyshen0722
lilyshen0722 merged commit de5fc4d into main Sep 12, 2026
14 checks passed
lilyshen0722 added a commit to thantiklermcirony/commonly that referenced this pull request Oct 9, 2026
…Commonly#1869)

* fix(connectors): a list card is as tall as its rows (TASK-156)

Team-Commonly#1547 stretched the channel list to fill the page; Team-Commonly#1669 then put Tools under
it and the stretch carried on, so at 1200 the channel card was 564px around
262px of rows, and with the GitHub grant open the Tools card was 718px around
one 86px row — 630px of empty card. The page scrolls; a card does not hold
empty space.

- .v2-connectors: drop min-height: calc(100vh - 86px) and its comment.
- .v2-connectors__content: drop flex: 1 / min-height: 0 and switch stretch to
  start; .v2-connectors__rows: drop flex: 1 / min-height: 0 (keep overflow:
  hidden, it clips the row corners).
- The now-dead opt-outs go with them: .v2-tools { flex: none }, and the 1010px
  and 760px undo rules.
- The Slack row names its workspace: a linked Slack stores teamName, never
  chatTitle, so the row read "Slack · linked to Ops" beside the word Slack.
  chatTitle still wins when both are set.

Guards invert with the decision: v2-layout-invariants asserted the old stretch
(and its undo rules); it now asserts no min-height on .v2-connectors,
align-items: start with no flex: 1 on the content grid, no flex: 1 on the rows,
and that no .v2-tools rule opts out. The Tools opt-out is matched as a regex on
the Connectors section rather than through ruleBody, because with the rule gone
ruleBody returns '' and the assertion would have passed without reading
anything. Three page cases cover the Slack title precedence.

* test(connectors): scan every block for the stretch rules, not just the first (TASK-156)

sprint-review's gate passed Team-Commonly#1869 at 9e64a12 and named one route it does not
cover: `not.toContain('min-height')` reads ruleBody's FIRST line-start
`.v2-connectors` match, so a second `.v2-connectors { min-height: … }` written
later in the sheet passes every assertion while the browser paints the stretch
again — equal specificity, later rule wins.

layoutBlocks() instead scans the whole sheet for every declaration block whose
last compound carries the class, and the three selectors that hold the decision
(`.v2-connectors`, `__content`, `__rows`) are asserted empty of the declarations
that would stretch them. A non-vacuity check per selector keeps the filters from
passing on an empty scan.

Additive only: every assertion sprint-review gated is byte-identical, so their
PASS still describes this tree; what is new is a stronger instrument beside it.
A rule scoped another way than the last compound (e.g. `.v2-connectors > div`)
is still not covered — said in the comment.
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.

1 participant