2 Commits

Author SHA1 Message Date
kumarabhirup
dee323b7ad
fix lint/build errors and bump to 2026.2.15-1.4
- Fix all oxlint errors (curly, no-unused-vars, no-base-to-string,
  no-floating-promises, approx-constant, restrict-template-expressions)
- Fix TS build errors: rewrite update-cli.ts as thin wrapper over
  submodules, restore missing chat abort helpers in chat.ts
- Fix web build: wrap handleNewSession in async for ChatPanelHandle,
  add missing safeString helper to entry-detail-modal
- Bump version to 2026.2.15-1.4 and publish

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-16 00:30:13 -08:00
kumarabhirup
5d43186a2b
Dench workspace: unified @ mention search, entry detail modal, and workspace link system
New libraries:
- workspace-links.ts: builders, parsers, and type guards for workspace URLs
  (/workspace?path=... for files/objects, /workspace?entry=objName:id for entries).
  Replaces ad-hoc relative-path links with real navigable URLs.
- search-index.ts: useSearchIndex hook that fetches a unified search index from
  the API and provides Fuse.js-powered fuzzy search across files, objects, and
  database entries. Exposes a stable ref-based search function safe for capture
  in tiptap extensions.

New API routes:
- GET /api/workspace/search-index: builds a flat search index from the filesystem
  tree (knowledge/, reports/, top-level files) and all DuckDB object entries with
  display-field labels and preview fields.
- GET /api/workspace/objects/[name]/entries/[id]: fetches a single entry with
  all field values, resolved relation labels, reverse relations (incoming links
  from other objects), and the effective display field.

New component:
- EntryDetailModal: slide-over modal for viewing an individual entry's fields,
  enum badges, user avatars, clickable relation chips (navigate to related
  entries), reverse relation sections, and timestamps. Supports Escape to close
  and backdrop click dismiss.

Slash command refactor (slash-command.tsx):
- New createWorkspaceMention(searchFn) replaces the old file-only @ mention with
  unified search across files, objects, and entries.
- searchItemToSlashItem() converts search index items into tiptap suggestion
  items with proper icons, badges (object name pill for entries), and link
  insertion commands using real workspace URLs.
- Legacy createFileMention(tree) now delegates to createWorkspaceMention with a
  simple substring-match fallback for when no search index is available.

Editor integration (markdown-editor.tsx, document-view.tsx):
- MarkdownEditor accepts optional searchFn prop; when provided, uses
  createWorkspaceMention instead of the legacy createFileMention.
- Link click interception now uses the shared isWorkspaceLink() helper and
  registers handlers in capture phase for reliable interception.
- DocumentView forwards searchFn to editor and adds a delegated click handler
  in read mode to intercept workspace links and navigate via onNavigate.

Object table (object-table.tsx):
- Added onEntryClick prop; table rows are now clickable with cursor-pointer
  styling, firing the callback with the entry ID.

Workspace page (page.tsx):
- Integrates useSearchIndex hook and passes search function down to editor.
- Entry detail modal state with URL synchronization (?entry=objName:id param).
- New resolveNode() with fallback strategies: exact match, knowledge/ prefix
  toggle, and last-segment object name matching.
- Unified handleEditorNavigate() dispatches /workspace?entry=... to the modal
  and /workspace?path=... to file/object navigation.
- URL bar syncs with activePath via router.replace (no full page reloads).
- Top-level container click safety net catches any workspace link clicks that
  bubble up unhandled.

Styles (globals.css):
- Added .slash-cmd-item-badge for object-name pills in the @ mention popup.
2026-02-11 21:41:23 -08:00