fix(knowledge): separate creation management and selection
This commit is contained in:
1 parent
a589a864d7
commit
8e0e52f30e
11 files changed
+223
-112
No files matched your search
@@ -13,28 +13,31 @@
|
||||
## Scope
|
||||
|
||||
- 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.
|
||||
- Latest follow-up: separate creation, owned-library management and Agent binding. Top left is 「上传自己的文件」 with the new-library entry/form, top right is 「查看我的知识库」 with the managed-library dropdown/upload/files, and 「选择知识库」 spans below both.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- 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.
|
||||
- Earlier steering placed creation beneath computer upload; the latest explicit layout supersedes that button order: the left creation card contains only the new-library entry/form; owned-library browsing and creation do not bind a library to the Agent. Binding remains an explicit bottom selection, and its 100-library limit does not block management or creation. Delete the old instruction paragraph and 「添加到我的知识库」 label.
|
||||
- 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
|
||||
|
||||
- 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.
|
||||
- Top left 「上传自己的文件」 contains the new-library button and expanded creation form. Top right 「查看我的知识库」 contains the owned-library dropdown, directory refresh, computer upload and file management. Bottom 「选择知识库」 spans both columns; narrow cards stack creation, management and binding in that order. The old instruction paragraph and 「添加到我的知识库」 label are removed.
|
||||
- New-library creation now says 「创建知识库」 and opens the created library for management without changing Agent draft bindings. Browsing also leaves bindings untouched; bottom selection explicitly binds. Its 100-library limit no longer blocks browsing, uploading or creating.
|
||||
- Independent review found that using creation-form visibility to place a shared error could show an upload error in the creation card. Errors now follow the operation source, with a regression covering right-side upload failure while the left creation form is open.
|
||||
- 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
|
||||
|
||||
- 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.
|
||||
- Pinned corepack pnpm 10.33.4: 6 focused knowledge/catalog/configuration/page suites, 92 tests passed after the layout follow-up. Coverage includes independent creation/browsing/binding, 100-binding-limit management, interleaved draft changes, create result during save, upload-error placement, stable retry identities and permission-loss state. Upload-to-ready 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.
|
||||
- Latest headless Vite/Playwright fixture: 5/5 passed in 18.2s for 375px/1440px selection/save/reopen, browsing/creation without binding, explicit binding, upload-to-ready and failed/cancelled upload. Intermediate 768px/1024px layout assertions exercise the actual >620px container breakpoint. Ran in this worktree with explicit output directory `/tmp/makelore-knowledge-layout-e2e-20261013`; inspected desktop and mobile complete-card screenshots plus the desktop ready-document state. No real cloud request, native picker or current app operation occurs in the fixture.
|
||||
- The disabled computer-upload placeholder is now confined to right-side management before a target is selected, preserving no-document-request protection.
|
||||
- Independent review confirms automatic-binding removal, deletion cleanup, directory refresh, stable uncertain upload/create identities, hidden permission-loss state and no backend change; its error-source finding was fixed, tested and re-reviewed with no remaining actionable findings.
|
||||
- Task-aware documentation drift and whitespace checks run at completion; own record is the only .project-docs edit.
|
||||
|
||||
## Follow-ups
|
||||
@@ -43,7 +46,7 @@
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- 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.
|
||||
- Target: personal Agents desktop knowledge UI documentation in a future integration. Proposal: computer upload is the only document-add entry; top creation and owned-library management are separate from bottom Agent binding. Creation/browsing do not modify bindings, and the binding limit does not restrict management. 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
|
||||
|
||||
@@ -52,10 +55,10 @@
|
||||
- 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 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.
|
||||
- Gate result: Passed on resume for the explicitly authorized layout follow-up. Successful start/status confirms the same task/mode/branch/worktree/base. All peer Scope/Intent/Promotion sections read-only; the completed knowledge source is the verifiable base. The combined-trial task may later consume this source but this task owns no live update. Undefined legacy scope has no concrete dependency; canonical context is unchanged.
|
||||
|
||||
## 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.
|
||||
- Restructure owned-library UI into a top two-column creation/management row and a bottom binding card. Remove creation injection from the document list and automatic bindings on create/browse; preserve pending operations and permission-loss state.
|
||||
- Update README and focused tests. Independently verify creation/browsing with full binding selection and verify 375px/1440px geometry, upload/status, explicit selection/save/reopen.
|
||||
- Run focused knowledge suites, typecheck, scoped lint, build and headless fixture; inspect screenshots and independent source review, verify task document boundaries and commit the source handoff.
|
||||
Reference in new issue
Block a user