最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Claude Code 對(duì)話框/彈窗 UI 樣式匯總小結(jié)

  發(fā)布時(shí)間:2026-06-04 10:48:30   作者:解決問(wèn)題   我要評(píng)論
本文主要介紹了Claude Code 對(duì)話框/彈窗 UI 樣式匯總,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

會(huì)話過(guò)程中,所有對(duì)話框由 focusedInputDialog 控制,按優(yōu)先級(jí)依次彈出。以下是完整列表。

一、權(quán)限類對(duì)話框

1. 工具權(quán)限確認(rèn) (tool-permission)

觸發(fā)時(shí)機(jī): 工具(Bash、Write、Read 等)需要用戶批準(zhǔn)時(shí)

UI 描述:

根據(jù)工具類型分發(fā)到不同的權(quán)限子組件:

  • BashPermissionRequest — 顯示待執(zhí)行的 shell 命令、工作目錄、以 $ 開(kāi)頭的命令預(yù)覽
  • FileEditPermissionRequest — 顯示文件路徑、diff 變更內(nèi)容(+11/-22 顏色標(biāo)記)
  • WebFetchPermissionRequest — 顯示目標(biāo) URL

通用結(jié)構(gòu):

  • 覆蓋層(Overlay),阻止主交互
  • 工具名稱標(biāo)簽
  • 操作描述/預(yù)覽區(qū)域
  • 底部分配 <Select> 選項(xiàng):"Allow"、"Allow and don't ask again"、"Deny"
  • Escape 拒絕、Enter 確認(rèn)

組件: PermissionRequest.tsx → 分發(fā)到 BashPermissionRequest / FileEditPermissionRequest

2. Sandbox 網(wǎng)絡(luò)權(quán)限 (sandbox-permission)

觸發(fā)時(shí)機(jī): 工具(WebFetch 等)請(qǐng)求訪問(wèn)外部網(wǎng)絡(luò)時(shí)

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  Network request outside of sandbox                              │
│                                                                  │
│  Host: api.example.com                                           │ (dim)
│                                                                  │
│  Do you want to allow this connection?                           │
│                                                                  │
│  > Yes                                                           │
│    Yes, and don't ask again for api.example.com                  │
│    No, and tell Claude what to do differently (esc)              │
└──────────────────────────────────────────────────────────────────┘
  • 包裹在 <PermissionDialog>
  • 主機(jī)名以 dim 顏色顯示
  • 選項(xiàng):Allow / Allow + 記住 / Deny + 引導(dǎo)

組件: SandboxPermissionRequest.tsx

3. Worker Sandbox 權(quán)限 (worker-sandbox-permission)

觸發(fā)時(shí)機(jī): Swarm worker 子代理請(qǐng)求網(wǎng)絡(luò)訪問(wèn),等待 leader 審批

UI 描述:sandbox-permission 結(jié)構(gòu)相同,但通過(guò) mailbox 協(xié)議跨進(jìn)程響應(yīng)。選項(xiàng)通過(guò) sendSandboxPermissionResponseViaMailbox 發(fā)送回 worker。

組件: SandboxPermissionRequest.tsx(同一組件)

4. Worker 等待中指示器 (非阻塞)

觸發(fā)時(shí)機(jī): Sub-agent 正在等待 leader 批準(zhǔn)權(quán)限時(shí)顯示

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  ? Waiting for team lead approval                                │ (warning, bold)
│  ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │
│  Tool: WebFetchTool                                              │ (dim)
│  Action: Fetch https://api.example.com/data                      │ (dim)
│  Permission request sent to team "my-team" leader                │
└──────────────────────────────────────────────────────────────────┘
  • 圓角邊框 (borderStyle="round", borderColor="warning")
  • 頂部 Spinner + 警告顏色粗體文字
  • WorkerBadge(代理名稱 + 顏色)

組件: WorkerPendingPermission.tsx

二、交互輸入類對(duì)話框

5. Hook Prompt 對(duì)話框 (prompt)

觸發(fā)時(shí)機(jī): Hook 返回 type: "prompt" 需要用戶選擇

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  [title]                                              [info]    │
│                                                                  │
│  Request message here...                                         │
│                                        [tool summary]            │ (dim)
│                                                                  │
│  > Option 1                                                      │
│    Option 2                                                      │
│    Option 3                                                      │
└──────────────────────────────────────────────────────────────────┘
  • 包裹在 <PermissionDialog>
  • 標(biāo)題 + 副標(biāo)題(請(qǐng)求消息)
  • 右側(cè)可選的 toolInputSummary(dim 顏色)
  • <Select> 選項(xiàng)列表,映射自 hook 返回的 request.options
  • 支持 app:interrupt 快捷鍵中止

