fix(frontend): improve error code/message presentation and UX - #844
Open
tiantt wants to merge 1 commit into
Open
fix(frontend): improve error code/message presentation and UX#844tiantt wants to merge 1 commit into
tiantt wants to merge 1 commit into
Conversation
…the board - Expose ADK errorCode in SSE events and HTTP errors - Fix silent failures and missing error feedback in multiple components - Replace window.confirm with StudioConfirmDialog for destructive actions - Add role=alert to dynamic error elements for accessibility Co-Authored-By: Claude Opus 5 (1M context) <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.
改动内容
错误码与错误信息展示
src/adk/client.tsAdkEvent接口新增errorCode/error_code字段,ADK SSE 流里的错误码不再被丢弃httpErrorMessage()新增提取errorCode/error_code/code字段,有错误码时统一格式化为[CODE] messagerunSSE迭代 SSE 帧时将 errorCode 前缀到 error/errorMessage/error_messagelistApps、webSearch、fetchAgentInfo、deleteSession、getStudioAccess、getStudioUpdateStatus、getSession、cancelAgentkitDeployment、deleteRuntime、getMyRuntimes、listSessions统一改用httpErrorMessage(),不再裸扔 HTTP 状态码或原始文本formatErrorDetail()新增对象.message字段提取,避免将 JSON 字符串直接展示给用户;数组分支同时检查msg和messagekeysrc/ui/DeploymentErrorMessage.tsx<p>加white-space: pre-wrap,\n分隔的多段提示(如会话丢失建议、工具参数提示)不再挤成一行静默失败修复
src/create/CustomCreate.tsxerror.message为空字符串时会静默——改为(error instanceof Error && error.message) ? error.message : String(error) || '未知错误',影响openPublishPreview、handleGenerateDraft、startDebugVariant||改为??,避免 falsy 值(如空字符串)被跳过src/ui/MyAgents.tsxuseAgent()新增catch块 +useErrorstate,连接 Agent 失败不再静默src/ui/AgentWorkspace.tsxgetRuntimeDetail失败时新增runtimeDetailErrorstate,Basic 标签页不再永远显示"读取中…"deleteCases()将window.confirm()替换为StudioConfirmDialog,与同文件其他删除操作保持一致无障碍访问(Accessibility)
src/ui/AgentWorkspace.tsxagentsError、feedbackCasesError错误容器加role="alert"updateCapabilityError新增可见告警段落(之前只在 disabled 按钮 tooltip 里)src/ui/SessionCapabilityDialogs.tsxspacesError/skillsError,space 加载失败不再让错误出现在 skills 面板role="alert"表单校验与交互一致性
src/create/agentNameValidation.tssrc/create/CustomCreate.tsxmaxLength={64}src/ui/ManageAgents.tsxhandleDelete将window.confirm()替换为StudioConfirmDialog variant="danger"src/ui/Navbar.tsxonAppChange失败新增错误 state +role="alert"提示;trigger 按钮加aria-busy🤖 Generated with Claude Code