Open Claude UI
中文
AI Chat Interface Components

Claude Desktop UI: Architecture & Interaction Hooks

Claude Desktop-style Electron UI in React: draggable title bar, session reordering, Cowork board, scroll pinning, roving focus, rate-limit backoff. 7 demos.

中文版Last updated:

Desktop architecture and interaction hooks covers what is specific to Claude Desktop as an Electron app: the draggable window title bar, session list reordering, the multi-agent (Cowork) collaboration board, and a few React hooks for scroll following, roving focus, shared-element transitions and rate-limit backoff. The 7 demos on this page correspond to Chapter 6 of the v1 handbook. This page is a translation of the Chinese demo page.

Key values

ItemValueSource
macOS traffic-light inset74pxv1/06 §6.1
Title bar drag strip45pxv1/06 §6.1
Drag thresholdmovement within 4px does not count as a dragv1/06 §6.2
Agent task statesidle → running → waiting_review → completed / erroredv1/06 §6.3
Rate-limit backoff5-second base, doubling exponentially, capped at 10 minutesv1/06 §6.7

Desktop title bar

The left side of the title bar leaves room for the macOS traffic lights. Empty space drags the window; button areas do not respond to dragging.

新会话
macOS 下左侧留 74px 给红绿灯(按缩放反向补偿),45px 拖拽带;交互元素加 .draggable-none。网页里只演示布局。出处:v1/06 §6.1 · code-examples/ClaudeDesktopHeader.tsx

Session list drag reordering

Pinned conversations can be reordered by dragging, or moved up and down with the keyboard.

置顶区可拖拽重排(指针移动 4px 内不算拖拽);拖动时有幽灵投影与插入线;可用键盘上移 / 下移。出处:v1/06 §6.2 · v2/03 §3.1 · code-examples/DraggableSessionList.tsx

Multi-agent collaboration board

The Cowork board shows the status of several agents' subtasks and their shared artifacts.

Claude Cowork 多智能体协同空间
多 Agent 并发任务分派、实时状态拓扑与共享工件网格
4 个活动 Agent
协作团队成员
系统架构师● 运行中
Lead Architect
编排并分发前端工程拓扑任务
分析取证专家● 运行中
Reverse Engineer
提取 /Applications/Claude.app 生产混淆源码
CDS 组件开发工程师○ 空闲
Design System Engineer
等待新的组件规范任务
质量验收专家△ 待复核
Verification Agent
等待人工确认 Git commit 与 push 结果
当前活跃委派任务 (Task Delegation)已达成 8 个里程碑
编排并分发前端工程拓扑任务
团队共享产物 (Artifacts Pool)共 4 个产物
docv2.4
Claude Design System (CDS).md
更新于 刚刚查看预览 ↗
codev1.0
RichComposerWithMentions.tsx
更新于 5分钟前查看预览 ↗
codev1.0
DraggableSessionList.tsx
更新于 8分钟前查看预览 ↗
audiov1.2
AudioSinkWorklet.js
更新于 20分钟前查看预览 ↗
多代理看板:子任务委派状态机(idle → running → waiting_review → completed / errored)与共享产物网格。代理头像换成 lucide 图标。出处:v1/06 §6.3 · code-examples/CoworkAgentCanvas.tsx

Scroll following for streamed output

When you are at the bottom, the view follows the streamed output automatically; scroll up and it stops following.

开始输出…
在底部时自动跟随新内容;向上滚动后停止跟随并出现“回到底部”按钮。出处:v1/06 §6.4 · code-examples/useClaudeScrollPinning.ts

Roving focus

Only one element in the list is reachable with Tab; the arrow keys move between items.

漫游焦点:整个工具栏只占一个 Tab 位,用 ← → / Home / End 移动。当前索引 0。出处:v1/06 §6.6 · code-examples/useClaudeRovingFocus.ts

Shared-element transition

The View Transitions API smoothly enlarges a thumbnail into a preview.

View Transitions API 共享元素变形:缩略图放大成预览,圆角和 object-fit 一起过渡;浏览器不支持时直接切换。出处:v1/05 §5.2.2 · v2/02 §2.5.2 · code-examples/useClaudeSharedElementTransition.ts

Rate-limit backoff

When rate-limited, it waits with exponential backoff and retries automatically when the countdown ends.

空闲 · 自动重试 0 次
限流退避:基准 5 秒、连续触发指数翻倍、封顶 10 分钟;倒计时结束自动重试。出处:v1/06 §6.7 · code-examples/useRateLimitBackoff.ts

How do I use these components in a project?

Copy the matching file from code-examples/ and import cds-theme.css. For example:

import { useClaudeScrollPinning } from './useClaudeScrollPinning';

const { containerRef, isPinned, showJumpControl, handleScroll, scrollToBottom } = useClaudeScrollPinning([messages]);

Note: some labels inside the demo components are still in Chinese (they come straight from the repository's components); the behavior and specs are the same.

Sources

The specs on this page come from Chapter 6 of the v1 handbook, the component and hook code comes from the repository's code-examples/, and platform behavior follows the Electron, MDN and W3C documentation.

Once an intentional upward scroll is detected, auto-scrolling is locked out for 150ms, permanently eliminating "scroll viewport hijacking".

— open-claude-ui README · 150ms Scroll Pinning Cooldown Latch & 40px Tolerance

On this page