feat(web): 权限确认弹窗精简展示 —— PascalCase 工具名 + 文件改动摘要 - #17
Open
shaohaozhi286 wants to merge 1 commit into
Open
Conversation
对齐 TUI 工具行改造的口径:弹窗头部工具名走 pascal_case_tool_name 同款转换(file_write → FileWrite,MCP 双下划线名逐词转换); file_write/file_edit 不再把参数 JSON(含完整文件内容)糊进弹窗, 只显示文件路径 + 行数摘要(写入 N 行 / 替换 N→M 行 / 删除 N 行, replace_all 标注所有匹配);bash 只显示命令本体;其余工具保留 紧凑 JSON 兜底。展示逻辑收口在纯函数 lib/permissionToolPreview.js, Node 单测覆盖行数边界与异形参数降级。后端 payload 零改动。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
Web UI 的权限确认弹窗(PermissionModal)此前把工具参数 JSON 原样糊进卡片 ——
file_write时就是整个文件内容,既难看也没法审。本 PR 对齐昨天 TUI 工具行改造的口径:pascalCaseToolName,与 TUI 的pascal_case_tool_name(src/tui/tool_row_format.cpp)完全同口径 ——file_write→FileWrite,已是驼峰的名字(AskUserQuestion)原样保留,MCP 名mcp__server__snapshot→McpServerSnapshot。替换 N 行 → M 行/ 新建写入 N 行/删除 N 行,replace_all追加「(所有匹配)」。为什么这样做
web/src/lib/permissionToolPreview.js,遵循仓库约定(数据整形放 lib、Node 单测),组件只做映射。"a\n"算 1 行不算 2 行),否则整文件写入(必带尾换行)行数恒虚高 1。审阅提示
permission_requestpayload(request_id/tool/args)一字未动,纯前端展示层变更。permissionToolPreview.test.js6 个用例(PascalCase 口径、行数边界、file_edit 三形态、bash、异形参数降级),已注册进 runTests.js;pnpm test全量 0 失败,pnpm build通过。pnpm build后重新跑 CMake configure(嵌入发生在 configure 期)。🤖 Generated with Claude Code