feat(web): Documents 页接入 Hub 真实数据,消除 real 模式 mock 静默兜底 - #2189
Merged
Conversation
- useWebWorkbenchModel 新增 hub-documents query + createDocument mutation(invalidate 闭环) - 提取 resolveWebDocumentsProps 纯函数:error 不塌缩为空列表(#1821 语义)、未就绪不冒错误、fixture 保 mock 兜底 - App.tsx 传 documents/documentsError/documentsActions 三 prop 进 AgentHubWorkbench - 映射走共享契约 resolveHubDocuments(与 desktop 语义对齐,消除漂移面) - 新增 4 条契约测试;web 全量 262/262 绿 - #2154 P3 Web Documents 诚实标注项消化 Co-authored-by: Cursor <cursor@vectorcontrol.tech>
DeliciousBuding
force-pushed
the
feat/web-documents-wiring
branch
from
September 1, 2026 18:13
0fdcaf3 to
bd21794
Compare
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.
Summary
web 平台此前从未向 workbench frame 传 documents,导致 real 模式下 Documents 页静默落回 mock 数据(#2154 P3「Web Documents 诚实标注」取证项)。本轮接通 Hub 已有的
/web/documentsREST API(数据源一直存在,只是没接线)。Scope
useWebWorkbenchModel:新增hub-documentsquery(hubClient.listDocuments(),hubReady 门控 + 10s staleTime + placeholderData)与createDocumentMutation(成功后 invalidate)resolveWebDocumentsProps:real 模式请求失败 →documentsError+documents=undefined(页面渲染错误态而非空列表,[P0] 交互可靠性与三态修复包:静默失败/假空态/死控件(前端审计第二轮) #1821 语义);hub 未就绪不冒错误;fixture 模式保持 mock 兜底App.tsx传documents/documentsError/documentsActions三 prop(frame→WorkbenchRoutes→useWorkbenchDocsRoute→DocsPage 链路已全活)resolveHubDocuments(workbench hubDataMapping,与 desktop 语义对齐);onCreateDoc用 chatviewdoc.untitled键(资源已存在)onUpdateDoc/onDeleteDoc与 desktop 保持同现状(仅 create 接线),两端一致,后续项验证证据(本地)
useWebWorkbenchModel.test.ts40/40 ✅git diff --check✅风险
纯增量接线;demo/fixture 模式行为不变(resolveHubDocuments 既有契约)。