組件: PromptDialog.tsx

6. MCP Elicitation 對(duì)話框 (elicitation)

觸發(fā)時(shí)機(jī): MCP 服務(wù)器請(qǐng)求用戶輸入(表單、URL 確認(rèn)、等待完成)

UI 描述: 三種模式:

表單模式:

┌──────────────────────────────────────────────────────────────────┐
│  MCP server "serverName" requests your input                     │
│                                                                  │
│  ┌──────────────────────────────────────────────────────────┐    │
│  │  Text input field...                                     │    │
│  └──────────────────────────────────────────────────────────┘    │
│  ○ Option A    ○ Option B    ○ Option C                         │
│  ? Checkbox option                                              │
│                                                                  │
│  [Accept]    [Decline]                                           │
└──────────────────────────────────────────────────────────────────┘
  • 動(dòng)態(tài)表單字段:文本輸入、單選/多選枚舉、布爾值、日期/時(shí)間選擇器
  • 驗(yàn)證錯(cuò)誤信息
  • 內(nèi)聯(lián)快捷鍵提示

等待模式: 域名 + Spinner + "Reload / Open in Browser / Close"

URL 確認(rèn): "MCP server wants to open a URL" + Accept/Decline

組件: ElicitationDialog.tsx(~1169 行,大型表單引擎)

三、會(huì)話管理類對(duì)話框

7. 成本閾值對(duì)話框 (cost)

觸發(fā)時(shí)機(jī): 當(dāng)前會(huì)話 API 費(fèi)用達(dá)到閾值時(shí)

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  You've spent $5 on the Anthropic API this session.              │
│                                                                  │
│  Learn more about how to monitor your spending:                  │
│  code.claude.com/docs/en/costs                                   │ (link)
│                                                                  │
│  > Got it, thanks!                                               │
└──────────────────────────────────────────────────────────────────┘
  • 包裹在 <Dialog>
  • 顯示當(dāng)前會(huì)話消費(fèi)金額
  • 提供費(fèi)用監(jiān)控文檔鏈接
  • 單一確認(rèn)選項(xiàng),確認(rèn)后設(shè)置 hasAcknowledgedCostThreshold: true

組件: CostThresholdDialog.tsx

8. 閑置返回對(duì)話框 (idle-return)

觸發(fā)時(shí)機(jī): 用戶長(zhǎng)時(shí)間離開(kāi)后返回時(shí)

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  You've been away 25m and this conversation is 45K tokens.       │
│                                                                  │
│  If this is a new task, clearing context will save usage and     │
│  be faster.                                                      │
│                                                                  │
│  > Continue this conversation                                    │
│    Send message as a new conversation                            │
│    Don't ask me again                                            │
└──────────────────────────────────────────────────────────────────┘
  • 包裹在 <Dialog>
  • 顯示離開(kāi)時(shí)長(zhǎng) + 當(dāng)前 token 數(shù)
  • 三選一:繼續(xù) / 清空后發(fā)送 / 不再提示

組件: IdleReturnDialog.tsx

四、新功能引導(dǎo)類對(duì)話框

9. IDE 集成引導(dǎo) (ide-onboarding)

觸發(fā)時(shí)機(jī): 首次檢測(cè)到 IDE 擴(kuò)展時(shí)

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  ? Welcome to Claude Code for Visual Studio Code                 │
│                                                                  │
│  installed extension v1.2.3                                      │ (dim)
│                                                                  │
│  ? Claude has context about your open files and selected lines   │
│  ? View code diffs in your IDE       +11 / -22                   │ (diff colors)
│  ? Cmd+Esc to quickly launch                                     │
│  ? Cmd+Option+K to send selection                                │
│                                                                  │
│  Press Enter to continue                                         │
└──────────────────────────────────────────────────────────────────┘
  • <Dialog> 顏色 theme "ide"
  • 項(xiàng)目符號(hào)列表介紹 IDE 集成功能
  • 差異標(biāo)記顏色展示 diff 指示
  • Enter/Escape 關(guān)閉

組件: IdeOnboardingDialog.tsx

10. Effort 選擇引導(dǎo) (effort-callout)

