feat: namespace filter for graph & memories (multi-select)#93
Merged
Conversation
Graph and memories views were limited to a single namespace because uteke's /list and /graph endpoints only operate per-namespace. On the VPS server with 27 namespaces, only "default" was visible. Backend: - uteke_server_graph: add `namespaces: Vec<String>` param; fan-out /list across selected namespaces, merge (dedup), build tag-based graph. - uteke_list: add `namespaces` param; fan-out, merge, sort newest-first. - namespaces_with_counts command + client method: uses /namespaces?with_counts (uteke >= #527), falls back to plain list with count 0 on older servers. Frontend: - NamespaceFilter.svelte: reusable dropdown — checkbox list with per-ns counts, search, select-all. Backward-compatible (works on legacy servers). - GraphView: filter in toolbar, debounced reload on change. - MemoryList: filter in toolbar, multi-namespace pager + scoped search. - pagination store: support `namespaces` alongside single `namespace`. All paths work on current deployed servers AND will use the upcoming uteke #526/#527/#528 improvements when released.
…n-out Filter UX & semantics: - Fix select-all/deselect: state is now 3-valued — null=all, []=none, array=explicit. Previously [] was ambiguous (all or none), making the toggle flip unexpectedly and unchecking one item from "all" misbehave. - NamespaceFilter: resolve null→full set before toggling so unchecking a single item in "all" mode removes just that item. Indicator shows ☑ all / ☐ none / ⊟ partial. - Graph: move filter to the right of the toolbar (spacer), matching the memories layout so the filter always sits on the right. Backend "all" mode: - uteke_server_graph & uteke_list: when no namespace scope is given, fan out across ALL namespaces instead of hitting legacy no-namespace /list which only returns "default". Graph & list now reflect every namespace. - Treat explicit empty list as "none" (empty result), distinct from null. MemoryList: - Fix TypeError (null.length) by deriving the search scope instead of reading .length on a nullable state inline.
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.
Problem
Graph and Memories views were limited to a single namespace. On the VPS server (
is_primary=1, 27 namespaces / 19k memories), only thedefaultnamespace was visible because uteke's legacy/listand/graphendpoints return onlydefaultwhen called without a namespace scope.Solution
A reusable namespace filter (multi-select dropdown) wired into both Graph and Memories, backed by a per-namespace fan-out that works on any server version (no waiting on the upcoming uteke release).
Backend (
src-tauri/src/)uteke_server_graph/uteke_list— newnamespaces: Option<Vec<String>>param. Three modes:null(all) → fan out across every namespace (fetch/namespacesthen/listper-ns), merge, dedup, sort newest-first.[](none) → empty result (explicit).[...](explicit) → fan out across just those selected.uteke_namespaces_with_counts+ clientnamespaces_with_counts()— uses/namespaces?with_counts=true(uteke #527), falls back to plain/namespaceswithcount: 0on older servers that 404.Frontend (
src/lib/)NamespaceFilter.svelte(new, reusable) — dropdown with:null= all,[]= none, array = explicit (unambiguous).GraphView— filter on the right of the toolbar (spacer layout, matches Memories); debounced reload on change.MemoryList— filter on the right of the toolbar; multi-namespace pager; search scoped to the single selected ns when exactly one is picked.pagination.svelte.ts— supportsnamespacesalongside singlenamespace.Backward compatibility
This works today on the currently deployed servers via per-namespace fan-out. When uteke releases the in-flight fixes, CorIn gets free bonuses with no code change:
/namespaces?with_counts=true—/listVerification
cargo clippy -- -D warnings✅ cleansvelte-check✅ clean on changed files (1 pre-existing error inDetailPanel.svelteunrelated to this PR)127.0.0.1:8767and the VPS connection: filter shows all namespaces, select-all/deselect behaves correctly, graph loads across multiple namespaces.Out of scope (follow-up)
/listonce uteke #526 is released (currently N requests via fan-out — correct, just not minimal).