Repository navigation
feat(workspace): the compact header — Info as a rail tab, one paperclip, voice at the composer (abilityai/trinity-enterprise#547, #2580) - #2604
Conversation
…ip, voice at the composer (abilityai/trinity-enterprise#547, #2580) The conversation header carried three controls that were not about the conversation, and a band whose height was set by a chart legend nobody read. **The band: 99px → 56px, measured in Chromium at 1440px** (the AC asks for ≤60%). The chart loses its legend and its 7d/14d/30d selector; the window is fixed at 7 days and series identity is the hover tooltip, which already names every bucket with its swatch, its count and the day's total. The load-bearing fact, and the one a future editor will get wrong: **once the legend is gone the chart stops driving the band's height and the stats strip sets it.** A stat block is 39px, so with the band's padding the floor is 56px whatever the chart does — and the chart column is therefore budgeted at exactly one stat block (title 10 + gap 6 + a 23px row). Inside that budget the chart is free; over it, every pixel is one the band grows. The real cost was never the bars: `legend="side"` lays out `flex-col`, ~13px per bucket, so a nine-bucket agent's band ran to ~153px. Within the budget the chart keeps its title OR its x-axis, not both — the title stays (board A3: "without it the bars read as another statistic") and the axis goes, since the tooltip carries each date. `StackedBarChart` gains `legend="none"` and `:axis="false"`; its `legend !== 'side'` guard became `legend === 'below'`, or the new value would have rendered the very legend it removes. **Agent info becomes the rail's Info tab**, reversing the 2026-09-05 "never a rail tab" ruling. That ruling's two objections are answered, not dropped: `RAIL_DOORS.SOLO_AGENT` is the participant scoping, and collapsing the rail is the dismissal. The door is `=== 1`, never `> 0` — with "at least one" it passes in a room and renders one arbitrary participant's panel under a strip promising the whole conversation. It is deliberately not `PLATFORM`: the header button it replaces carried no gate, so a platform door would silently remove a panel external clients have today (the #2128 class). **Info does not group by agent in a room — a recorded deviation from the AC.** `stores/clientPortal.js` holds report state as a singleton keyed to one agent (`loadAgentReports` → `resetAgentReports` bumps a generation and invalidates siblings' in-flight requests), so N mounted panels leave N−1 in a permanent loading skeleton — worse than absence, because it claims to be fetching what it has already abandoned. Keying that store per agent unblocks it; a store change, not a rail change. Info is also the registry's first STATIC tab (`RAIL_SIGNAL_NONE`, `empty: null` — declared absences, since a borrowed `updated` would light no dot while documenting a rule that does not exist). Mobile is a gain: the old panel was `hidden sm:flex`, so the header button did nothing visible on a phone. **One paperclip** (the header's opened Files with the *attach* glyph), and the composer row is voice-call · attach · dictate · send at 44px. **The call toggle sits OUTSIDE the composer's `pointer-events-none` region** — it is a toggle, so inside it would render pressed and refuse the click that ENDS the call: the dead affordance this issue's own AC 5 forbids, manufactured by its AC 4. The inert wrapper is a real flex row and not `display: contents`, which generates no box and would have dropped the dimming while `pointer-events` still inherited. **#2580, four defects:** * The band no longer refetches or flashes on a chat-tab switch, fixed at its source rather than by moving it. The operator ruled a band "under the header" and the header lives inside the thread-keyed conversation, so hoisting the band renders an agent's numbers above its name (built, screenshotted, reverted). Instead `usePortalAgentPage` seeds from cache DURING SETUP — not `onMounted`, which runs after the first paint, which is exactly why a warm remount still flashed its skeleton and scanline — and skips the refetch inside `PAGE_FRESH_MS`. The decision is the exported pure `shouldRefetchPage`, which fails STALE on an unusable timestamp: a wasted request beats a band that never updates again. Verified live: 6 same-agent tab switches → 0 `/page` requests and 0 placeholder frames, with a control proving the probe could see one. * Sidebar dates get a reserved, right-aligned column. This was an ordering and width problem, not an alignment one: the span was already `shrink-0` after a `flex-1` name, but three siblings sat to its right and it vanished entirely on an agent you had never talked to, moving the row's truncation point. * copy · like · dislike sit on one baseline. `PortalRating` repeated the bubble row's own `mt-1.5 flex items-center gap-1`, pushing the thumbs 6px low, and it had TWO roots — so its comment box opened as a flex sibling BESIDE the thumbs instead of beneath the message. It is now a single root owning no margin, and the margin moves to the `PortalDeliverables` call site, which mounts the same component outside any row and relied on it. * A reply is rateable as it lands. No refetch was added: `awaitPersistedReply` already read the persisted row and was discarding its `id` and `my_rating`. One shared mapper now feeds all three construction sites. The synchronous fallback genuinely had no id — the server minted one inline and threw it away — so `portal_chat` returns `message_id`, DECLARED on `PortalChatResponse` because the response model strips undeclared keys in silence. The `v-if="message.id"` gate stays: carry the identifier with the flag and let the consumer still refuse an empty one. Tests: two new vitest specs (the rateable rule and the band's caching rule as executable pure tests, not source greps), a new e2e spec for every measured claim, and a backend test for the id contract. Four existing specs were REWRITTEN rather than deleted — `portalRail.spec.js`'s details test asserted `not.toContain('details')`, which a tab registered as `info` keeps green while reversing the rule it is named for. Fixes abilityai/trinity-enterprise#547 Fixes #2580 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Nx82GJvj8nbMUVVPjAa7MA
758e0a1 to
c17c08f
Compare
vybe
left a comment
There was a problem hiding this comment.
Validated via /validate-pr. Verified locally on the rebased head, not taken on trust: npm run test:unit 2300 passed / 103 files; pytest tests/unit -k "portal or client_portal" 443 passed / 6 skipped; design-token check OK; raw-color ratchet vs the branch base gray 8699 → 8680 (−19), nongray +0, hardcoded +0.
Structural spot-checks: detailsOpen/open-details/open-files have zero live references left; reattach's new id/rating is genuinely fed by replyFromHistory; railEmptyCopy handles the Info tab's empty: null safely and Portal.vue supplies #tab-info at both the column and the mobile-sheet mount; shouldRefetchPage fails stale on a malformed or backwards timestamp, which is the right failure direction.
Docs are complete for a new capability — requirements, the owning architecture area file, three feature flows and the index. The four rewritten specs are the right call: portalRail.spec.js's not.toContain('details') would have stayed green through the very change it was named for.
Rebased onto dev after #2600 squash-merged; dev's tree was byte-identical to #2600's head, so the single commit replayed with no conflict and the diff is exactly the 30 reviewed files.
ent#547 / #2580 (PR #2604) landed the compact Workspace header. The only conflict was `learnings.md`, an append-only ledger — all five entries kept, dev's three first. `PortalConversation.vue` auto-merged clean this time. Frontend unit suite after the merge: 104 files / 2339 passed. Co-Authored-By: Claude Opus 5 <[email protected]>
Structural conflict with #2604, per the merge-train note. Resolved by taking dev's structure and re-applying this PR's two additions into it: * ent#547 removed the `flex-1 … p-4 space-y-6` wrapper in `PortalAgentDetails.vue` that the `<InlineError>` refresh-failure banner was inserted into. It is now a direct child of the panel body at dev's indentation; the ent#253 rule it implements is unchanged. * The `LoadFailed` arm still comes FIRST in "What it can do", ahead of the empty arm — the empty arm is a positive claim a failed fetch supplies no evidence for, which is the whole defect. Two guards in `portalAgentPageFailure.spec.js` were pinning shapes dev has since changed: * `'reload: load'` — #2604 rewrote the alias to `const reload = () => load({ force: true })`. The consumers need the composable to RETURN something called `reload`, not for its definition to have a particular spelling, so the assertion now says that. * "keeps the time-window selector reachable while the failure shows" — ent#547 DELETED that selector (the window is fixed at 7 days). The test asserted a control that no longer exists. Its structural half survives — the failure is an ARM INSIDE the row, so anything else the row holds is a sibling of the chain — and it now also pins the selector's absence rather than silently passing on a missing element. Frontend suite: 107 files, 2397 tests, all passing.
Summary
The conversation header carried three controls that were not about the conversation, and a band whose height was set by a chart legend nobody read.
The band: 99px → 56px (57%), measured in Chromium at 1440px against the AC's ≤60% target. The chart loses its legend and its 7d/14d/30d selector; the window is fixed at 7 days, and series identity is the hover tooltip — which already names every bucket with its swatch, its count and the day's total.
Both independent plan reviewers concluded this target was unreachable without deleting the chart's title and its x-axis. Measurement disagreed, and the reason is the thing to keep:
The real cost was never the bars:
legend="side"lays outflex-col, ~13px per bucket, so a nine-bucket agent's band ran to ~153px. Within the budget the chart keeps its title or its x-axis, not both — the title stays (board A3: "without it the bars read as another statistic"), the axis goes, and the tooltip carries each date.Changes
ent#547 — the compact header
StackedBarChartgainslegend="none"and:axis="false". Itslegend !== 'side'guard becamelegend === 'below', or the new value would have rendered the very legend it removes.RAIL_DOORS.SOLO_AGENTis the participant scoping, and collapsing the rail is the dismissal.=== 1, never> 0— "at least one" passes in a room and renders one arbitrary participant's panel under a strip promising the whole conversation. Deliberately notPLATFORM: the header button it replaces carried no gate, so a platform door would silently remove a panel external clients have today (the bug(workspace): multi-agent chat picker is offered on builds with no rooms backend — 404 dead end #2128 class).pointer-events-noneregion. It is a toggle — inside, it would render pressed for the whole call and refuse the click that ends it: the dead affordance this issue's own AC 5 forbids, manufactured by its AC 4. The inert wrapper is a real flex row, notdisplay: contents, which generates no box and would have dropped the dimming whilepointer-eventsstill inherited.#2580 — four defects
usePortalAgentPageseeds from cache during setup — notonMounted, which runs after the first paint, which is exactly why a warm remount still flashed — and skips the refetch insidePAGE_FRESH_MS. The decision is the exported pureshouldRefetchPage, which fails stale on an unusable timestamp: a wasted request beats a band that never updates again.shrink-0after aflex-1name, but three siblings sat to its right, and it vanished entirely on an agent you had never talked to — moving the row's truncation point.PortalRatingrepeated the bubble row's ownmt-1.5 flex items-center gap-1(thumbs 6px low) and had two roots, so its comment box opened as a flex sibling beside the thumbs rather than beneath the message. Now a single root owning no margin — with the margin moved to thePortalDeliverablescall site, which mounts the same component outside any row and relied on it.awaitPersistedReplyalready read the persisted row and was discarding itsid/my_rating. One shared mapper feeds all three construction sites. The synchronous fallback genuinely had no id — the server minted one inline and threw it away — soportal_chatreturnsmessage_id, declared onPortalChatResponsebecause the response model strips undeclared keys in silence.Deviation from the AC, recorded
Info does not group by agent in a room.
stores/clientPortal.jsholds report state as a singleton keyed to one agent (loadAgentReports→resetAgentReportsbumps a generation and invalidates siblings' in-flight requests), so N mounted panels leave N−1 in a permanent loading skeleton — worse than absence, because it claims to be fetching what it has already abandoned. Keying that store per agent unblocks it: a store change, not a rail change. Follow-up issue to file.Test Plan
npm run test:unit— 2300 passed (103 files)pytest tests/unit -k "portal or client_portal"— 463 passed, 6 skippednode scripts/check-design-tokens.mjs— OKraw-color-baseline.json— and the tree was already over baseline before this branch. Pre-existing, out of scope, worth its own issue.)/pagerequests, 0 placeholder frames, with a control proving the probe could see a request at all (switching agent produced exactly 1 — without it the zero proves nothing)portalReplyRateable.spec.js,portalBandStability.spec.js,e2e/workspace-compact-header.spec.js,test_2580_reply_message_id.pyFour existing specs were rewritten, not deleted.
portalRail.spec.js's details test assertedexpect(railTabs).not.toContain('details')— which a tab registered asinfokeeps green while reversing the rule it is named for. A guard that cannot fail on the change it governs is worse than no guard.Fixes abilityai/trinity-enterprise#547
Fixes #2580
🤖 Generated with Claude Code
https://claude.ai/code/session_01Nx82GJvj8nbMUVVPjAa7MA