446dd9cfe6
* chore(lint): use Set for LOG_FORMATS membership check
* chore(lint): convert type aliases to interfaces (autofix)
- Remove no-use-before-define rule (conflicts with unistyles ordering)
- Add typescript/consistent-type-definitions: interface
- Run oxlint --fix: 606 type->interface conversions across 268 files
Typecheck green. Warnings: 5432 -> 3787 (-1645).
* chore(lint): clean up relay package warnings
* chore(lint): clean up cli package warnings
* chore(lint): flatten nested ternaries in server (no-nested-ternary)
* chore(lint): escape entities and hoist inline objects in website
* chore(lint): hoist inline arrays in app (jsx-no-new-array-as-prop)
* fix(types): restore Record assignability after type->interface autofix
* chore(lint): hoist inline arrays in app (jsx-no-new-array-as-prop)
* chore(lint): clean up desktop and highlight packages
* chore(lint): hoist inline arrays in app (jsx-no-new-array-as-prop)
* chore(lint): hoist inline arrays in app (jsx-no-new-array-as-prop)
* chore(lint): format keyboard-shortcuts-section
* chore(lint): rename shadowed bindings in server (no-shadow)
Rename inner bindings that shadow outer imports or function params:
- Promise executor `resolve` -> `resolvePromise` (shadowed path `resolve`)
- Method params `options` -> `input`/`target`/`update`/`runOptions`/`opts`/`killOptions`
- Misc loop/destructure renames for `workspaceId`, `scriptNames`, `path`, `query`, `taskNotificationItem`
Mechanical change only; no behavior change.
* fix(types): add index signatures for Record assignability
* chore(lint): extract nested callbacks in server (max-nested-callbacks)
* chore(lint): hoist inline callbacks in app (jsx-no-new-function-as-prop)
Work in progress: 30 of 369 warnings fixed across 23 files.
* chore(lint): hoist inline callbacks in app (jsx-no-new-function-as-prop)
* chore(lint): reduce cyclomatic complexity in server
* chore(lint): hoist inline callbacks in app components (jsx-no-new-function-as-prop)
* chore(lint): parallelize safe await-in-loop in server
* chore(lint): hoist inline callbacks in app (jsx-no-new-function-as-prop)
Finish eliminating jsx-no-new-function-as-prop warnings in
agent-status-bar.tsx and complete refactor of git-diff-pane.tsx
by extracting per-item components and using stable useCallback
handlers.
* chore(lint): parallelize more safe await-in-loop in server
* fix(server): restore microtask ordering in message dispatch and stream event handler
The complexity refactor added async dispatcher chains that inserted extra
microtasks before message handlers ran, and wrapped the stream event switch
in an await that fired between emitState and dispatchStream. Two tests
regressed on both counts. Route to the matching dispatcher synchronously
and skip the await when the stream handler has no async work.
* chore(lint): hoist/memoize inline arrays and objects in app JSX
* chore(lint): parallelize safe awaits in server (no-await-in-loop)
Converts three sequential `for ... await` loops to `Promise.all`:
- OpenCode: configure MCP servers in parallel
- Sherpa: download model files and ensure multiple models concurrently
- Speech runtime: check required model files across models in parallel
* chore(lint): clear website warnings to zero
Resolves all 61 oxlint warnings in packages/website/ by hoisting inline
callbacks/JSX, extracting sub-components to satisfy jsx-max-depth, using
stable data-derived keys, adding explicit button types, flattening nested
ternaries, and removing unused code.
* chore(lint): parallelize more safe awaits in server (no-await-in-loop)
- Workspace reconciliation: archive missing workspaces and orphaned
projects concurrently instead of sequentially.
- Directory suggestions: resolve child directory candidates in parallel
before filtering.
* chore(lint): allow css imports in import/no-unassigned-import, hoist host page styles
* chore(lint): hoist dictation-controls inline arrays
* fix(server): restore microtask ordering in session message dispatch
Converts per-group dispatchers to Promise<void> | undefined. The complexity
refactor broke two tests by inserting extra microtasks between each
dispatcher's await. The new pattern routes synchronously via a nullish-
coalescing chain and awaits only the matching dispatcher's promise.
* chore(lint): flatten nested ternaries in button/volume-meter/autocomplete
* chore(lint): narrow explicit any in misc server files
* chore(lint): flatten nested ternaries in host-runtime/host-page/providers
* chore(lint): clear desktop warnings to zero
Convert polling loops to recursive helpers to avoid no-await-in-loop,
and switch the ws import to the named export so the WebSocket type is
referenced directly.
* chore(lint): remove useless constructors in server tests
* chore(lint): hoist pair-scan inline arrays and objects
Extracts corner style arrays and barcode scanner settings to module
scope, memoizes insets-dependent body/helper text styles.
* chore(lint): hoist inline style arrays in question-form-card
* chore(lint): hoist/memoize inline styles in plan-card
Extracts markdown rule style arrays into dedicated MarkdownInlineText,
MarkdownListItemContent, and MarkdownParagraph subcomponents that
memoize their own style arrays. Memoizes PlanCard container/title/
description styles.
* chore(lint): narrow explicit any in server relay/loader/logger-likes
* chore(lint): hoist SheetBackground combined style
* chore(lint): hoist inline styles in screen-header
* chore(lint): hoist inline styles/objects in menu-header
* chore(lint): hoist top-level inline arrays in diff-viewer
* chore(lint): narrow explicit any in codex-app-server-agent thread items
* chore(lint): reduce max-depth in claude-sdk-behavior test
* chore(lint): memoize inline styles in command-center
* chore(lint): extract helper to reduce max-depth in agent-response-loop
* chore(lint): flatten nested conditions in pi-direct-agent history
* chore(lint): reduce max-depth in claude-agent query pump
* chore(lint): clear cli warnings to zero
Refactor polling loops into recursive helpers to satisfy
no-await-in-loop, fix WebSocket named import, and correct
an absolute-path import in tests/tmp.
* chore(lint): memoize inline styles in context-menu
* chore(lint): narrow explicit any in claude-agent/openai stt
* chore(lint): reduce max-depth in opencode-agent foreground loop
* chore(lint): memoize inline styles in explorer-sidebar
* chore(lint): memoize mobile sidebar styles in explorer-sidebar
* chore(lint): memoize inline styles in agent-list
* chore(lint): reduce relay test no-await-in-loop warnings
Refactor while-loops and for-retry loops in e2e.test.ts and
live-relay.e2e.test.ts into recursive poll/attempt helpers.
Remaining 8 warnings in encrypted-channel.ts concern the custom
Transport interface (on-handler slots, not DOM EventTarget) and a
sequential send loop; both reflect deliberate runtime contracts.
* chore(lint): fix typecheck errors from hoisting refactors
- pair-scan: type BARCODE_SCANNER_SETTINGS as BarcodeSettings
- explorer-sidebar: add missing desktopSidebarStyle useMemo
- sidebar-workspace-list: coerce null dotColor to transparent
- menu-header, e2e.test: formatting
* chore(lint): memoize inline styles in workspace-screen
* chore(lint): memoize inline styles in workspace-desktop-tabs-row
* chore(lint): hoist constant style arrays in desktop-updates-section
* chore(lint): memoize inline styles in combobox
* chore(lint): extract SplitGroupChild to memoize inline styles
* chore(lint): memoize inline styles in dropdown-menu
* chore(lint): memoize inline styles in workspace-hover-card
* chore(lint): memoize inline styles in autocomplete, message-input, composer
* chore(lint): remove explicit any in server (129 warnings)
- session.ts: catch(error: any) -> catch(error) with Error coercion at use
- daemon-client transport: any -> unknown in listener types
- sherpa/onnx loaders: introduce structural native types
- pocket-tts-onnx: typed ONNX session inputs/outputs/tensors
- tests: any -> unknown + named stub types
* chore(lint): hoist inline arrays and objects in app (145 warnings)
- Hoist static style arrays/objects to module-level consts
- Memoize dynamic ones with useMemo and correct deps
- jsx-no-new-array-as-prop: 145 -> 43
- jsx-no-new-object-as-prop: 64 -> 21
* chore(lint): memoize inline styles in _layout
Fixes 3 react-perf/jsx-no-new-object-as-prop warnings in root layout by
memoizing the stack screen options, the agent screen override, and the
GestureHandlerRootView root style.
* chore(lint): memoize inline styles and objects in stream/status panes
Clears 10 react-perf/jsx-no-new warnings across welcome-screen,
file-explorer-pane, terminal-pane, agent-stream-view, and
agent-status-bar by extracting per-item subcomponents, hoisting constant
style tuples, and memoizing derived arrays/objects.
* chore(lint): memoize inline style objects in list/pane components
Clears 6 react-perf/jsx-no-new-object-as-prop warnings across
synced-loader, stream-strategy-web, sortable-inline-list, file-pane, and
both draggable-list platform variants by memoizing or hoisting their
inline style objects.
* chore(lint): hoist test fixture arrays/objects
Clears 14 react-perf/jsx-no-new-* warnings across app test files by
hoisting constant fixtures to module scope or wrapping them in helper
factories so they no longer appear as inline JSX prop values.
* chore(lint): memoize inline styles in message components
Clears 5 react-perf/jsx-no-new-* warnings in message.tsx by memoizing
image source objects, extracting an AssistantMessageBlockContainer for
per-block spacing, and moving todo list item rendering into a
TodoListItemRow subcomponent so each row memoizes its own style arrays.
The remaining 8 warnings in react-native-markdown-display render rules
are inherent to that library's rule API.
* chore(lint): remove unused vitest imports in server tests
* chore(lint): remove unused helpers and vars in server tests
* chore(lint): add explicit returns in then() callbacks in server
* chore(lint): fix no-shadow and no-nested-ternary in server
* chore(lint): flatten nested blocks to satisfy max-depth in server
* chore(lint): extract helpers to satisfy max-depth in server
* chore(lint): parallelize Claude persisted agents lookup
Replace sequential parseClaudeSessionDescriptor loop with Promise.all
to fix no-await-in-loop warning.
* chore(lint): parallelize Linux watch directory traversal
Switch BFS to level-by-level Promise.all over readdir calls, replacing
the sequential pop/await loop that triggered no-await-in-loop.
* chore(lint): parallelize workspace registry bootstrap upserts
Collect per-workspace upsert inputs in a sync pass, then run registry
writes via Promise.all to eliminate no-await-in-loop warnings.
* chore(lint): parallelize test daemon cleanup rm calls
Run the paseoHomeRoot/staticDir removals concurrently in close() and
the startup catch block to fix no-await-in-loop.
* chore(lint): mechanical cleanup in app (unused, shadow, nested-ternary)
Recovers in-flight edits from the app mechanical agent that couldn't be
pushed due to concurrent tree contention. Removes unused helpers and
locals, flattens nested ternaries, narrows a few props where unused.
* chore(lint): parallelize pending permission approvals
approvePendingPermissions now filters and records handled IDs in a
sync pass, then awaits all allowPermission calls concurrently instead
of looping awaits.
* chore(lint): parallelize rebase head-name lookup
Try both rebase backends (rebase-merge, rebase-apply) concurrently
via Promise.all and return the first non-null result.
* chore(lint): no-unused-vars in app
* chore(lint): parallelize worktree terminal bootstrap
Start each bootstrap terminal concurrently via Promise.all. Since every
spec creates an independent terminal and returns a standalone result,
parallelization preserves order while removing two no-await-in-loop
warnings.
* chore(lint): parallelize worktree bootstrap test cleanup and script spawn
Run terminal cleanup across managers and spawnWorkspaceScript for api
and web concurrently to eliminate no-await-in-loop warnings while
preserving semantics.
* chore(lint): prefer-add-event-listener in app
* chore(lint): parallelize script-health-monitor afterEach and spawns
Close all stub TCP servers concurrently and spawn typecheck/api
scripts via Promise.all to drop two no-await-in-loop warnings.
* chore(lint): jsx-no-useless-fragment in app
* chore(lint): parallelize executable PATH probing
* chore(lint): parallelize client and relay transport test cleanup
* chore(lint): parallelize agent storage record file probing
* chore(lint): no-array-index-key in app
* chore(lint): parallelize bootstrap provider availability cleanup
* chore(lint): parallelize Codex rollout file search
* chore(lint): parallelize dictation wav fixture search
* chore(lint): parallelize Claude session id fixture test
* chore(lint): parallelize script health monitor server cleanup
* chore(lint): parallelize Codex skills directory scan
* chore(lint): promise/always-return in app
* chore(lint): no-shadow in use-dictation, hoist icons in splash screen
* chore(lint): no-shadow in composer callbacks
* chore(format): apply oxfmt to 3 server files
* chore(lint): no-explicit-any in stt-manager/chat-mentions tests
* chore(lint): no-shadow in small app files
Rename inner shadowing identifiers in:
- add-host-modal, agent-status-bar, sidebar-workspace-list, terminal-pane
- workspace-setup-dialog, session-context, use-is-local-daemon
- setup-panel, new-workspace-screen, workspace-desktop-tabs-row
* chore(lint): no-explicit-any in claude-agent.test
* chore(lint): no-shadow in small app test/e2e files
* chore(lint): no-explicit-any in workspace-git-service.test
* chore(lint): no-shadow in app test hoisted blocks
* chore(lint): no-explicit-any in websocket-server.runtime-metrics.test
* chore(lint): no-explicit-any in acp-agent.test
* chore(lint): no-shadow in app composer/message-input/e2e helpers
* chore(lint): no-explicit-any in session.workspace-git-watch.test
* chore(lint): no-explicit-any in websocket-server.notifications.test
* chore(lint): no-shadow in sidebar-workspace-list.test, use-pr-pane-data.test
* chore(lint): no-explicit-any in websocket-server.relay-reconnect.test
* chore(lint): no-explicit-any in codex-app-server-agent.test
* chore(lint): no-shadow in composer.test, host-runtime.test, new-workspace-screen.test
* chore(lint): no-explicit-any in codex-app-server-agent.features.test
* chore(lint): hoist jsx-as-prop in app components batch 1
Memoize inline JSX icons passed as props across add-host-modal,
branch-switcher, composer, pair-link-modal, pr-pane, and
sidebar-workspace-list to satisfy react-perf/jsx-no-jsx-as-prop.
* chore(lint): no-explicit-any in session.test
* chore(lint): hoist jsx-as-prop in app components batch 2
Memoize inline JSX passed as props across agent-list, agent-status-bar,
file-explorer-pane, git-actions-split-button, and message to satisfy
react-perf/jsx-no-jsx-as-prop.
* chore(lint): hoist jsx-as-prop in app components batch 3
Memoize inline JSX passed as props across combined-model-selector,
draggable-list.native, provider-diagnostic-sheet, and
workspace-setup-dialog to satisfy react-perf/jsx-no-jsx-as-prop.
* chore(lint): hoist jsx-as-prop in desktop components
Memoize inline JSX passed as props across desktop-permissions-section,
desktop-updates-section, integrations-section, and pair-device-section
to satisfy react-perf/jsx-no-jsx-as-prop.
* chore(lint): no-explicit-any in mcp-server.test
* chore(lint): hoist jsx-as-prop in workspace/new-workspace screens
* chore(lint): hoist jsx-as-prop in remaining screens
* chore(lint): no-explicit-any in session.workspaces.test
* chore(lint): no-explicit-any in snapshot-mutation-ownership.test
* chore(lint): no-explicit-any in dictation-stream-manager.test
* chore(lint): no-explicit-any in relay-transport.e2e.test
* chore(lint): no-explicit-any in worktree-session.test
* chore(lint): no-explicit-any in model-resolver.test
* chore(lint): no-explicit-any in sherpa-parakeet-stt.test
* chore(lint): no-explicit-any in speech-download.e2e.test
* chore(lint): no-explicit-any in script-health-monitor.test
* chore(lint): no-explicit-any in schedule/service.test
* chore(lint): no-explicit-any in persistence-hooks.test
* chore(lint): no-explicit-any in editor-targets.test
* chore(lint): no-explicit-any in send-while-running-stuck-test-utils.test
* chore(lint): no-explicit-any in agent-storage.test
* chore(lint): no-nested-ternary in app batch 1 (18 files)
* chore(lint): no-explicit-any in generate-sherpa-tts-matrix
* chore(lint): no-explicit-any in claude-agent
* chore(lint): no-explicit-any in websocket-server
* chore(lint): no-explicit-any in process-conversation
* chore(lint): no-explicit-any in daemon-client
* chore(lint): no-explicit-any in codex-app-server-agent
* chore(lint): no-nested-ternary in app batch 2 (26 files)
* chore(format): apply oxfmt to server test files
* chore(lint): parallelize agent archiving in test-mcp-inject
* chore(lint): no-explicit-any in small app files (batch 1)
* chore(lint): no-explicit-any in small app files (batch 2)
* chore(lint): no-explicit-any in app (batch 3)
Covers use-web-scrollbar, stream-strategy, dictation-stream-sender test,
terminal-perf helper, checkout-git-actions-store test, and
web-desktop-scrollbar.
* chore(lint): no-explicit-any in app (batch 4)
Covers composer, message-input, tooltip, workspace-desktop-tabs-row,
and the e2e helpers (app, node-ws-factory, terminal-probes).
* chore(lint): no-explicit-any in polyfills/crypto.ts
* chore(lint): no-explicit-any in components/sidebar-workspace-list.tsx
* chore(lint): prefer-array-find over filter().at/pop
Replace filter(pred).at(-1)/pop() patterns with findLast(pred) and
filter(pred)[0] with find(pred) across server and app.
* chore(lint): no-explicit-any in components/message.tsx
* chore(lint): no-explicit-any in components/plan-card.tsx
* chore(lint): no-map-spread replace with Object.assign
Replace { ...obj, override } inside map callbacks with Object.assign({}, obj, { override })
to satisfy oxc/no-map-spread. Preserves copy-on-write semantics.
* chore(lint): no-extraneous-class in test mocks
Add dispose() stubs to xterm addon mocks to satisfy typescript-eslint/no-extraneous-class, and convert static-only Notification mocks to plain objects.
* chore(lint): no-named-as-default use named imports for ws and openai
* chore(lint): jsx-no-new-array-as-prop hoist composed style in volume-display
Memoize the style array so it is not created inline on every render.
* chore(lint): prefer-add-event-listener use Object.assign for non-DOM handlers
These transports (Transport interface, StreamableHTTPServerTransport) use
plain on<event> properties rather than EventTarget, so addEventListener is
not an option. Using Object.assign to set the handlers avoids the lint
false-positive without changing behavior.
* chore(lint): no-multiple-resolved null pendingResolve after settling
Replace boolean-settled guards with a nullable captured resolve/reject.
Each promise callback captures the resolver, nulls it on first use, and
calls it. This preserves the existing single-resolution semantics while
making the no-multiple-resolved rule happy.
* chore(lint): reduce structural complexity in server
Extract nested-callback cleanup helpers in worktree-bootstrap.test. Extract Codex model definition builder to drop list-models complexity below 20.
* chore(lint): extract helpers in agent-activity and session-store-hooks.test
Split tool-call update handling in groupActivities into helpers to clear max-depth. Hoist useWorkspaceFields selector in the hooks test to drop callback nesting.
* chore(lint): rules-of-hooks and exhaustive-deps in agent-stream-view
Move useMemo calls for permission card styles above the early return
so hooks run unconditionally. Add missing dependencies to the inline
path press handler and the stream render callback.
* chore(lint): rules-of-hooks in diff-scroll via optional context hook
Replace try/catch around useExplorerSidebarAnimation with a new
useExplorerSidebarAnimationOptional hook that returns null when the
provider is absent.
* chore(lint): rules-of-hooks and exhaustive-deps in sidebar-workspace-list
Replace conditional useMemo calls with plain inline arrays, capture
creatingWorkspaceTimeoutsRef.current in the effect body before cleanup,
and depend on the full input object in armTimers.
* chore(lint): rules-of-hooks in split-container
Hoist useWorkspaceLayoutStore and useMemo calls above the pane-kind
early return so hooks always run in the same order.
* chore(lint): rules-of-hooks in context-menu and dropdown-menu
Inline the resolvedWidthStyle object inside the content useMemo and move
the early return below the hook so it is always invoked in the same order.
* chore(lint): rules-of-hooks in web-desktop-scrollbar
Move thumbRegionStyle and handleStyle useMemo calls above the visibility
early return.
* chore(lint): reduce complexity in types/stream
Split reduceStreamUpdate timeline branch into per-case helpers (tool call and compaction) to clear complexity and max-depth warnings.
* chore(lint): reduce complexity in diff-highlighter
Extract metadata detection, path extraction, hunk parsing, and content-line push into helpers to drop parseDiff complexity below 20.
* chore(lint): exhaustive-deps in composer and use-attachment-preview-url
Memoize githubSearchItems so the picker callbacks don't see a new array
every render, hoist realtimeVoiceButtonStyle above rightContent useMemo
that depends on it, and add missing style dependencies. Tighten
use-attachment-preview-url to read the attachment via a ref while keying
off stable field primitives.
* chore(lint): reduce complexity in tool-call-detail-state
Extract per-detail helpers for hasMeaningfulToolCallDetail to clear complexity warning.
* chore(lint): reduce complexity in agent-grouping
Split groupAgents into partition, project-activity map, active-project, and inactive-date helpers.
* chore(lint): reduce max-depth in voice-runtime
Extract retireFinishedGroup helper to flatten processPlaybackQueue nesting.
* chore(lint): reduce max-depth in use-branch-switcher
Extract maybeRestoreStashForBranch callback to flatten handleBranchSelect nesting.
* chore(lint): exhaustive-deps in components batch
Address exhaustive-deps warnings across file-explorer-pane, file-pane,
git-diff-pane, message, provider-diagnostic-sheet, stream-strategy-web,
terminal-emulator, terminal-pane, and volume-meter. Memoize values that
otherwise changed every render, read non-reactive values through refs
when the effect intentionally tracks a different key, and add missing
dependencies where they were genuinely absent.
* chore(lint): reduce complexity/max-depth in draft-store
Extract collectQueuedMessageAttachmentIds and collectStreamUserImageIds helpers from runAttachmentGc. Extract buildMigratedDraftRecord helper for migratePersistedState.
* chore(lint): reduce complexity in tooltip and workspace-scripts-button
Extract resolveActualSide and resolveAlignedCoordinate helpers in tooltip. Extract resolveScriptIconColor in workspace-scripts-button.
* chore(lint): exhaustive-deps in contexts and hooks batch
Fixes exhaustive-deps warnings across app contexts and hooks by adding
missing deps, stabilizing derived arrays with useMemo, capturing ref values
at effect entry, and using ref pattern where deps were intentionally omitted.
* chore(lint): final hook-rules in workspace-screen, editor-button, stores, e2e
Memoizes derived arrays (availableEditors, terminals) to stabilize
useMemo deps, adds missing deps (normalizedServerId, normalizedWorkspaceId,
explorerToggleStyle, workspaceIdsKey, eventName), and renames the Playwright
fixture callback parameter from `use` to `provide` so eslint-plugin-react-hooks
doesn't conflate it with React's use() hook.
* chore(lint): reduce complexity/max-nested-callbacks in workspace-tabs-store
Extract migrate function body into migrateWorkspaceTabsState top-level
helper with per-loop sub-helpers (migrateUiTabsForKey, mergeExplicitTabOrder,
mergeLegacyTabOrder, migrateFocusedTabIds) and replace the inline IIFE in
ensureTab with buildNextTabsForEnsure helper.
* chore(lint): reduce complexity in session-store and panel-store
Extract isSessionServerInfoUnchanged helper from updateSessionServerInfo
in session-store. In panel-store split migrate body into per-version
migration helpers (migratePanelV2Explorer, migratePanelV3Explorer,
migratePanelExplorerTabByCheckout, migratePanelDesktopFocusMode) and
a top-level migratePanelState function.
* chore(lint): reduce complexity in keyboard-shortcuts and use-keyboard-shortcuts
Split resolveKeyboardShortcut into resolveInitialChordStep and
resolveAdvancingChordStep helpers with a shared buildMatchFromBinding
factory. Split handleAction's large switch into handleDispatchOnlyAction,
handlePayloadAction, handleSettingsToggle, and handleCommandCenterToggle
helpers, with hasPayloadKey type guard replacing inline payload checks.
* chore(lint): reduce complexity in audio recorder web hooks
Extract assertMicrophoneEnvironment helper from useAudioRecorder start
callback. Split useDictationAudioSource stop callback with
disconnectDictationAudioGraph, stopMediaRecorderIfActive,
finalizeRecorderStoppedPromise, and safeDisconnectNode helpers.
* chore(lint): reduce complexity in use-git-actions
* chore(lint): reduce complexity in use-pr-pane-data
* chore(lint): reduce complexity in use-agent-autocomplete
* chore(lint): reduce complexity in use-agent-screen-state-machine
* chore(lint): reduce complexity in session-stream-reducers
* chore(lint): reduce complexity in desktop-updates-section
* chore(lint): reduce complexity in pair-device-section
* chore(lint): reduce complexity in update-callout-source
* chore(lint): reduce complexity in provider-diagnostic-sheet
* chore(lint): disable no-await-in-loop (sequential-by-necessity cases)
Most remaining no-await-in-loop warnings were in legitimate sequential
patterns: polling loops with sleep, streaming/pagination cursors, shared
mutable state, ordered side effects (audio playback, port allocation).
Parallelizing these would change observable behavior. Rather than force
restructures that add complexity without benefit, disable the rule.
* chore(lint): reduce complexity in setup-panel
Extract helpers (resolveAutoExpandIndex, resolveSetupStatusLabel,
resolveCommandLog, buildCommandRowState) and lift the standalone log
view and top-level error banner into dedicated sub-components to drop
SetupPanel below the complexity limit.
* chore(lint): reduce complexity in AssistantMarkdownImage
Extract error-text resolution into a helper so the image component
drops below the cyclomatic complexity threshold.
* chore(lint): reduce complexity in ProjectLeadingVisual
Extract the status-variant dispatch into a ProjectLeadingVisualStatus
sub-component so the outer function stays below the cyclomatic
complexity limit.
* chore(lint): extract ChatAgentContent agent-building helper
* chore(lint): reduce complexity in ChatAgentContent
Extract the chat-agent selector (selectChatAgentState +
resolveChatAgentFromSession), the agent-shape constructor
(buildChatAgentFromState), and the not-found/error/boot view
dispatch (renderChatAgentNonReadyView) into helpers so both the
selector callback and the component function drop below the
cyclomatic complexity limit.
* chore(lint): extract subcomponents to reduce JSX nesting depth
* chore(lint): reduce complexity in app components (status-bar, explorer, setup-dialog, tool-call-details)
* chore(lint): reduce complexity in app hooks/runtime/stores/misc components
* chore(lint): long-tail cleanup (no-async-endpoint-handlers, unicorn rules, unescaped-entities, unassigned-import allowlist)
* chore(lint): simplify agent useMemo deps to match helper signature
* chore(lint): rename ChatService.postMessage to dispatchMessage
* chore(lint): server cleanup (no-shadow, no-useless-*, no-unmodified-loop, control-regex, require-yield)
* chore(lint): app cleanup (jsx-max-depth, jsx-no-new-*-as-prop, complexity, misleading-regex, no-useless-*)
* chore(lint): e2e cleanup (no-unmodified-loop-condition, max-nested-callbacks)
* chore(lint): workspace-screen complexity + no-empty-pattern cleanup
* chore(lint): use Array.from for defensive snapshot iteration
* chore(lint): final mechanical tail (control-regex, max-depth, useless-expressions, examples cleanup)
* chore(lint): reduce agent-stream-view complexity
* chore(lint): reduce resolveAgentModelSelection complexity
* chore(lint): reduce globalSetup complexity
* chore(format): oxfmt draft-store single-line signature
* chore(lint): reduce GitDiffPane complexity
* chore(lint): reduce MessageInput complexity
* chore(lint): reduce Combobox complexity
* fix(server): bound listLinuxWatchDirectories readdir concurrency
Wraps the per-level readdir traversal in listLinuxWatchDirectories with a
module-level p-limit (default 16, tunable via PASEO_LINUX_WATCH_READDIR_CONCURRENCY).
On broad repos, the previous Promise.all over an entire BFS level could issue
an unbounded number of concurrent readdir calls. Behavior is otherwise
identical: still traverses all non-.git directories and swallows per-directory
readdir failures.
* chore(lint): promote oxlint warnings to errors
- package.json: lint/lint:fix now pass --deny-warnings so any warning fails
- .github/workflows/ci.yml: add lint job running npm run lint
- .oxlintrc.json: disable no-empty-pattern for e2e/fixtures.ts
(Playwright requires the empty object destructure as the first arg)
- packages/app/e2e/fixtures.ts: restore async ({}, provide) signature
- packages/app/e2e/global-setup.ts: oxfmt single-line signature
* fix(test): relay-transport ws mock exports WebSocket named binding
Commit 38efad7d switched relay-transport.ts from default to named import
of ws.WebSocket, but the test mock still only exported default. Updated
vi.mock("ws") to return both default and named WebSocket bindings so the
mocked module matches the new import shape. Classification: test drifted
with production code; test now exports what the production import needs.
* chore(lint): make oxlint error at config level; add Lefthook pre-commit
Replaces --deny-warnings workaround with semantic severity at the config
level, and adds whole-repo pre-commit gates via Lefthook.
- .oxlintrc.json: all enabled categories (correctness, suspicious, perf)
and intentional rule overrides now use "error" instead of "warn".
Removed duplicate "require-await" key (last-wins "off" preserved).
- package.json: lint scripts are plain oxlint / oxlint --fix. Adds
lefthook devDep and "prepare": "lefthook install --force" so hooks
install on npm install even where core.hooksPath is set globally.
- lefthook.yml: pre-commit runs format:check, lint, typecheck in
parallel. Whole-repo gates (no glob filters). Block-only, no
auto-formatting.
* fix: update lockfile signatures and Nix hash
* chore(lint): pre-commit runs formatter in write mode, then lint+typecheck
Switches the pre-commit hook from format:check to format (write) with
stage_fixed: true, so the formatter rewrites files and re-stages them
into the commit. Lint and typecheck then run in parallel against the
formatted tree.
Sequencing uses Lefthook 2.x jobs with a nested group: top-level jobs
run sequentially, so the format job completes before the checks group
starts; within checks, lint and typecheck run in parallel.
CI continues to use format:check, so unformatted code pushed with
--no-verify still fails on the server.
* chore(lint): revert pre-commit to format:check (no stage_fixed)
stage_fixed: true with a whole-repo formatter (oxfmt .) can silently
re-stage the full reformatted file when a developer used git add -p
to stage only a hunk, losing their hunk-level intent. Safer to just
block the commit on unformatted code and let the dev run
`npm run format` themselves.
Reverts to the simple parallel check form: all three commands run
concurrently and are read-only.
* chore(ts7): tsgo compatibility across the monorepo
Preserves tsc 5.9.3 behavior while making TypeScript 7 / tsgo
(@typescript/native-preview 7.0.0-dev.20260423.1) green
package-by-package.
tsconfig:
- server/tsconfig.server.json: drop removed `baseUrl`; rewrite
`@server/*` paths entry to be relative to the tsconfig.
- website/tsconfig.json: drop removed `baseUrl`; rewrite
`~/*` paths entry to be relative.
- expo-two-way-audio/tsconfig.json: replace inherited
moduleResolution=node10 with `bundler`, set `module: esnext`
(required by `bundler`). Matches Metro/Expo runtime behavior
and avoids forcing `.js` extensions in source.
source:
- app/e2e/helpers/terminal-probes.ts: WebSocket subclass `send`
now types its argument as `Parameters<WebSocket["send"]>[0]`
so the subclass signature tracks the platform type across
tsc 5.9 and TS 7 libdom.
- relay/src/crypto.ts: tweetnacl setPRNG callback allocates a
fresh Uint8Array for getRandomValues (owning ArrayBuffer) and
copies into the caller-provided view. TS 7 libdom requires
ArrayBufferView<ArrayBuffer> (not ArrayBufferLike).
All 8 packages green under both tsc --noEmit and tsgo --noEmit.
* fix(app): update os-notifications test mocks for addEventListener
Commit 46731a51 switched attachWebClickHandler from notification.onclick
to notification.addEventListener("click", ...) to satisfy the
prefer-add-event-listener lint rule. The test mocks still asserted
the old onclick property, so two specs failed on CI with
"notification.addEventListener is not a function". Update the three
MockNotification classes to record click listeners through
addEventListener and drive them via clickListeners[0] in the
assertions.
* chore: switch typecheck from tsc to tsgo (@typescript/native-preview)
Installs @typescript/native-preview 7.0.0-dev.20260423.1 as a root
devDependency and swaps every per-workspace `typecheck` script from
`tsc --noEmit` to `tsgo --noEmit`. Build scripts still use `tsc`, so
emit behavior is unchanged. Monorepo typecheck drops from ~28s to
~4.7s wall clock (~6x faster).
expo-two-way-audio previously ran `tsc` without --noEmit for its
typecheck step. tsgo is stricter about rootDir on emit, so the
typecheck script explicitly passes --noEmit here too.
* fix: update lockfile signatures and Nix hash
* fix(app): commit *.css module declaration for CI typecheck
expo generates expo-env.d.ts (which references expo/types where
*.css is declared) locally, but the file is gitignored. CI does a
fresh checkout + install and doesn't run expo, so the declaration
is missing and tsgo rejects the side-effect import
'@xterm/xterm/css/xterm.css' with TS2882. Add a committed
packages/app/global.d.ts with 'declare module "*.css"' so typecheck
is self-contained.
tsc tolerated the missing declaration more loosely; tsgo is stricter.
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1007 lines
35 KiB
TypeScript
1007 lines
35 KiB
TypeScript
import * as React from "react";
|
||
import { motion } from "framer-motion";
|
||
import {
|
||
FolderGit2,
|
||
Paperclip,
|
||
ArrowUp,
|
||
X,
|
||
MessagesSquare,
|
||
Plus,
|
||
Settings,
|
||
Monitor,
|
||
GitCommitHorizontal,
|
||
ChevronDown,
|
||
ChevronRight,
|
||
ListChevronsUpDown,
|
||
Bot,
|
||
Check,
|
||
Loader,
|
||
SquareTerminal,
|
||
PanelLeft,
|
||
Ellipsis,
|
||
Mic,
|
||
GitPullRequest,
|
||
SquarePen,
|
||
Columns2,
|
||
Rows2,
|
||
} from "lucide-react";
|
||
import { ClaudeIcon, CodexIcon, SourceControlIcon } from "~/components/mockup";
|
||
|
||
const USER_BUBBLE_STYLE = { borderRadius: "16px 2px 16px 16px" };
|
||
const NEW_BADGE_STYLE = { backgroundColor: "rgba(46, 160, 67, 0.2)" };
|
||
|
||
// ── Stagger timing ──────────────────────────────────────
|
||
|
||
const D = {
|
||
shell: 0,
|
||
sidebar: 0.1,
|
||
titleBar: 0.15,
|
||
tabs: 0.25,
|
||
chat: 0.35,
|
||
diffPanel: 0.55,
|
||
};
|
||
|
||
function fade(delay: number) {
|
||
return {
|
||
initial: { opacity: 0, y: 8 } as const,
|
||
animate: { opacity: 1, y: 0 } as const,
|
||
transition: { duration: 0.5, delay, ease: "easeOut" as const },
|
||
};
|
||
}
|
||
|
||
// ── Data ────────────────────────────────────────────────
|
||
|
||
type ChatItem =
|
||
| { type: "user"; text: string }
|
||
| { type: "text"; text: string; bold?: boolean }
|
||
| { type: "tool"; label: string; summary?: string; status: "running" | "done" };
|
||
|
||
const CHAT: ChatItem[] = [
|
||
{ type: "user", text: "Build me an internal dashboard for tracking customer returns" },
|
||
{ type: "text", text: "I'll break this down into planning and implementation.", bold: true },
|
||
{ type: "tool", label: "Run plan-technical", summary: "codex · plan-technical", status: "done" },
|
||
{ type: "tool", label: "Run plan-design", summary: "claude · plan-design", status: "done" },
|
||
{
|
||
type: "tool",
|
||
label: "Wait for agents",
|
||
summary: "plan-technical plan-design",
|
||
status: "done",
|
||
},
|
||
{ type: "text", text: "Got the plans. Spinning up Codex for implementation.", bold: true },
|
||
{ type: "tool", label: "Run implement", summary: "codex · 12 files changed", status: "done" },
|
||
{ type: "text", text: "Implementation done. Requesting review from Claude." },
|
||
{ type: "tool", label: "Run review", summary: "claude · no issues found", status: "running" },
|
||
{ type: "text", text: "All tasks complete. Dashboard is ready.", bold: true },
|
||
];
|
||
|
||
// ── Sidebar data ────────────────────────────────────────
|
||
|
||
interface SidebarWorkspace {
|
||
name: string;
|
||
kind: "checkout" | "worktree";
|
||
status: "running" | "done" | "idle" | "syncing";
|
||
selected?: boolean;
|
||
diffStat?: { additions: number; deletions: number };
|
||
pr?: { number: number; state: "open" | "merged" | "closed" };
|
||
}
|
||
|
||
interface SidebarProject {
|
||
initial: string;
|
||
name: string;
|
||
workspaces: SidebarWorkspace[];
|
||
}
|
||
|
||
const SIDEBAR_PROJECTS: SidebarProject[] = [
|
||
{
|
||
initial: "A",
|
||
name: "acme/returns-app",
|
||
workspaces: [
|
||
{
|
||
name: "main",
|
||
kind: "checkout",
|
||
status: "syncing",
|
||
selected: true,
|
||
diffStat: { additions: 247, deletions: 15 },
|
||
},
|
||
{
|
||
name: "feat/dashboard",
|
||
kind: "worktree",
|
||
status: "done",
|
||
pr: { number: 142, state: "open" },
|
||
},
|
||
],
|
||
},
|
||
{
|
||
initial: "P",
|
||
name: "acme/payments",
|
||
workspaces: [
|
||
{ name: "main", kind: "checkout", status: "idle" },
|
||
{
|
||
name: "fix/stripe-webhook",
|
||
kind: "worktree",
|
||
status: "done",
|
||
diffStat: { additions: 38, deletions: 4 },
|
||
pr: { number: 89, state: "merged" },
|
||
},
|
||
],
|
||
},
|
||
{
|
||
initial: "I",
|
||
name: "acme/infra",
|
||
workspaces: [
|
||
{ name: "main", kind: "checkout", status: "idle" },
|
||
{
|
||
name: "feat/k8s-autoscale",
|
||
kind: "worktree",
|
||
status: "syncing",
|
||
diffStat: { additions: 91, deletions: 3 },
|
||
},
|
||
],
|
||
},
|
||
{
|
||
initial: "D",
|
||
name: "acme/design-system",
|
||
workspaces: [{ name: "main", kind: "checkout", status: "idle" }],
|
||
},
|
||
];
|
||
|
||
// ── Tab data ─────────────────────────────────────────────
|
||
|
||
interface TabDef {
|
||
name: string;
|
||
provider: "claude" | "codex" | "terminal";
|
||
done: boolean;
|
||
active?: boolean;
|
||
}
|
||
|
||
const TABS: TabDef[] = [
|
||
{ name: "Orchestrator", provider: "claude", done: false, active: true },
|
||
{ name: "Implement", provider: "codex", done: true },
|
||
{ name: "Review", provider: "claude", done: true },
|
||
];
|
||
|
||
// ── Diff data ──────────────────────────────────────────
|
||
|
||
type DiffLineType = "add" | "remove" | "context" | "header";
|
||
interface DiffLine {
|
||
type: DiffLineType;
|
||
ln: string | null;
|
||
content?: string;
|
||
tokens?: Array<{ text: string; cls: string }>;
|
||
}
|
||
|
||
const DIFF_LINES: DiffLine[] = [
|
||
{
|
||
type: "add",
|
||
ln: "1",
|
||
tokens: [
|
||
{ text: "import", cls: "text-syn-keyword" },
|
||
{ text: " { ", cls: "text-syn-punctuation" },
|
||
{ text: "useState", cls: "text-syn-variable" },
|
||
{ text: " } ", cls: "text-syn-punctuation" },
|
||
{ text: "from", cls: "text-syn-keyword" },
|
||
{ text: ' "react"', cls: "text-syn-string" },
|
||
],
|
||
},
|
||
{
|
||
type: "add",
|
||
ln: "2",
|
||
tokens: [
|
||
{ text: "import", cls: "text-syn-keyword" },
|
||
{ text: " { ", cls: "text-syn-punctuation" },
|
||
{ text: "ReturnTable", cls: "text-syn-variable" },
|
||
{ text: " } ", cls: "text-syn-punctuation" },
|
||
{ text: "from", cls: "text-syn-keyword" },
|
||
{ text: ' "./components"', cls: "text-syn-string" },
|
||
],
|
||
},
|
||
{ type: "add", ln: "3", tokens: [] },
|
||
{
|
||
type: "add",
|
||
ln: "4",
|
||
tokens: [
|
||
{ text: "export", cls: "text-syn-keyword" },
|
||
{ text: " function", cls: "text-syn-keyword" },
|
||
{ text: " Dashboard", cls: "text-syn-function" },
|
||
{ text: "() {", cls: "text-syn-punctuation" },
|
||
],
|
||
},
|
||
{
|
||
type: "add",
|
||
ln: "5",
|
||
tokens: [
|
||
{ text: " const", cls: "text-syn-keyword" },
|
||
{ text: " [returns, setReturns]", cls: "text-syn-variable" },
|
||
{ text: " = ", cls: "text-syn-operator" },
|
||
{ text: "useState", cls: "text-syn-function" },
|
||
{ text: "([])", cls: "text-syn-punctuation" },
|
||
],
|
||
},
|
||
{
|
||
type: "add",
|
||
ln: "6",
|
||
tokens: [
|
||
{ text: " const", cls: "text-syn-keyword" },
|
||
{ text: " [filter, setFilter]", cls: "text-syn-variable" },
|
||
{ text: " = ", cls: "text-syn-operator" },
|
||
{ text: "useState", cls: "text-syn-function" },
|
||
{ text: '("all")', cls: "text-syn-string" },
|
||
],
|
||
},
|
||
{ type: "add", ln: "7", tokens: [] },
|
||
{
|
||
type: "add",
|
||
ln: "8",
|
||
tokens: [
|
||
{ text: " ", cls: "text-syn-punctuation" },
|
||
{ text: "return", cls: "text-syn-keyword" },
|
||
{ text: " (", cls: "text-syn-punctuation" },
|
||
],
|
||
},
|
||
{
|
||
type: "add",
|
||
ln: "9",
|
||
tokens: [
|
||
{ text: " <", cls: "text-syn-punctuation" },
|
||
{ text: "main", cls: "text-syn-tag" },
|
||
{ text: " className", cls: "text-syn-property" },
|
||
{ text: '="', cls: "text-syn-punctuation" },
|
||
{ text: "min-h-screen p-8", cls: "text-syn-string" },
|
||
{ text: '">', cls: "text-syn-punctuation" },
|
||
],
|
||
},
|
||
{
|
||
type: "add",
|
||
ln: "10",
|
||
tokens: [
|
||
{ text: " <", cls: "text-syn-punctuation" },
|
||
{ text: "h1", cls: "text-syn-tag" },
|
||
{ text: ">Customer Returns</", cls: "text-syn-variable" },
|
||
{ text: "h1", cls: "text-syn-tag" },
|
||
{ text: ">", cls: "text-syn-punctuation" },
|
||
],
|
||
},
|
||
{
|
||
type: "add",
|
||
ln: "11",
|
||
tokens: [
|
||
{ text: " <", cls: "text-syn-punctuation" },
|
||
{ text: "FilterBar", cls: "text-syn-tag" },
|
||
{ text: " value", cls: "text-syn-property" },
|
||
{ text: "={", cls: "text-syn-punctuation" },
|
||
{ text: "filter", cls: "text-syn-variable" },
|
||
{ text: "}", cls: "text-syn-punctuation" },
|
||
{ text: " onChange", cls: "text-syn-property" },
|
||
{ text: "={", cls: "text-syn-punctuation" },
|
||
{ text: "setFilter", cls: "text-syn-variable" },
|
||
{ text: "} />", cls: "text-syn-punctuation" },
|
||
],
|
||
},
|
||
{
|
||
type: "add",
|
||
ln: "12",
|
||
tokens: [
|
||
{ text: " <", cls: "text-syn-punctuation" },
|
||
{ text: "ReturnTable", cls: "text-syn-tag" },
|
||
{ text: " data", cls: "text-syn-property" },
|
||
{ text: "={", cls: "text-syn-punctuation" },
|
||
{ text: "returns", cls: "text-syn-variable" },
|
||
{ text: "} />", cls: "text-syn-punctuation" },
|
||
],
|
||
},
|
||
{
|
||
type: "add",
|
||
ln: "13",
|
||
tokens: [
|
||
{ text: " <", cls: "text-syn-punctuation" },
|
||
{ text: "StatusChart", cls: "text-syn-tag" },
|
||
{ text: " data", cls: "text-syn-property" },
|
||
{ text: "={", cls: "text-syn-punctuation" },
|
||
{ text: "returns", cls: "text-syn-variable" },
|
||
{ text: "} />", cls: "text-syn-punctuation" },
|
||
],
|
||
},
|
||
{
|
||
type: "add",
|
||
ln: "14",
|
||
tokens: [
|
||
{ text: " </", cls: "text-syn-punctuation" },
|
||
{ text: "main", cls: "text-syn-tag" },
|
||
{ text: ">", cls: "text-syn-punctuation" },
|
||
],
|
||
},
|
||
{ type: "add", ln: "15", tokens: [{ text: " )", cls: "text-syn-punctuation" }] },
|
||
{ type: "add", ln: "16", tokens: [{ text: "}", cls: "text-syn-punctuation" }] },
|
||
];
|
||
|
||
// ── Implementation agent chat data ──────────────────────
|
||
|
||
// ── Terminal log lines ─────────────────────────────────
|
||
|
||
const TERMINAL_LINES = [
|
||
{ id: "cmd", text: "$ npm run dev", cls: "text-mock-fg" },
|
||
{ id: "blank1", text: "", cls: "" },
|
||
{ id: "pkg", text: "> acme-returns@0.1.0 dev", cls: "text-mock-fg-muted" },
|
||
{ id: "pkg-cmd", text: "> next dev --turbopack", cls: "text-mock-fg-muted" },
|
||
{ id: "blank2", text: "", cls: "" },
|
||
{ id: "next-ver", text: " ▲ Next.js 15.3.1 (Turbopack)", cls: "text-mock-fg" },
|
||
{ id: "next-local", text: " - Local: http://localhost:3000", cls: "text-mock-fg-muted" },
|
||
{ id: "blank3", text: "", cls: "" },
|
||
{ id: "starting", text: " ✓ Starting...", cls: "text-mock-green" },
|
||
{ id: "ready", text: " ✓ Ready in 1.2s", cls: "text-mock-green" },
|
||
{ id: "compiling-dashboard", text: " ○ Compiling /dashboard ...", cls: "text-mock-fg-muted" },
|
||
{ id: "compiled-dashboard", text: " ✓ Compiled /dashboard in 340ms", cls: "text-mock-green" },
|
||
{ id: "compiling-api", text: " ○ Compiling /api/returns ...", cls: "text-mock-fg-muted" },
|
||
{ id: "compiled-api", text: " ✓ Compiled /api/returns in 120ms", cls: "text-mock-green" },
|
||
];
|
||
|
||
// ── Sub-components ──────────────────────────────────────
|
||
|
||
function TrafficLights() {
|
||
return (
|
||
<div className="flex items-center gap-[6px]">
|
||
<div className="w-[11px] h-[11px] rounded-full bg-[#ff5f57]" />
|
||
<div className="w-[11px] h-[11px] rounded-full bg-[#febc2e]" />
|
||
<div className="w-[11px] h-[11px] rounded-full bg-[#28c840]" />
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function ProviderIcon({
|
||
provider,
|
||
muted = false,
|
||
}: {
|
||
provider: "claude" | "codex" | "terminal";
|
||
muted?: boolean;
|
||
}) {
|
||
const cls = muted ? "text-mock-fg-muted" : "text-mock-fg";
|
||
if (provider === "terminal") return <SquareTerminal size={13} className={cls} />;
|
||
return provider === "claude" ? (
|
||
<ClaudeIcon size={13} className={cls} />
|
||
) : (
|
||
<CodexIcon size={13} className={cls} />
|
||
);
|
||
}
|
||
|
||
function TabBarAction({
|
||
icon: Icon,
|
||
}: {
|
||
icon: React.ComponentType<{ size?: number; className?: string; strokeWidth?: number }>;
|
||
}) {
|
||
return (
|
||
<div className="w-4 h-5 flex items-center justify-center flex-shrink-0">
|
||
<Icon size={12} strokeWidth={1.5} className="text-mock-fg-muted" />
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function PaneTabBar({ tabs, focused = false }: { tabs: TabDef[]; focused?: boolean }) {
|
||
return (
|
||
<div className="flex items-stretch h-7 bg-mock-surface0 border-b border-mock-border flex-shrink-0">
|
||
{tabs.map((tab) => (
|
||
<div
|
||
key={tab.name}
|
||
className="flex items-center gap-1.5 px-2 border-r border-mock-border relative min-w-0"
|
||
>
|
||
{tab.active && (
|
||
<div
|
||
className={`absolute top-0 left-0 right-0 h-0.5 ${focused ? "bg-mock-accent" : "bg-mock-border-accent"}`}
|
||
/>
|
||
)}
|
||
|
||
<div className="relative flex-shrink-0">
|
||
<ProviderIcon provider={tab.provider} muted={!tab.active} />
|
||
</div>
|
||
|
||
<span
|
||
className={`text-[11px] truncate ${tab.active ? "text-mock-fg" : "text-mock-fg-muted"}`}
|
||
>
|
||
{tab.name}
|
||
</span>
|
||
|
||
<X size={11} className="text-mock-zinc500 flex-shrink-0 ml-auto" />
|
||
</div>
|
||
))}
|
||
<div className="ml-auto flex items-center px-1.5">
|
||
<TabBarAction icon={SquarePen} />
|
||
<TabBarAction icon={SquareTerminal} />
|
||
<TabBarAction icon={Columns2} />
|
||
<TabBarAction icon={Rows2} />
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function Composer({
|
||
provider,
|
||
model,
|
||
focused = false,
|
||
}: {
|
||
provider: "claude" | "codex";
|
||
model: string;
|
||
focused?: boolean;
|
||
}) {
|
||
const Icon = provider === "claude" ? ClaudeIcon : CodexIcon;
|
||
return (
|
||
<div className="px-3 pb-3 flex-shrink-0">
|
||
<div className="bg-mock-surface1 border border-mock-border-accent rounded-2xl px-3 py-2 flex flex-col gap-[10px]">
|
||
<div className="flex items-center">
|
||
{focused && (
|
||
<span className="inline-block w-[1px] h-[13px] bg-mock-fg animate-pulse mr-[1px] flex-shrink-0" />
|
||
)}
|
||
<span className="text-[11px] text-mock-zinc500 leading-[1.4] select-none whitespace-nowrap overflow-hidden text-ellipsis">
|
||
Message the agent, tag @files, or use /commands and /skills
|
||
</span>
|
||
</div>
|
||
<div className="flex items-end justify-between">
|
||
<div className="flex items-center gap-0.5">
|
||
<div className="w-[22px] h-[22px] rounded-full flex items-center justify-center flex-shrink-0">
|
||
<Paperclip size={12} className="text-mock-fg" />
|
||
</div>
|
||
<div className="flex items-center gap-[4px] h-[22px] px-[6px] rounded-full">
|
||
<Icon size={12} className="text-mock-fg-muted" />
|
||
<span className="text-[10px] text-mock-fg-muted leading-none">{model}</span>
|
||
<ChevronDown size={10} className="text-mock-fg-muted" />
|
||
</div>
|
||
</div>
|
||
<div className="flex items-center gap-[6px]">
|
||
<div className="w-[22px] h-[22px] rounded-full flex items-center justify-center flex-shrink-0">
|
||
<Mic size={12} className="text-mock-fg" />
|
||
</div>
|
||
<div className="w-[22px] h-[22px] rounded-full bg-mock-accent flex items-center justify-center flex-shrink-0">
|
||
<ArrowUp size={12} className="text-white" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function prStateLabel(state: "open" | "merged" | "closed"): string {
|
||
if (state === "open") return "Open";
|
||
if (state === "merged") return "Merged";
|
||
return "Closed";
|
||
}
|
||
|
||
function WorkspaceIcon({ workspace }: { workspace: SidebarWorkspace }) {
|
||
if (workspace.status === "syncing") return <SyncedLoader size={11} />;
|
||
const icon =
|
||
workspace.kind === "worktree" ? (
|
||
<FolderGit2 size={14} className="text-mock-fg-muted" />
|
||
) : (
|
||
<Monitor size={14} className="text-mock-fg-muted" />
|
||
);
|
||
return (
|
||
<>
|
||
{icon}
|
||
{workspace.status !== "idle" && (
|
||
<div className="absolute bottom-0 right-0">
|
||
<WorkspaceStatusDot status={workspace.status} />
|
||
</div>
|
||
)}
|
||
</>
|
||
);
|
||
}
|
||
|
||
function SidebarWorkspaceRow({ workspace }: { workspace: SidebarWorkspace }) {
|
||
return (
|
||
<div className={`mb-1 mx-1.5 rounded-lg ${workspace.selected ? "bg-mock-surface1" : ""}`}>
|
||
<div className="flex items-center gap-2 min-h-[28px] py-1 pl-[22px] pr-1">
|
||
<div className="relative w-[14px] h-4 flex-shrink-0 flex items-center justify-center">
|
||
<WorkspaceIcon workspace={workspace} />
|
||
</div>
|
||
<span className="text-[12px] text-mock-fg/[0.76] font-normal truncate flex-1 min-w-0 leading-[1.4]">
|
||
{workspace.name}
|
||
</span>
|
||
{workspace.diffStat && (
|
||
<div className="flex items-center gap-1 flex-shrink-0">
|
||
<span className="text-[10px] text-mock-green-400 font-normal leading-none">
|
||
+{workspace.diffStat.additions}
|
||
</span>
|
||
<span className="text-[10px] text-mock-red font-normal leading-none">
|
||
-{workspace.diffStat.deletions}
|
||
</span>
|
||
</div>
|
||
)}
|
||
</div>
|
||
{workspace.pr && (
|
||
<div className="flex items-center gap-1 pl-[42px] pr-2 pb-0.5">
|
||
<GitPullRequest size={11} className="text-mock-fg-muted" />
|
||
<span className="text-[10px] text-mock-fg-muted leading-none truncate">
|
||
#{workspace.pr.number} · {prStateLabel(workspace.pr.state)}
|
||
</span>
|
||
</div>
|
||
)}
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function diffLineBg(type: DiffLineType): string {
|
||
if (type === "add") return "bg-mock-diff-add";
|
||
if (type === "remove") return "bg-mock-diff-remove";
|
||
return "bg-mock-surface1";
|
||
}
|
||
|
||
function diffLineNumCls(type: DiffLineType): string {
|
||
if (type === "add") return "text-mock-green-400";
|
||
if (type === "remove") return "text-mock-red";
|
||
return "text-mock-fg-muted";
|
||
}
|
||
|
||
function DiffLineRow({ line }: { line: DiffLine }) {
|
||
const lineBg = diffLineBg(line.type);
|
||
const lineNumCls = diffLineNumCls(line.type);
|
||
return (
|
||
<div className={`flex items-stretch ${lineBg}`}>
|
||
<div className="w-8 border-r border-mock-border flex-shrink-0 flex items-center justify-end">
|
||
<code className={`text-[10px] font-mono ${lineNumCls} select-none pr-2 py-[1px]`}>
|
||
{line.ln ?? ""}
|
||
</code>
|
||
</div>
|
||
<code className="text-[10px] font-mono text-mock-fg pl-3 pr-3 py-[1px] whitespace-pre flex-1 min-w-0">
|
||
{line.tokens?.map((tok) => (
|
||
<span key={`${tok.cls}:${tok.text}`} className={tok.cls}>
|
||
{tok.text}
|
||
</span>
|
||
))}
|
||
</code>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function chatItemKey(item: ChatItem): string {
|
||
if (item.type === "user") return `user-${item.text}`;
|
||
if (item.type === "tool") return `tool-${item.label}-${item.summary ?? ""}`;
|
||
return `text-${item.text}`;
|
||
}
|
||
|
||
function ChatMessages({ items }: { items: ChatItem[] }) {
|
||
return (
|
||
<div className="flex-1 overflow-hidden px-2 py-2">
|
||
{items.map((item) => {
|
||
const key = chatItemKey(item);
|
||
if (item.type === "user") {
|
||
return (
|
||
<div key={key} className="flex justify-end py-1">
|
||
<div
|
||
className="bg-mock-surface2 px-2.5 py-1.5 max-w-[85%] leading-none"
|
||
style={USER_BUBBLE_STYLE}
|
||
>
|
||
<span className="text-[11px] text-mock-fg leading-none">{item.text}</span>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
if (item.type === "tool") {
|
||
const isDone = item.status === "done";
|
||
return (
|
||
<div
|
||
key={key}
|
||
className="flex items-center rounded-lg px-2 py-[1px] -mx-[6px] border border-transparent"
|
||
>
|
||
<div className="w-[22px] h-[22px] rounded-full flex items-center justify-center flex-shrink-0 mr-1">
|
||
<Bot size={12} className="text-mock-fg-muted" />
|
||
</div>
|
||
<span className="text-[11px] text-mock-fg-muted truncate flex-shrink-0">
|
||
{item.label}
|
||
</span>
|
||
{item.summary && (
|
||
<span className="text-[11px] text-mock-zinc500 truncate flex-1 ml-2">
|
||
{item.summary}
|
||
</span>
|
||
)}
|
||
<div className="ml-auto flex-shrink-0 pl-2">
|
||
{isDone ? (
|
||
<Check size={11} className="text-mock-zinc500" />
|
||
) : (
|
||
<Loader size={11} className="text-mock-fg-muted animate-spin" />
|
||
)}
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
return (
|
||
<p
|
||
key={key}
|
||
className={`text-[11px] px-2 py-[1px] text-mock-fg leading-[1.5] ${item.bold ? "font-medium" : ""}`}
|
||
>
|
||
{item.text}
|
||
</p>
|
||
);
|
||
})}
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function ChatArea() {
|
||
return (
|
||
<div className="flex flex-col flex-1 min-w-0 bg-mock-surface0">
|
||
<ChatMessages items={CHAT} />
|
||
<Composer provider="claude" model="Opus 4.6" focused />
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function TerminalPane() {
|
||
return (
|
||
<div className="flex flex-col flex-1 min-w-0 min-h-0 bg-mock-surface0">
|
||
<div className="flex-1 overflow-hidden px-3 py-2">
|
||
{TERMINAL_LINES.map((line) => (
|
||
<div key={line.id} className="leading-[1.3]">
|
||
<code className={`text-[10px] font-mono ${line.cls} whitespace-pre`}>{line.text}</code>
|
||
</div>
|
||
))}
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function ExplorerSidebar() {
|
||
return (
|
||
<div className="flex flex-col bg-mock-sidebar border-l border-mock-border w-[28%] flex-shrink-0 overflow-hidden">
|
||
{/* Explorer header — h-12, Changes/Files tabs */}
|
||
<div className="flex items-center h-10 px-2 border-b border-mock-border flex-shrink-0">
|
||
<div className="flex items-center gap-1">
|
||
<div className="flex items-center px-3 py-1.5 rounded-md bg-mock-surface1">
|
||
<span className="text-[11px] text-mock-fg font-medium">Changes</span>
|
||
</div>
|
||
<div className="flex items-center px-3 py-1.5 rounded-md">
|
||
<span className="text-[11px] text-mock-fg-muted">Files</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{/* Secondary header — h-9, Uncommitted dropdown + filter icons */}
|
||
<div className="flex items-center justify-between h-9 border-b border-mock-border flex-shrink-0">
|
||
<div className="flex items-center gap-1 ml-2 px-1 h-6 rounded">
|
||
<span className="text-[11px] text-mock-fg-muted">Uncommitted</span>
|
||
<ChevronDown size={11} className="text-mock-fg-muted" />
|
||
</div>
|
||
<div className="flex items-center pr-2">
|
||
<div className="flex items-center justify-center w-6 h-6 rounded">
|
||
<ListChevronsUpDown size={14} className="text-mock-fg-muted" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{/* File header — expanded */}
|
||
<div className="flex items-center justify-between pl-2 pr-2 py-1.5 border-b border-mock-border flex-shrink-0">
|
||
<div className="flex items-center gap-1 flex-1 min-w-0 overflow-hidden">
|
||
<ChevronDown size={10} className="text-mock-fg-muted flex-shrink-0" />
|
||
<span className="text-[11px] text-mock-fg flex-shrink-0">dashboard.tsx</span>
|
||
<span className="text-[11px] text-mock-fg-muted truncate min-w-0"> src/pages</span>
|
||
<span
|
||
className="text-[10px] text-mock-green-400 px-2 py-[2px] rounded-md flex-shrink-0"
|
||
style={NEW_BADGE_STYLE}
|
||
>
|
||
New
|
||
</span>
|
||
</div>
|
||
<div className="flex items-center gap-1 flex-shrink-0 ml-1">
|
||
<span className="text-[11px] text-mock-green-400">+16</span>
|
||
<span className="text-[11px] text-mock-red">-0</span>
|
||
</div>
|
||
</div>
|
||
|
||
{/* Diff lines */}
|
||
<div className="overflow-hidden bg-mock-surface1">
|
||
{DIFF_LINES.map((line) => (
|
||
<DiffLineRow key={`${line.type}-${line.ln ?? "blank"}`} line={line} />
|
||
))}
|
||
</div>
|
||
|
||
{/* Collapsed file rows */}
|
||
{[
|
||
{ name: "return-table.tsx", dir: "src/components", added: 42, removed: 8 },
|
||
{ name: "filter-bar.tsx", dir: "src/components", added: 28, removed: 3 },
|
||
{ name: "status-chart.tsx", dir: "src/components", added: 19, removed: 0, isNew: true },
|
||
{ name: "returns.ts", dir: "src/api", added: 12, removed: 5 },
|
||
{ name: "index.tsx", dir: "src/pages", added: 6, removed: 2 },
|
||
].map((file) => (
|
||
<div
|
||
key={file.name}
|
||
className="flex items-center justify-between pl-2 pr-2 py-1.5 border-b border-mock-border"
|
||
>
|
||
<div className="flex items-center gap-1 flex-1 min-w-0 overflow-hidden">
|
||
<ChevronRight size={10} className="text-mock-fg-muted flex-shrink-0" />
|
||
<span className="text-[11px] text-mock-fg flex-shrink-0">{file.name}</span>
|
||
<span className="text-[11px] text-mock-fg-muted truncate min-w-0"> {file.dir}</span>
|
||
{file.isNew && (
|
||
<span
|
||
className="text-[10px] text-mock-green-400 px-2 py-[2px] rounded-md flex-shrink-0"
|
||
style={NEW_BADGE_STYLE}
|
||
>
|
||
New
|
||
</span>
|
||
)}
|
||
</div>
|
||
<div className="flex items-center gap-1 flex-shrink-0 ml-1">
|
||
<span className="text-[11px] text-mock-green-400">+{file.added}</span>
|
||
<span className="text-[11px] text-mock-red">-{file.removed}</span>
|
||
</div>
|
||
</div>
|
||
))}
|
||
|
||
<div className="flex-1" />
|
||
</div>
|
||
);
|
||
}
|
||
|
||
// Snake traversal order matching the real app: [0, 1, 3, 5, 4, 2] (2-col × 3-row grid)
|
||
// DOT_SEQUENCE[sequenceIndex] = dotIndex, so sequenceIndex = indexOf(dotIndex)
|
||
const DOT_SEQUENCE = [0, 1, 3, 5, 4, 2] as const;
|
||
const SYNCED_LOADER_DURATION_MS = 950;
|
||
const DOT_COUNT = 6;
|
||
const DOT_INDICES = Array.from({ length: DOT_COUNT }, (_, i) => i);
|
||
const STEP_MS = SYNCED_LOADER_DURATION_MS / DOT_COUNT; // 158.333…ms per step
|
||
|
||
interface SyncedLoaderDotProps {
|
||
dotIndex: number;
|
||
dotSize: number;
|
||
gap: number;
|
||
}
|
||
|
||
function SyncedLoaderDot({ dotIndex, dotSize, gap }: SyncedLoaderDotProps) {
|
||
const col = dotIndex % 2;
|
||
const row = Math.floor(dotIndex / 2);
|
||
const sequenceIndex = DOT_SEQUENCE.indexOf(dotIndex as (typeof DOT_SEQUENCE)[number]);
|
||
const delayMs = -(sequenceIndex * STEP_MS);
|
||
const style = React.useMemo(
|
||
() => ({
|
||
position: "absolute" as const,
|
||
left: col * (dotSize + gap),
|
||
top: row * (dotSize + gap),
|
||
width: dotSize,
|
||
height: dotSize,
|
||
borderRadius: "50%",
|
||
backgroundColor: "#f59e0b",
|
||
animationName: "synced-snake-dot",
|
||
animationDuration: `${SYNCED_LOADER_DURATION_MS}ms`,
|
||
animationTimingFunction: "linear",
|
||
animationIterationCount: "infinite",
|
||
animationDelay: `${delayMs}ms`,
|
||
}),
|
||
[col, row, dotSize, gap, delayMs],
|
||
);
|
||
return <div style={style} />;
|
||
}
|
||
|
||
function SyncedLoader({ size = 11 }: { size?: number }) {
|
||
const gap = Math.max(1, Math.round(size * 0.12));
|
||
const dotSize = Math.max(2, Math.floor((size - gap * 2) / 3));
|
||
const gridW = dotSize * 2 + gap;
|
||
const gridH = dotSize * 3 + gap * 2;
|
||
|
||
const outerStyle = React.useMemo(
|
||
() => ({
|
||
width: size,
|
||
height: size,
|
||
display: "flex",
|
||
alignItems: "center",
|
||
justifyContent: "center",
|
||
flexShrink: 0,
|
||
}),
|
||
[size],
|
||
);
|
||
|
||
const innerStyle = React.useMemo(
|
||
() => ({ position: "relative" as const, width: gridW, height: gridH }),
|
||
[gridW, gridH],
|
||
);
|
||
|
||
return (
|
||
<div style={outerStyle}>
|
||
<div style={innerStyle}>
|
||
{DOT_INDICES.map((dotIndex) => (
|
||
<SyncedLoaderDot
|
||
key={`dot-${dotIndex}`}
|
||
dotIndex={dotIndex}
|
||
dotSize={dotSize}
|
||
gap={gap}
|
||
/>
|
||
))}
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function WorkspaceStatusDot({ status }: { status: SidebarWorkspace["status"] }) {
|
||
if (status === "running") return <div className="w-[5px] h-[5px] rounded-full bg-mock-amber" />;
|
||
if (status === "done") return <div className="w-[5px] h-[5px] rounded-full bg-mock-green" />;
|
||
return null;
|
||
}
|
||
|
||
function Sidebar() {
|
||
// Shared left edge: pl-3 (12px) for traffic lights, icons, footer dot
|
||
// Workspace indent: pl-7 (28px)
|
||
// PR badge aligns with workspace text: pl-[42px]
|
||
return (
|
||
<div className="flex flex-col bg-mock-sidebar border-r border-mock-border w-[200px] flex-shrink-0">
|
||
{/* Traffic lights */}
|
||
<div className="flex items-center pl-3 pr-2 pt-3 pb-2">
|
||
<TrafficLights />
|
||
</div>
|
||
|
||
{/* Sessions header */}
|
||
<div className="flex items-center gap-2 pl-3 pr-2 py-2 border-b border-mock-border">
|
||
<MessagesSquare size={16} className="text-mock-fg-muted flex-shrink-0" />
|
||
<span className="text-sm text-mock-fg-muted">Sessions</span>
|
||
</div>
|
||
|
||
{/* Project list */}
|
||
<div className="flex-1 overflow-hidden pt-1 pb-4 min-h-0">
|
||
{SIDEBAR_PROJECTS.map((project) => (
|
||
<div key={project.name} className="mb-2">
|
||
{/* Project row — icon aligns with traffic lights / sessions */}
|
||
<div className="flex items-center gap-2 min-h-[32px] py-1.5 pl-3 pr-2">
|
||
<div className="w-4 h-4 rounded-sm border border-mock-border flex items-center justify-center flex-shrink-0">
|
||
<span className="text-[9px] text-mock-fg-muted leading-none">
|
||
{project.initial}
|
||
</span>
|
||
</div>
|
||
<span className="text-[13px] text-mock-fg font-normal truncate flex-1 min-w-0 leading-5">
|
||
{project.name}
|
||
</span>
|
||
</div>
|
||
|
||
{/* Workspace rows — indented one level */}
|
||
{project.workspaces.map((workspace) => (
|
||
<SidebarWorkspaceRow key={workspace.name} workspace={workspace} />
|
||
))}
|
||
</div>
|
||
))}
|
||
</div>
|
||
|
||
{/* Footer — dot aligns with traffic lights / icons */}
|
||
<div className="flex items-center justify-between pl-3 pr-2 py-3 border-t border-mock-border">
|
||
<div className="flex items-center gap-2 min-w-0 flex-shrink">
|
||
<div className="w-2 h-2 rounded-full bg-mock-green flex-shrink-0" />
|
||
<span className="text-[13px] text-mock-fg-muted truncate">MacBook Pro</span>
|
||
</div>
|
||
<div className="flex items-center gap-1 flex-shrink-0">
|
||
<div className="w-6 h-6 flex items-center justify-center">
|
||
<Plus size={18} className="text-mock-fg-muted" />
|
||
</div>
|
||
<div className="w-6 h-6 flex items-center justify-center">
|
||
<Settings size={18} className="text-mock-fg-muted" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
const TERMINAL_TABS: TabDef[] = [
|
||
{ name: "npm run dev", provider: "terminal", done: false, active: true },
|
||
];
|
||
|
||
function TitleBarLeft() {
|
||
return (
|
||
<div className="flex items-center gap-2 flex-1 min-w-0">
|
||
<div className="px-2 py-1 rounded-lg flex items-center justify-center flex-shrink-0">
|
||
<PanelLeft size={14} className="text-mock-fg-muted" />
|
||
</div>
|
||
<div className="flex items-center gap-2 min-w-0 flex-1">
|
||
<span className="text-[13px] font-light text-mock-fg truncate flex-shrink-0">main</span>
|
||
<span className="text-[13px] text-mock-fg-muted truncate flex-shrink min-w-0">
|
||
acme/returns-app
|
||
</span>
|
||
<div className="px-2 py-1 rounded-lg flex items-center justify-center flex-shrink-0">
|
||
<Ellipsis size={14} className="text-mock-fg-muted" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function TitleBarRight() {
|
||
return (
|
||
<div className="flex items-center gap-2 ml-auto flex-shrink-0">
|
||
<div className="flex items-stretch rounded-md border border-mock-border-accent overflow-hidden">
|
||
<div className="flex items-center gap-2 px-3 py-1">
|
||
<GitCommitHorizontal size={12} className="text-mock-fg-muted flex-shrink-0" />
|
||
<span className="text-[11px] text-mock-fg font-normal">Commit</span>
|
||
</div>
|
||
<div className="flex items-center justify-center w-7 border-l border-mock-border-accent">
|
||
<ChevronDown size={12} className="text-mock-fg-muted" />
|
||
</div>
|
||
</div>
|
||
<div className="flex items-center gap-2 px-3 py-1 rounded-md">
|
||
<SourceControlIcon size={14} className="text-mock-fg-muted" />
|
||
<span className="text-[11px] font-normal text-mock-green-400">+247</span>
|
||
<span className="text-[11px] font-normal text-mock-red">-15</span>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function DesktopSplitPanes() {
|
||
return (
|
||
<div className="flex flex-1 min-h-0">
|
||
{/* Left pane: all agent tabs + chat */}
|
||
<div className="flex flex-col flex-1 min-w-0 min-h-0">
|
||
<motion.div {...fade(D.tabs)}>
|
||
<PaneTabBar tabs={TABS} focused />
|
||
</motion.div>
|
||
<motion.div {...fade(D.chat)} className="flex-1 flex min-h-0">
|
||
<ChatArea />
|
||
</motion.div>
|
||
</div>
|
||
|
||
{/* Resize handle */}
|
||
<div className="w-px bg-mock-border flex-shrink-0" />
|
||
|
||
{/* Right pane: terminal only */}
|
||
<motion.div {...fade(D.chat)} className="flex flex-col flex-1 min-w-0 min-h-0">
|
||
<PaneTabBar tabs={TERMINAL_TABS} />
|
||
<TerminalPane />
|
||
</motion.div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
// ── Desktop Mockup ──────────────────────────────────────
|
||
|
||
function DesktopMockup() {
|
||
const containerRef = React.useRef<HTMLDivElement>(null);
|
||
const [scale, setScale] = React.useState(1);
|
||
|
||
React.useEffect(() => {
|
||
function updateScale() {
|
||
if (!containerRef.current) return;
|
||
const parentWidth = containerRef.current.parentElement?.clientWidth ?? 1200;
|
||
const designWidth = 1200;
|
||
setScale(Math.min(1, parentWidth / designWidth));
|
||
}
|
||
updateScale();
|
||
window.addEventListener("resize", updateScale);
|
||
return () => window.removeEventListener("resize", updateScale);
|
||
}, []);
|
||
|
||
const containerStyle = React.useMemo(() => ({ height: `${1200 * (9 / 16) * scale}px` }), [scale]);
|
||
const innerStyle = React.useMemo(() => ({ width: 1200, transform: `scale(${scale})` }), [scale]);
|
||
|
||
return (
|
||
<div ref={containerRef} className="w-full overflow-hidden" style={containerStyle}>
|
||
<div
|
||
className="mx-auto rounded-xl overflow-hidden border border-mock-border bg-mock-surface0 shadow-[6px_6px_0_rgba(0,0,0,0.4)] origin-top-left"
|
||
style={innerStyle}
|
||
>
|
||
{/* Top-level: left sidebar | center column | explorer sidebar — all full height */}
|
||
<div className="flex aspect-video">
|
||
{/* Left sidebar — full height */}
|
||
<motion.div {...fade(D.sidebar)} className="contents">
|
||
<Sidebar />
|
||
</motion.div>
|
||
|
||
{/* Center column: title bar + split panes */}
|
||
<div className="flex flex-col flex-1 min-w-0 min-h-0">
|
||
{/* Title bar — belongs to center column only */}
|
||
<motion.div
|
||
{...fade(D.titleBar)}
|
||
className="flex items-center h-10 px-2 bg-mock-surface0 border-b border-mock-border flex-shrink-0"
|
||
>
|
||
<TitleBarLeft />
|
||
<TitleBarRight />
|
||
</motion.div>
|
||
|
||
<DesktopSplitPanes />
|
||
</div>
|
||
|
||
{/* Explorer sidebar — full height, pushes center column */}
|
||
<motion.div {...fade(D.diffPanel)} className="contents">
|
||
<ExplorerSidebar />
|
||
</motion.div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
// ── Export ───────────────────────────────────────────────
|
||
|
||
export function HeroMockup() {
|
||
return <DesktopMockup />;
|
||
}
|