Skip to content

fix(knowledge-os): folder nodes, chat scope, graph refresh and silent failures in the search modal - #118

Open
iLevyTate wants to merge 1 commit into
mainfrom
fix/knowledge-os-audit
Open

iLevyTate wants to merge 1 commit into
mainfrom
fix/knowledge-os-audit

Conversation

@iLevyTate

Copy link
Copy Markdown
Owner

Summary

An audit of the Knowledge OS modal (Search, Chat, Relate graph, Atlas) for controls that were mis-wired or failed silently. Each item below was confirmed in the code before it was fixed.

Search and Chat

  • The preview pane no longer shows the previous file's details under a newly selected file.
  • "Add to scope" works for more than 1,000 files: lookups are chunked, the scope is capped at 1,000 and a warning says when files were left out.
  • "Ask AI" is limited to the results on screen (up to 200) instead of the whole library.
  • Reopening the modal starts a clean conversation (no scope, warning or conversation id carried over).
  • The chat input keeps its text when a send is refused.
  • Ctrl+1..5 switches tabs while a text field has focus (not with Alt, so AltGr still types).
  • Clicking two conversations quickly shows the one clicked last.
  • A failed chat mode or persona save is reported in the chat panel instead of under "Search error".

Relate graph and Atlas

  • Folder nodes sent the folder name as a path, so "Move files here" and "Reveal" could not work. They now resolve the smart folder's real path; a name that matches no smart folder asks for a destination (move) or says so (reveal).
  • The graph listened for vector DB status on window.api, which does not exist; it now uses window.electronAPI.
  • The delayed cluster refresh (about 6 s after load) no longer overwrites a graph the user has expanded, dragged or replaced, and skips the redraw when nothing changed.
  • Knowledge edges between clusters survive a redraw.
  • Move-all, export and member loading chunk getFileMetadata calls (limit 100 ids); tagging chunks addTags (limit 1,000) and reports "Tagged X of Y" on partial failure, in the graph and in Atlas.
  • Regrouped and duplicate groups no longer parse to a NaN cluster id: expand and triage use the node's own members, and renaming one is session-only and says so.
  • The details panel drops the previous node's metadata on selection change and reads fileName.
  • { success: false } is no longer swallowed for cluster rename (label reverts), triage moves (failed files stay listed, dialog stays open) and the context-menu Open File / Reveal in Folder items.
  • The context menu no longer opens as an empty box on folder, query or duplicate nodes; Find duplicates ignores a second click while a scan runs.
  • docs/FEATURES_GRAPH.md corrected to match the actual context menu, double-click, Focus and "Find similar" behaviour.

Scope

  • Area(s): renderer, Knowledge OS modal (search, chat, graph, atlas); docs
  • Risk Level: medium (useGraphTab.js and UnifiedSearchModal.jsx are large shared files)
  • Breaking Changes: none. Behaviour change: "Move files here" on a folder node moves straight into that smart folder instead of opening a folder picker.

Type of Change

  • Bug fix
  • Enhancement
  • New feature
  • Refactor
  • Documentation update
  • Breaking change

Test Plan

Automated

  • npm run format:check (ran prettier on the changed files only)
  • npm run lint (ran eslint on the changed files only)
  • npm test (ran test/components, test/renderer/components/search and test/searchUtils.test.js: 114 suites, 1146 tests pass; full run left to CI)
  • Additional tests added/updated when behavior changed

Also ran: typecheck:js, verify:checkjs-ratchet (494/494), knip:files.

Manual QA

  • Manual checklist completed (see docs/TESTING.md)
  • Not applicable (explain below)

Manual QA notes:

  • Not run in the app. Worth checking by hand: "Move files here" and "Reveal" on a suggested-folder node; expand a cluster within 6 s of the graph loading and confirm it stays expanded; tag a cluster; Ctrl+4 from the search box.

Checklist

  • I scoped this PR to one logical change
  • I self-reviewed code and naming for clarity
  • I updated docs/config references where needed
  • I called out follow-up work or known limitations

Known limitations and follow-ups:

  • Chat Regenerate and Retry still leave the discarded answer in saved history, so both answers appear after a reload. Fixing it needs a delete-after-last-user-message method in the chat history store.
  • Atlas "Smart folder..." ignores the current selection. Using it would mean moving files, which needs a product decision.
  • Test coverage for the refresh guard, edge carry-over and metadata chunking is at helper level; the modal's folder-action handler, the freshMetadata effect, expand/triage on regrouped groups, the find-duplicates guard and the Atlas tag path have no component-level test.
  • The preview pane can still paint one frame of the old details before the clear runs.

… failures in the search modal

Search and Chat: preview details no longer linger under a new selection,
Add to scope chunks past 1000 files, Ask AI is limited to visible results,
reopening starts a clean conversation, a refused send keeps the input,
Ctrl+1..5 works from text fields, and conversation switching keeps the
last click.

Graph and Atlas: folder nodes resolve the smart folder path instead of
sending its name, the vector DB status listener uses electronAPI, the
delayed cluster refresh no longer overwrites user changes, knowledge edges
survive redraws, metadata and tag calls are chunked to their schema limits,
regrouped groups no longer parse to NaN ids, and failed rename, move, open
and reveal calls are reported.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant