Skip to content

Release: Demo Mode, Dashboard UI Sync & Effect Refactor - #65

Merged
suguanYang merged 36 commits into
mainfrom
staging
May 13, 2026
Merged

suguanYang merged 36 commits into
mainfrom
staging

Conversation

@suguanYang

@suguanYang suguanYang commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Demo Mode Overhaul — demo documents now load from the Knowhere API with proper materialization, dev API key flow support, and workspace guards
  • Dashboard UI Sync — synced notebook design system with dashboard theme, removed chunk hash links, restyled dashboard link as text
  • Effect Architecture — converted server-side code to Effect patterns; introduced Upstash Workflow for durable execution
  • Document Reconciliation — client-driven document reconciliation with atomic dedup for demo citations
  • Performance — skipped workspace DB queries for non-UUID demo source chunk requests; reduced page size to 50
  • UX Fixes — responsive text original previews, focused chunk panel, friendlier grounded answers, clarified source/file affordances

suguanYang added 30 commits May 12, 2026 15:03
…d-demos

Load demo documents from Knowhere API
…factor

Merge API-owned demo workspace flow into staging
Replace raw fetch/async/try-catch/throw with Effect.gen, Effect.fn,
Effect.tryPromise, and structured error handling across foundations,
domain logic, route services, and API handlers.
Replace the automatic reconcileStaleSources background sweep with inline,
per-source triggers that fire only when the client polls for source state.
Add three-layer protection against duplicate workflow runs: Upstash
idempotency via workflowRunId, in-memory dedup, and an atomic DB guard
(UPDATE WHERE status='parsing') so concurrent workflows cannot both
finalize the same source.
After demo materialization, source rows get new materialized document IDs
but the seeded demo-thread citations still reference the canonical IDs.
Wire up the existing replaceDemoCitationDocumentId to remap citations
after materialization completes, so source citation resolution continues
to work.
Two changes to complete the citation fix after demo materialization:

1. route-chunks: when serving chunks for a materialized demo source, use
   the source's knowhereDocumentId as the chunk documentId instead of the
   canonical one, so chunk resolution finds matching citations.

2. workspace-chat-workflow: after materialization, re-fetch the chat thread
   from the server instead of remapping citation documentIds client-side.
   The server-side fix (prior commit) already persisted the corrected
   citations; this just gets fresh data to the client.

Also hide the materialization status text from the user — it now shows
"Thinking" like a normal send.
Non-UUID source IDs can only be demo sources. Short-circuit
loadSourceChunksEffect before getCurrentUser/ensureWorkspace to avoid
unnecessary DB queries on every demo chunk page load. Also caches the
upstream demo chunk API response for 5 minutes.
Drop the #chunk-<id> URL hash navigation and the LayoutDashboard icon
prefix from the top-nav dashboard link.
fix: add dev API key support and demo flow improvements
@vercel

vercel Bot commented May 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
knowhere-notebook-staging Ready Ready Preview, Comment May 13, 2026 10:52am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
knowhere-notebook Ignored Ignored Preview May 13, 2026 10:52am

Request Review

…ncies

- Use expect.any(Function) for chat route repository assertions since
  chatTurnPersistence.createRepository() now wraps service methods
- Return Promises from reconcile mock defaults so Effect.tryPromise
  doesn't fail on bare vi.fn() (which returns undefined)
- Add 4th "parsing" arg to markSourceFailed expectation to match
  updated lifecycle function signature
…age size

- Remove obsolete search test from chunks-panel.test.ts (search was removed
  from the component in 9ee238e)
- Switch workspace/client.test.ts from stubbing global fetch to mocking
  workspaceRouteClient (now uses Effect FetchHttpClient)
- Update page size from 100 to 50 in workspace-shell test assertion
  (changed in 9ee238e)
Load the first demo source's parsed chunks during the server render so
guest users see content immediately — no loading spinner on first visit.

Uses unstable_cache with revalidate: false so the fetched chunks are
shared across all users. The chunk prefetch is best-effort; if it fails,
the client falls back to loading chunks on demand.
fix: update tests for Effect-wrapped repository and reconcile dependencies
SSR demo chunks for guest first page view
@suguanYang
suguanYang merged commit acecb50 into main May 13, 2026
7 checks passed
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