觸發(fā)時(shí)機(jī): 首次使用 Opus 模型時(shí)(新功能引導(dǎo))

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  Choose your effort level                                        │
│                                                                  │
│  Description text explaining what effort level means...          │
│                                                                  │
│  low · medium · high                                             │ (effort indicators)
│                                                                  │
│  > ● Medium (recommended)                                        │
│    ●●● High                                                      │
│    ○ Low                                                         │
└──────────────────────────────────────────────────────────────────┘
  • 包裹在 <PermissionDialog>
  • 30 秒自動(dòng)消失計(jì)時(shí)器
  • 三級(jí) effort 選擇

組件: EffortCallout.tsx

11. 遠(yuǎn)程控制引導(dǎo) (remote-callout)

觸發(fā)時(shí)機(jī): 首次啟用 Bridge/遠(yuǎn)程控制時(shí)

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  Remote Control                                                  │
│                                                                  │
│  Description text explaining how remote control works...         │
│  Your CLI session can be accessed from the web or other apps.    │
│                                                                  │
│  > Enable Remote Control for this session                        │
│    Never mind                                                    │
└──────────────────────────────────────────────────────────────────┘
  • 包裹在 <PermissionDialog>
  • 僅顯示一次(選擇自動(dòng)持久化)

組件: RemoteCallout.tsx

12. Ultraplan 選擇對(duì)話框 (ultraplan-choice)

觸發(fā)時(shí)機(jī): 生成執(zhí)行計(jì)劃后,詢問(wèn)用戶是否繼續(xù)

UI 描述: 顯示遠(yuǎn)程執(zhí)行計(jì)劃內(nèi)容供用戶審查/批準(zhǔn)。內(nèi)置獨(dú)立滾動(dòng)(不與主 ScrollBox 聯(lián)動(dòng))。接收 plansessionId、taskId 等回調(diào)。

組件: UltraplanChoiceDialog(非獨(dú)立組件文件,REPL.tsx 內(nèi)聯(lián)使用)

13. Ultraplan 啟動(dòng)對(duì)話框 (ultraplan-launch)

觸發(fā)時(shí)機(jī): 用戶確認(rèn)后,啟動(dòng) Ultraplan 遠(yuǎn)程執(zhí)行前

UI 描述: 觸發(fā) ultraplan 命令,回聲顯示公告行,傳遞斷開(kāi)連接橋接選項(xiàng),遠(yuǎn)程會(huì)話就緒時(shí)附加狀態(tài)更新。

組件: UltraplanLaunchDialog(非獨(dú)立組件文件,REPL.tsx 內(nèi)聯(lián)使用)

五、推薦/推廣類對(duì)話框

14. LSP 插件推薦 (lsp-recommendation)

觸發(fā)時(shí)機(jī): 檢測(cè)到未安裝 LSP 的文件類型時(shí)

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  LSP Plugin Recommendation                                       │
│                                                                  │
│  LSP provides code intelligence like go-to-definition and error  │
│  checking.                                                       │
│                                                                  │
│  Plugin: @anthropic/lsp-rust                                     │ (dim)
│  Triggered by: .rs files                                         │ (dim)
│                                                                  │
│  Would you like to install this LSP plugin?                      │
│                                                                  │
│  > Yes, install @anthropic/lsp-rust                               │ (bold)
│    No, not now                                                   │
│    Never for @anthropic/lsp-rust                                  │
│    Disable all LSP recommendations                               │
└──────────────────────────────────────────────────────────────────┘
  • 包裹在 <PermissionDialog>
  • 30 秒自動(dòng)消失(視為拒絕)

組件: LspRecommendationMenu.tsx

15. 插件提示 (plugin-hint)

觸發(fā)時(shí)機(jī): 外部命令建議安裝插件時(shí)

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  Plugin Recommendation                                           │
│                                                                  │
│  The "my-command" command suggests installing a plugin.          │
│                                                                  │
│  Plugin: my-plugin                                               │ (dim)
│  Marketplace: official                                           │ (dim)
│                                                                  │
│  Would you like to install it?                                   │
│                                                                  │
│  > Yes, install my-plugin                                        │
│    No                                                            │
│    No, and don't show plugin installation hints again            │
└──────────────────────────────────────────────────────────────────┘
  • 包裹在 <PermissionDialog>
  • 30 秒自動(dòng)消失

組件: PluginHintMenu.tsx

16. Desktop 升級(jí)引導(dǎo) (desktop-upsell)

觸發(fā)時(shí)機(jī): 最多 3 次啟動(dòng)時(shí)提示升級(jí)到桌面版

