Skip to content

feat(search): unified-search UI — Memories | All toggle + doc navigation#185

Merged
ajianaz merged 1 commit into
developfrom
feat/unified-search-ui
Jul 21, 2026
Merged

feat(search): unified-search UI — Memories | All toggle + doc navigation#185
ajianaz merged 1 commit into
developfrom
feat/unified-search-ui

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Wires the unified-recall backend (#184) into the UI.

MemoryList:

  • New "Memories | All" scope toggle next to the search bar.
  • "All" runs utekeServer.recallUnified (search_type=all) → mixed list of memory + document hits, each badged (💾 Memory / 📄 Doc) with score + tags/snippet.
  • "Memories" = existing memory-only recall (unchanged).
  • Memory hit → onmemoryclick (detail panel, unchanged). Document hit → new ondocumentclick(slug).

Cross-view doc open:

  • MemoryList ondocumentclickApp.openDocument(slug) → stashes slug in a pendingDocSlug store + navigate("documents").
  • DocumentsView $effect consumes pendingDocSlug on mount → navigateToSlug(slug) → opens the doc → clears the store.

New: src/lib/stores/nav.ts (the pendingDocSlug store).

Verified: svelte-check (0 errors), vitest (61), npm build. The recall/TS layer was already empirically validated against uteke 0.9.0 in #184 (/recall search_type=all returns mixed memory+doc list).

Note: runtime click-through (search → doc opens in Documents) is structurally wired + type-checked; a manual smoke test in the running app confirms the UX. Pairs with #183 (HTTP-only gate) + #184 (unified search backend).

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

Blocked — critical issues found.

🔴 Error (2)

  • src/lib/components/MemoryList.svelte:75 — In runSearch, the search mode is checked synchronously (if (searchMode === 'all')) before the awaits, but not re-checked after them. If a user switches modes (e.g. clicks "All" then "Memories") while a recallUnified call is in flight, the resolved promise will still assign unifiedResults = [...] and searchResults = null even though the user has since switched to memory-only mode. The result is the UI briefly (or persistently) showing unified results in memories mode, or vice versa. The mode-switch handlers also call runSearch() without cancelling the prior in-flight invocation, so two concurrent searches can race to overwrite shared state.
  • src/lib/components/MemoryList.svelte:250 — In the unified-results each block, several properties are accessed without null guards: {#each r.tags.slice(0, 5) as tag}, {r.content.slice(0, 200)}, and {(r.score * 100).toFixed(0)}. Other fields in the same template are properly guarded (e.g. {#if r.chunk_snippet}, {#if r.doc_title ?? r.doc_slug}), but tags, content, and score are assumed to always be present. If the backend ever returns a result missing one of these (e.g. a document result that incorrectly falls into the {:else} branch because result_type differs, or a memory with no tags), .slice/.toFixed on undefined will throw and break rendering of the entire list. Note that r.content is also used as a fallback in the {#each ... (r.memory_id ?? r.doc_slug ?? r.content)} key, so an undefined content makes the key resolve to undefined.

Review powered by cora-cli · BYOK · MIT

Wires the unified-recall backend (#184) into the MemoryList UI:

- Add a "Memories | All" scope toggle next to the search bar. "All" runs
  `utekeServer.recallUnified` (search_type=all) and renders a mixed list of
  memory + document hits, each badged (💾 Memory / 📄 Doc). "Memories" keeps
  the existing memory-only recall path.
- Memory hits → `onmemoryclick(id)` (opens detail, unchanged).
- Document hits → new `ondocumentclick(slug)` prop → App.openDocument →
  stashes the slug in a `pendingDocSlug` store + navigates to Documents.
- DocumentsView consumes `pendingDocSlug` on mount via a `$effect` and opens
  the doc by slug (`navigateToSlug`), then clears it.

New: src/lib/stores/nav.ts (pendingDocSlug store).

Verified: svelte-check (0 err), vitest (61), npm build. (Recall/TS layer
from #184 already empirically validated against uteke 0.9.0.)
@ajianaz
ajianaz force-pushed the feat/unified-search-ui branch from 3d89a50 to baad4b8 Compare July 21, 2026 04:10
if (searchMode === 'all') {
try {
unifiedResults = await utekeServer.recallUnified(searchQuery, {
searchType: 'all',
tabindex="0"
onclick={() => r.memory_id && onmemoryclick(r.memory_id)}
onkeydown={(e) => e.key === 'Enter' && r.memory_id && onmemoryclick(r.memory_id)}
>
@ajianaz
ajianaz merged commit 65d8e1b into develop Jul 21, 2026
8 of 9 checks passed
@ajianaz ajianaz mentioned this pull request Jul 21, 2026
ajianaz added a commit that referenced this pull request Jul 21, 2026
* chore(release): v0.3.3

Patch release — auto-update now works, unified search, HTTP-only version
gate, server version in Settings, bun tooling.

- bump version 0.3.2 → 0.3.3 (package.json, Cargo.toml, Cargo.lock,
  tauri.conf.json)
- CHANGELOG entry

Contents (since v0.3.2):
- Added: unified search across memories + documents — "Memories | All"
  toggle (#184, #185)
- Fixed: auto-update — generates latest.json manifest (workaround
  tauri-action#1098 that left every release since v0.2.0 without it) (#187)
- Changed: version detection fully HTTP-only (#183); uteke server version
  in Settings → Connections (#186); tooling switched to bun (#186, #187)

Verified: cargo fmt/clippy(-D warnings)/test (18), svelte-check (0 err),
vitest (61), npm build.

* feat(settings): make codecora.dev clickable (opens in browser)

The "codecora.dev" line under CorIn vX.Y.Z in the Settings sidebar is now
a link — clicking opens https://codecora.dev in the system browser via
@tauri-apps/plugin-shell (preventDefault + shellOpen), matching how
DocumentsView handles external links. Accessible (real href) + hover style.
@ajianaz ajianaz mentioned this pull request Jul 21, 2026
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.

2 participants