Repository navigation
[PIR #1553] Wire the Attention fallback body from OverviewCache - #1557
Merged
Merged
Conversation
…t, drop redundant Attention header
… add idle-waiting to the rollup
…ssons updates, fix empty-summary singleton + empty-state copy
amrmelsayed
added a commit
that referenced
this pull request
Aug 25, 2026
amrmelsayed
added a commit
that referenced
this pull request
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PIR Review: Wire the Attention fallback body from OverviewCache
Fixes #1553
Summary
The #1049 contextual bottom panel shipped skeleton-only: every mode's body was a placeholder. This
participating feature wires one of them — the Attention fallback (shown when the active surface
is not a document, diff, or builder terminal) — to render a live roll-up from the
OverviewDatatheextension already holds in
OverviewCache: builders blocked at gates (plus PRs awaiting review),builders waiting on input (idle past the threshold), held mail, and queued feedback, with
an honest empty state. The projection is a pure, cross-client helper in
codev-sdk; the panelre-renders it on every SSE-driven cache refresh. Purely contextual — no navigation, selection, or
persisted state.
Files Changed
packages/sdk/src/builder-helpers.ts(+139 / -1) — newderiveAttentionprojection + its types,beside the existing
isIdleWaitingpackages/sdk/src/__tests__/builder-helpers.test.ts(+141 / -0) — new; unit tests for theprojection and
isIdleWaitingapps/vscode/src/contextual-panel/webview/main.ts(+189 / -18) — render the roll-up + empty state;drop the redundant Attention header
apps/vscode/src/contextual-panel/webview/styles.css(+178 / -1) — section/row/badge styles, alltheme tokens
apps/vscode/src/contextual-panel/panel-provider.ts(+17 / -3) — injectOverviewCache; re-post inAttention mode on
onDidChange; attach the projected payloadapps/vscode/src/contextual-panel/messages.ts(+7) — optionalattention?onRenderMessageapps/vscode/src/__tests__/contextual-panel-provider.test.ts(+115) — mock cache; payload +re-post coverage
apps/vscode/src/extension.ts(+1 / -1) — passoverviewCacheinto the providerapps/vscode/src/contextual-panel/attention.ts(deleted) + its test (moved tocodev-sdk)Design
Follows #1049's pure-core / host-adapter split. The resolver is untouched and stays pure
(
SurfaceContext → { kind, context }, no knowledge ofOverviewData). The provider, after resolvingAttention, attaches a projected
AttentionSummaryalongside the descriptor on the render message(not inside
ModeDescriptor), so the resolver's output contract stays pure. The webview renders thesections via React children (auto-escaped, no
innerHTML), using only--vscode-*theme tokens, soit tracks the reviewer's theme in both light and dark with no separate palette.
The
codev-sdkmove (plan deviation — logged, verified)The approved plan declared
AttentionSummaryandderiveAttentionextension-local. During deviteration the owner directed that they be shared: the projection was moved into
packages/sdk/src/builder-helpers.ts, beside the existingisIdleWaiting, and the extension-localcontextual-panel/attention.tswas deleted. The plan's "extension-local" claim is thereforesuperseded; the owner was the deciding authority, and the main architect (owner of the
packages/sdkcontract surface) was routed the change and confirmed the seat satisfied post-hocwith verification, no changes required.
Why this home (reuse, not speculation):
builder-helpers.tsalready exists precisely forcross-client UI-policy projections over
OverviewBuilder—isIdleWaiting+IDLE_WAITING_THRESHOLD_MS,whose own header states it lives there (not in
codev-types) to stop the VSCode extension and the webdashboard from drifting on "what needs a human." An attention roll-up is the same policy one level up;
api.ts'squeuedFeedbackdoc already names "#1049's future Attention rollup" and the Stream Deckbadge as consumers of the same fields. Co-locating avoids a second client re-deriving "attention" and
drifting.
What main's ruling verified (recorded here so it isn't re-argued):
codev-typesimported type-only, pure functions, injectablenow; theSDK's
import-boundary.test.tspasses (no node/vscode/DOM/runtime-dep).attention.tsdeleted; all consumers read the one SDK subpath;no duplicate definition.
value import (
deriveAttention) is host-side, where SDK value imports are already established andthe workspace dep already exists — no dependency-class transition.
AttentionSummaryis a derived client projection, not a wire contract,so it belongs out of
codev-typesand co-located withisIdleWaiting.waiting) and
heldTotal(workspace-wide, all recipients) vs per-builderheldMailare correct.The same iteration also folded
isIdleWaitinginto the roll-up as a "Waiting on input" section —the issue asked for "needs-attention state," and idle-waiting is the SDK's canonical needs-me state
alongside
blocked; the panel's stripe/badge use the sidebar's idle token (notificationsInfoIcon).Things to Look At During PR Review
creep.
packages/sdkis the main architect's surface — that's why it was routed and confirmed.notificationsWarningIcon.foreground(thesidebar's blocked-bell token, not
editorWarning); idle →notificationsInfoIcon.foreground; countpill → the
badge-foreground/badge-backgroundpair (was grey-on-blue); row badges are text-only(a filled pale-warning chip washed out on the grey row-hover, and the queued badge was blue-on-blue).
deriveAttentionrecomputesisIdleWaitingat post time (hostDate.now()); abuilder crossing the 5-min idle threshold surfaces on the next SSE cache tick, not by a timer. This
matches how the sidebar recomputes idle on refresh; no polling is introduced.
(it names their file/builder); Attention's would be a static word duplicating the "Codev" panel tab.
Consultation Feedback
Populated after porch's single advisory 3-way pass (
max_iterations: 1); verdicts surfaced to thehuman at the
prgate.Architecture Updates
codev/resources/arch.md(VS Code Extension + thecodev-sdkclient helpers):the "what needs a human" attention roll-up is a shared client projection in
codev-sdk/builder-helpers.ts(deriveAttention), the same cross-client UI-policy home asisIdleWaiting; the VSCode contextual panel is its first consumer and renders it into the Attentionfallback target, re-posting on
OverviewCachechange. Subsystem-level detail → cold.arch-critical.md) change: no new always-must-know invariant, and the hot file is at cap.Lessons Learned Updates
codev/resources/lessons-learned.md(Architecture + UI/UX):codev-sdk/builder-helpers.ts— it is the established home for cross-client policy derived fromOverviewBuilder/OverviewData(single source, anti-drift).codev-typesstays wire-contractsonly; a derived client projection belongs in the SDK, not the types package.
ThemeColortoken a sibling surfacealready uses for the same concept (the sidebar's
notificationsWarningIconfor a blocked gate,notificationsInfoIconfor idle), not a near-equivalent (editorWarning/charts-*).badge-foregroundonbadge-background); a filled semantic-validation background (inputValidation-*Background) pairspoorly with its own amber/red text and with the row-hover — prefer colored text on the surface.
lessons-critical.md) change: these are extension/SDK-specific, not cross-cuttingmust-knows; the hot file is at cap.
Deviations from Plan
AttentionSummary/deriveAttentionmoved from extension-local tocodev-sdk— see "Thecodev-sdkmove" above. Owner-directed during dev iteration; main architect verified the SDKsurface post-hoc; recorded, not silently shipped.
isIdleWaitingfolded into the roll-up (the plan's signal setwas blocked/prReady/held/queued); it realizes the issue's "needs-attention state."
(see Things to Look At).