3.2 KiB
3.2 KiB
Dify Diff And Group UX Plan
For agent: Execute directly against the existing implementation. Keep the current server deployment and avoid rebuilding core business logic.
Goal: Make the group area operationally clean, add a concrete Dify-vs-local diff surface for selected groups, prevent accidental duplicate pushes, and resolve the current stuck sync pair on the server.
Architecture: Keep the current FastAPI + worker + Vue SPA + Docker Compose structure. Add a lightweight comparison endpoint and a focused workspace UI refinement without introducing new dependencies.
Current Findings
- The current sync failure is not caused by missing embedding or rerank model settings.
- The latest failed job timed out while waiting for Dify indexing, and the remote document remained stuck in
indexing. - Group cards still expose oversized management controls and the workspace does not yet provide a direct “show me local vs Dify differences” view.
- Current wording around Dify actions still risks reading like bidirectional sync when the implemented behavior is local push plus remote mapping.
Execution Tracks
Track 1: Group UX refinement
Files:
- Modify:
frontend/src/views/WorkspaceView.vue - Modify:
frontend/src/style.css - Modify:
frontend/src/lib/i18n.ts
Steps:
- Replace large group edit/delete buttons with compact icon actions on the group card.
- Keep inline create only for the empty-state path.
- Move group management to card-level actions only and keep the selected-group summary informational.
- Tighten copy so Dify actions read as push/status, not realtime bidirectional sync.
Track 2: Dify diff surface
Files:
- Modify:
backend/app/services/dify_service.py - Modify:
backend/app/api/groups.py - Modify:
frontend/src/views/WorkspaceView.vue - Modify:
frontend/src/lib/i18n.ts - Modify tests under
backend/tests/
Steps:
- List remote Dify documents for the selected dataset.
- Compare local documents and remote documents by normalized document name within the selected group.
- Return summary buckets and row-level status so the UI can show matched, local-only, Dify-only, and attention items.
- Add a modal viewer in the workspace with search by file name inside the selected group.
Track 3: Duplicate push guard and dirty data cleanup
Files:
- Modify:
backend/app/api/files.py - Apply one-off server cleanup for the current stuck local/remote record pair
Steps:
- Reject single-document pushes when the current version is already marked
synced. - Skip already-synced rows during batch push.
- Delete the currently stuck remote Dify document and clear the corresponding local failed sync state so the next push starts from a clean baseline.
- Rebuild only affected services and run a real server verification pass.
Verification
- Run targeted backend tests for diff and push guard behavior.
- Run frontend
npm run build. - Deploy updated backend and frontend services to
192.168.100.230. - Verify group actions are compact and usable in the browser.
- Verify the Dify diff modal reflects matched, local-only, Dify-only, and attention states.
- Re-run a real Dify push after cleanup and confirm it reaches a completed indexing state.