molecule-core/canvas/src/components
Hongming Wang 5ad2669f88 fix(canvas): AgentCommsPanel display + initial-state parity with my-chat
User-visible problem: agent-comms panel opens mid-conversation on long
histories (the same chat-opens-in-middle bug PR #2903 fixed for
my-chat) and silently renders empty state when the history fetch fails
(no retry button, no diagnostic).

Three changes mirror the my-chat patterns from ChatTab:

1. Initial-mount instant scroll.
   Adds hasInitialScrollRef + switches the scroll hook from useEffect
   to useLayoutEffect. First arrival of messages → scrollIntoView
   `instant`; subsequent appends → `smooth` as before. useLayoutEffect
   runs before paint so the user never sees the panel jump for one
   frame on every append.

2. Error UI with Retry button.
   Adds `loadError` state. The history-load .catch now sets the
   error message; a new branch in the render renders a red alert
   with the failure text and a Retry button that re-invokes
   `loadInitial`. Same shape as ChatTab MyChatPanel's `loadError`
   handling — both surfaces should fail loud, not silent.

3. Extracted `loadInitial` callback.
   The history-load body becomes a useCallback so the retry button
   has a stable reference to call. Mirrors ChatTab's loadInitial.

Tests (4 new in AgentCommsPanel.render.test.tsx):
- Loading state renders the loading copy.
- Error state with Retry button renders on rejection; clicking
  Retry fires a second api.get.
- Empty state renders when load succeeds with zero rows.
- scrollIntoView is called with behavior=instant on first message
  arrival (pins the chat-opens-in-middle prevention).

Verification:
- pnpm test → 1284/1284 pass (1280 prior + 4 new)
- tsc --noEmit → clean
- 92 → 93 test files, no existing test broken

Closes the parity gap raised in chat. The two surfaces now share:
loading copy / error UI / empty-state placeholder / scroll behaviour /
useLayoutEffect timing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 13:09:36 -07:00
..
__tests__ fix(canvas/tests): pin Expand-to-Team absence with literal assertion 2026-05-05 03:05:17 -07:00
canvas fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
settings fix(canvas): add role=status + aria-live to remaining loading states 2026-05-03 07:11:48 -07:00
tabs fix(canvas): AgentCommsPanel display + initial-state parity with my-chat 2026-05-05 13:09:36 -07:00
ui fix(canvas/a11y): add aria-hidden to 6 decorative SVGs + aria-label to OrgTokensTab input 2026-04-24 12:40:52 +00:00
A2ATopologyOverlay.tsx fix(canvas): A2ATopologyOverlay re-fetch storm hammering /activity → 429 2026-05-03 23:39:36 -07:00
ApprovalBanner.tsx fix(canvas): ApprovalBanner Approve/Deny button polish 2026-05-03 12:56:00 -07:00
AuditTrailPanel.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
AuthGate.tsx feat(canvas): warm-paper theme + Tailwind v4 migration 2026-05-03 01:43:55 -07:00
BatchActionBar.tsx canvas/BatchActionBar: wire Esc to clear selection (matches button title) 2026-05-03 16:31:23 -07:00
BundleDropZone.tsx canvas/BundleDropZone: theme-flip drag overlay + announce import + reduced-motion 2026-05-03 17:26:15 -07:00
Canvas.tsx fix(canvas): wire ReactFlow colorMode to resolvedTheme 2026-05-03 04:11:35 -07:00
CommunicationOverlay.tsx Fix CommunicationOverlay rate-limit storm: cap fan-out + gate on visibility 2026-05-04 03:18:42 -07:00
ConfirmDialog.tsx fix(canvas): ConfirmDialog hover + focus polish 2026-05-03 12:28:24 -07:00
ConsoleModal.tsx canvas/ConsoleModal: fix no-op hovers + add Copy success feedback 2026-05-03 16:58:31 -07:00
ContextMenu.tsx chore(canvas): remove Expand-to-Team right-click button (#2858) 2026-05-05 02:51:13 -07:00
ConversationTraceModal.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
CookieConsent.tsx canvas/CookieConsent: stop pretending to be a modal + fix link/button focus 2026-05-03 15:37:06 -07:00
CreateWorkspaceDialog.tsx canvas/CreateWorkspaceDialog: hover sweep + semantic placeholders + focus rings 2026-05-03 22:56:33 -07:00
DeleteCascadeConfirmDialog.tsx canvas/DeleteCascadeConfirmDialog: fix Cancel no-op hover + Delete light hover + focus rings 2026-05-03 17:53:29 -07:00
EmptyState.tsx feat(saas): default new workspaces to T4 on SaaS, T3 self-hosted 2026-05-05 10:30:22 -07:00
ErrorBoundary.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
ExternalConnectModal.tsx feat(external-templates): codex tab now includes the bridge-daemon inbound path 2026-05-04 18:28:35 -07:00
Legend.tsx canvas/Legend: focus rings + 24x24 close-button touch target 2026-05-03 16:04:04 -07:00
MemoryEditorDialog.tsx feat(canvas/memories): Add + Edit modal for MemoryInspectorPanel 2026-05-04 21:16:35 -07:00
MemoryInspectorPanel.tsx feat(canvas/memories): Add + Edit modal for MemoryInspectorPanel 2026-05-04 21:16:35 -07:00
MissingKeysModal.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
OnboardingWizard.tsx canvas/OnboardingWizard: theme-flip colors + fix hover traps + focus rings 2026-05-03 18:49:19 -07:00
OrgImportPreflightModal.tsx canvas/{OrgImportPreflightModal,SkillsTab}: hover sweep + custom-source focus ring 2026-05-03 22:28:41 -07:00
PricingTable.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
ProviderModelSelector.tsx feat(canvas): warm-paper theme + Tailwind v4 migration 2026-05-03 01:43:55 -07:00
ProvisioningTimeout.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
SearchDialog.tsx canvas/SearchDialog: auto-highlight first match + semantic placeholder 2026-05-03 15:09:01 -07:00
SidePanel.tsx feat(canvas/terminal): not-available banner for runtimes without a TTY 2026-05-04 20:33:13 -07:00
Spinner.tsx fix(canvas): address all code review findings on PR #482 2026-04-16 07:48:47 -07:00
StatusDot.tsx fix(canvas): a11y fixes + budget_used TypeScript guard + orgs-page test fix (#1367) 2026-04-21 11:08:24 +00:00
TemplatePalette.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
TermsGate.tsx canvas/TermsGate: stop hiding the dialog from screen readers + a11y polish 2026-05-03 18:21:42 -07:00
ThemeToggle.tsx feat(canvas): warm-paper theme + Tailwind v4 migration 2026-05-03 01:43:55 -07:00
Toaster.tsx canvas/Toaster: add Esc dismiss + focus-visible ring + larger touch target 2026-05-03 13:55:24 -07:00
Toolbar.tsx chore(canvas): remove Expand-to-Team right-click button (#2858) 2026-05-05 02:51:13 -07:00
Tooltip.tsx a11y(canvas): Tooltip Esc-to-dismiss (WCAG 1.4.13) 2026-05-03 13:23:08 -07:00
WorkspaceNode.tsx feat(canvas): render misconfigured workspaces with the configuration_status from agent_card 2026-05-04 15:14:40 -07:00
WorkspaceUsage.tsx feat(canvas): warm-paper theme + Tailwind v4 migration 2026-05-03 01:43:55 -07:00