UI 描述:

┌──────────────────────────────────────────────────────────────────┐
│  Try Claude Code Desktop                                         │
│                                                                  │
│  Same Claude Code with visual diffs, live app preview, parallel  │
│  sessions, and more.                                             │
│                                                                  │
│  > Open in Claude Code Desktop                                   │
│    Not now                                                       │
│    Don't ask again                                               │
└──────────────────────────────────────────────────────────────────┘
  • 包裹在 <PermissionDialog>
  • 選擇 "Open in Desktop" 后切換到 <DesktopHandoff> 子組件

組件: DesktopUpsellStartup.tsx

六、消息操作類

17. 消息選擇器 / Rewind (message-selector)

觸發(fā)時(shí)機(jī): 用戶按 Ctrl+O 或選擇回退消息時(shí)

UI 描述:

─── Rewind ──────────────────────────────────────────────────────────  (color: suggestion)

  > #1  "Add error handling to the login flow"       +5 / -2  (file changes)
    #2  "Fix the bug in user authentication"          +3 / -1
    #3  "Refactor the database schema"                 (no changes)
                                                      (code rollback warning)
    Restore code and conversation
    Restore conversation
    Summarize from here: [____________________________]
    Never mind
──────────────────────────────────────────────────────────────────────
  • 非對(duì)話框包裝器,內(nèi)聯(lián)選擇器
  • 標(biāo)題 "Rewind"(color="suggestion"
  • 每個(gè)用戶消息顯示文件變更統(tǒng)計(jì)
  • 代碼回滾警告
  • 底部恢復(fù)/摘要選項(xiàng)
  • 確認(rèn)模式顯示差異統(tǒng)計(jì)

組件: MessageSelector.tsx

七、Ant 內(nèi)部版(外部構(gòu)建不可見(jiàn))

18. 模型切換引導(dǎo) (model-switch)

條件編譯: "external" === 'ant' 時(shí)存在

  • 提示用戶切換模型
  • onDone(selection, modelAlias?) 回調(diào)可用于切換 mainLoopModel

組件: AntModelSwitchCallout

19. Undercover 模式引導(dǎo) (undercover-callout)

條件編譯: "external" === 'ant' 時(shí)存在

  • 解釋 Undercover 自動(dòng)啟用
  • 簡(jiǎn)單解除回調(diào)

組件: UndercoverAutoCallout

優(yōu)先級(jí)總結(jié)

對(duì)話框按以下優(yōu)先級(jí)彈出(高→低):

優(yōu)先級(jí)對(duì)話框條件
?? 最高message-selector用戶主動(dòng)打開(kāi)
1sandbox-permission網(wǎng)絡(luò)權(quán)限請(qǐng)求
2tool-permission工具權(quán)限請(qǐng)求
3promptHook prompt 交互
4worker-sandbox-permissionWorker 網(wǎng)絡(luò)權(quán)限
5elicitationMCP 表單輸入
6cost費(fèi)用閾值提示
7idle-return閑置返回
8ultraplan-choiceUltraplan 計(jì)劃選擇
9ultraplan-launchUltraplan 啟動(dòng)
10ide-onboardingIDE 引導(dǎo)
11model-switch模型切換(ant-only)
12undercover-calloutUndercover 引導(dǎo)(ant-only)
13effort-calloutEffort 選擇引導(dǎo)
14remote-callout遠(yuǎn)程控制引導(dǎo)
15lsp-recommendationLSP 插件推薦
16plugin-hint插件建議
?? 最低desktop-upsell桌面版推廣

用戶輸入時(shí)高優(yōu)先級(jí)對(duì)話框會(huì)暫緩彈出(hasSuppressedDialogs),輸入完成后恢復(fù)。

到此這篇關(guān)于Claude Code 對(duì)話框/彈窗 UI 樣式匯總小結(jié)的文章就介紹到這了,更多相關(guān)Claude Code 對(duì)話框/彈窗 內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!

相關(guān)文章

  • Claude Code Hooks 類型與使用指南

    本文總結(jié) Claude Code / 本倉(cāng)庫(kù)恢復(fù)版 claude-code 中 hooks 的類型、觸發(fā)時(shí)機(jī)、典型使用場(chǎng)景、配置方式與注意事項(xiàng), 下面就來(lái)詳細(xì)的介紹一下,感興趣的可以了解
    2026-06-04
  • Claude Code中生命周期Hooks的使用指南介紹

    Hooks 是用戶自定義的腳本/命令,在 Claude Code 的特定生命周期節(jié)點(diǎn)自動(dòng)執(zhí)行,支持 4 種類型、4 個(gè)生命周期事件,下面小編就和大家詳細(xì)介紹一下Hook這四種類型的具體使用吧
    2026-06-04
  • 一文總結(jié)Claude Code開(kāi)發(fā)中的常見(jiàn)問(wèn)題與解決方案

    Claude Code 作為 Anthropic 推出的 AI 編程助手,在提升開(kāi)發(fā)效率的同時(shí),也會(huì)在安裝、配置、使用等多個(gè)環(huán)節(jié)遇到各類問(wèn)題,本文整理了用戶在使用過(guò)程中最常碰到的問(wèn)題,按類
    2026-06-04
  • Claude Code安裝與MiniMax的配置指南

    這篇文章記錄如何在 Windows 上安裝 Claude Code,并配置 MiniMax 的 Claude Code 兼容接口,以后自己重裝,或者委托具備本機(jī)終端與文件操作能力的 AI Agent 代為部署時(shí),可
    2026-06-03
  • 使用Claude Code高效實(shí)現(xiàn)圖像邊緣檢測(cè)的實(shí)踐指南

    邊緣檢測(cè)是計(jì)算機(jī)視覺(jué)領(lǐng)域最基礎(chǔ)也最實(shí)用的技術(shù)之一,從人臉識(shí)別、自動(dòng)駕駛的車道線檢測(cè),到工業(yè)產(chǎn)品的缺陷識(shí)別,邊緣檢測(cè)都是核心預(yù)處理環(huán)節(jié),本文將分享我使用 Python + Op
    2026-06-03
  • Claude Code中斜杠命令的使用教程,效率翻10倍!

    其實(shí) Claude Code 內(nèi)置了很多斜杠命令,輸入/就能看到完整的命令列表,這些命令覆蓋了會(huì)話管理、上下文控制、并行協(xié)作等方方面面,用好了能省很多事,下面小編就和大家詳細(xì)
    2026-06-03
  • Claude Code Hooks 選裝實(shí)戰(zhàn)指南

    Claudede Hooks實(shí)戰(zhàn)指南,涵蓋三級(jí)攔截體系,兩腳本開(kāi)箱即用,覆蓋致命、高風(fēng)險(xiǎn)、警告三級(jí)操作,通過(guò)配置settings.json靈活定制攔截策略,支持PowerShell與原生Toast通知,適用于
    2026-06-03
  • Claude Code接入DeepSeek V4的兩種方法完整配置指南(2026最新)

    Claude Code 是目前最好用的 AI 編程 Agent,但它默認(rèn)只用 Anthropic 的模型,價(jià)格不便宜,本文主要介紹了Claude Code接入DeepSeek V4的兩種方法,有需要的小伙伴可以了解
    2026-06-03
  • Claude Code常見(jiàn)報(bào)錯(cuò)排查指南及解決方法

    Claude Code 是目前最強(qiáng)大的命令行 AI 編程助手之一,但從安裝、配置到日常使用,尤其是在接入國(guó)內(nèi)大模型 API 時(shí),開(kāi)發(fā)者總會(huì)遇到形形色色的報(bào)錯(cuò),本文以階段為線索,系統(tǒng)梳
    2026-06-02
  • 一文詳解Claude Code中Hooks的使用

    Claude Code 每次調(diào)用工具、等待輸入、結(jié)束會(huì)話,都會(huì)觸發(fā)對(duì)應(yīng)的Hook生命周期事件,Hook 腳本除了做判斷和記錄,還可以把事件轉(zhuǎn)發(fā)到本地 socket,讓一個(gè)常駐進(jìn)程處理所有狀
    2026-06-02

最新評(píng)論

玛纳斯县| 宁波市| 阿荣旗| 昭苏县| 香格里拉县| 馆陶县| 溆浦县| 镇远县| 庄浪县| 吉木乃县| 阜城县| 建阳市| 平潭县| 化州市| 红原县| 韶山市| 哈尔滨市| 东辽县| 左云县| 和田县| 东台市| 东光县| 永昌县| 富民县| 安乡县| 淮阳县| 长汀县| 同仁县| 霍城县| 黄冈市| 龙井市| 克拉玛依市| 庄河市| 山丹县| 遂川县| 循化| 阳泉市| 云阳县| 阳信县| 沧源| 邹平县|