molecule-core/canvas/src/components
Hongming Wang a489ee1a7c fix(canvas/chat): instant-scroll to bottom on first mount
Reported: "right now when chat box opens it opens in the middle, but
it should be at the end of conversation."

Root cause: ChatTab.tsx:548 fires `bottomRef.scrollIntoView({ behavior:
"smooth" })` on every messages-update. On initial mount with N
messages already loaded, the smooth-scroll triggers a ~300ms animation
that any concurrent React re-render (agent push landing, theme
toggle, sidepanel resize) interrupts mid-flight, leaving the user
stuck somewhere in the middle of the conversation.

Fix: track first-mount via hasInitialScrollRef. Use behavior:"instant"
for the initial jump (deterministic, no animation interruption), then
smooth for subsequent appends (the new-message-landing visual stays).

Refs flipped on first messages.length > 0 transition, so:
- Initial open of chat tab: instant jump to bottom ✓
- New agent message arrives: smooth scroll into view ✓
- Workspace switch (ChatTab remounts): fresh hasInitialScrollRef, gets
  instant again ✓
- loadOlder prepend: anchor-restore path unchanged, still pins user's
  reading position ✓

Test plan:
- pnpm test --run ChatTab.lazyHistory.test.tsx → 8 pass (existing
  lazy-history tests untouched)
- npx tsc --noEmit clean
- Manual on hongming.moleculesai.app: open a busy chat (mac laptop,
  ~50 messages), confirm view lands at the latest bubble, not mid-
  scroll. Switch to another workspace + back → instant again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 10:47:32 -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/chat): instant-scroll to bottom on first mount 2026-05-05 10:47:32 -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