fix(knowledge): keep computer upload and place creation below it

This commit is contained in:
鲨鱼辣椒 committed 2026-10-13 13:39:30 +08:00
1 parent a6126c0ae2
commit a589a864d7
11 files changed
+97 -944

No files matched your search

@@ -12,35 +12,38 @@
## Scope
- Explain the screenshot's "从聊天选择文件" entry, source-chat/file range, destination, processing and activation. Inspect committed client knowledge-workspace source c634425 and committed Yuxi reference source; no product edits.
- Explain the screenshot's "从聊天选择文件" entry, then remove the chat-file import entry/workflow at the user's explicit instruction. Keep computer upload, current document management and knowledge-library selection/activation.
## Intent And Constraints
- User requests a product-language explanation, not an import, redesign or app update. Preserve real files/chats/libraries, runtime, peer worktrees and source. Only this owned record changes.
- User initially requested explanation; the latest explicit instruction authorizes removing chat-file import and retaining computer upload. This supersedes the previous feature's approved chat-import entry.
- Additional user steering: place the knowledge creation button below the computer upload button. Move the new-library entry/creation form under the upload action row; keep first-library creation available when upload has no selected target.
- Keep real files/chats/libraries, runtime, Main/backend APIs and old recovery records. No actual imports, deletion of user data, app update, main integration or push. Own only removal-related UI/copy/style/tests and this record.
## Outcome
- This entry copies already uploaded/confirmed attachments from the user's personal Agents chats into the own knowledge library selected on the left ("试试" in the screenshot). Source chat attachments remain in place.
- Threads are loaded without a target-agent filter, so the user's eligible chats from other personal/shared Agents can be sources. Caller ownership is enforced by Yuxi; the target creator cannot import someone else's attachments.
- Chat text and assistant-generated workdir files are not imported. The picker fetches attachments, not history or generated-file listings.
- Latest committed picker supports searching chats/files, cross-chat selection, supported-document limits (5 MB; txt/md/csv/json/docx/xlsx/pdf), independent import receipts and same-operation failure retries.
- Client onImported invokes processKnowledge; status polling confirms actual indexed chunks/availability before displaying "可用于回答". Selecting a library for an Agent changes configuration and requires explicit save/apply; import is not itself final activation.
- Import reuses the knowledge upload/storage path, making a new knowledge copy without moving/deleting the chat original. Other eligible personal Agents can select the same own library.
- Removed the "从聊天选择文件" entry, its picker component and exclusive styles/state/props/tests. Knowledge adding has only the computer-upload entry. Upload copy and README match.
- Moved "新建知识库" and its expanded creation form below the computer-upload action row. Before a target is selected, the upload button is disabled and first-library creation remains available directly below it.
- Preserved automatic document processing, status polling, pagination, original-operation retries, replacement/deletion, permission-loss pending state, own/shared library distinctions and explicit save/apply of selection.
- Main/shared/backend import contracts and recovery handling remain for existing pending operations. No real files/chats/libraries were imported, moved or deleted; current app/runtime was not refreshed.
## Verification
- Read source: CloudKnowledgeAttachmentPicker thread/attachment/selection/import flow, CloudKnowledgeDocuments onImported/processing callback and CloudKnowledge target selection; existing focused import test shows cross-chat attachment selection and no history/files/deleteAttachment calls.
- Independent read-only Yuxi review confirms owned personal thread checking, confirmed attachment lookup, original file read/new upload, limits and separate assistant-generated file directory.
- No application tests/build required for explanation-only source inspection; no real import, cloud mutation, file movement or runtime update performed.
- Task-aware documentation drift and whitespace checks run at completion.
- Initial explanation inspected committed client/Yuxi import behavior. Subsequent removal is explicitly authorized and does not change backend contracts.
- Pinned corepack pnpm 10.33.4: 6 focused knowledge/catalog/configuration/page suites, 91 tests passed. Existing upload-to-ready test now also verifies no chat-import entry or chat API calls. Retired picker tests were deleted with the component.
- Typecheck, scoped ESLint, full Renderer/Main/preload/utility build and git diff --check passed.
- Headless Vite/Playwright knowledge fixture: 5/5 passed in 18.0s, covering 375px/1440px library selection/save/reopen, first-library creation, upload/auto processing and failed/cancelled upload protection. Both viewport cases assert the new-library button is below upload before and after selecting/creating a target. No real cloud request, native picker or current app operation occurs in the fixture.
- Two prior tests expected no upload button when a target was unavailable; updated explicitly to a disabled placeholder under the new requested layout, preserving the no-document-request assertions.
- Independent review passed for removal and creation-control reorder, including uncertain upload/create and hidden permission-loss state. Inspected generated desktop screenshot confirming the physical button order and removal.
- Task-aware documentation drift and whitespace checks run at completion; own record is the only .project-docs edit.
## Follow-ups
- Knowledge workspace peer source remains a separately owned completed feature; its recorded app update is deferred. This explanation does not authorize applying it or importing user files.
- Source handoff is ready for later integration/application update. The knowledge-workspace source record and current trial remain unchanged; no main integration, push or app update occurred.
## Promotion Candidates
- None; current behavior explanation does not change accepted product semantics.
- Target: personal Agents desktop knowledge UI documentation in a future integration. Proposal: adding knowledge documents uses computer upload only, and new-library creation appears below that upload entry. Evidence: explicit user instructions, source changes, focused regression/viewport checks. No API, storage, privacy or existing-file migration change; human direction already supplied.
## Project Context Loaded
@@ -48,5 +51,11 @@
- Current context: prior entry/positioning/current-state/decision/architecture/domain/success-criteria knowledge rules rechecked; personal-cloud-agents ADR confirms own attachments, independent caller privacy, explicit configuration activation and processing readiness.
- Peer Scope/Intent/Promotion sections read-only; knowledge-workspace ready source is the explicit verifiable base. Unknown legacy scopes have no concrete dependency for this explanation.
- Goal: personal Agent knowledge reuse with Main-owned transport and Yuxi-owned permissions/storage. Relevant files: picker, documents, knowledge selection and Yuxi knowledge/conversation service.
- Constraints: no user-file import, live UI operation, app refresh or product changes. Runtime deployment of the peer's newer picker is not inferred from a screenshot.
- Gate result: Passed for read-only explanation; no coding plan or implementation needed.
- Constraints: no user-file import, live UI operation or app refresh; removal-related source edits are explicitly authorized. Runtime deployment of the peer's newer picker is not inferred from a screenshot.
- Gate result: Passed on resume for the explicitly authorized removal. Ownership and peer scopes rechecked; source base and unchanged canonical context retained.
## Implementation Plan
- Remove the chat-import button, component and its unused local props/state/styles; preserve upload, processing, retries and document management.
- Update explanatory copy and README to computer upload only; remove retired picker tests and adapt existing upload/E2E coverage to confirm the remaining path.
- Run focused knowledge tests, typecheck, scoped lint, build and the headless knowledge fixture; verify task document boundaries and prepare a committed source handoff.