Skip to content

feat: command palette (⌘K), RIS import, settings page, global search#157

Merged
aicoder2009 merged 1 commit into
mainfrom
claude/zen-mirzakhani-bc3042
Jun 10, 2026
Merged

feat: command palette (⌘K), RIS import, settings page, global search#157
aicoder2009 merged 1 commit into
mainfrom
claude/zen-mirzakhani-bc3042

Conversation

@aicoder2009

@aicoder2009 aicoder2009 commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Four high-value, low-effort features for the power-user audience:

Command palette (⌘K / Ctrl+K)

  • WikiCommandPalette mounted in WikiLayout, available on every page
  • Fuzzy-matched commands: navigation (Dashboard, Cite, Lists, Projects, Search, Settings, docs pages), theme toggle, and jump-to for the user's own lists and projects (fetched on first open)
  • New src/lib/fuzzy-match.ts scorer: exact > word-aligned substring > acronym ("ml" → My Lists) > scattered subsequence
  • Registered in SHORTCUTS, so it shows in the ? overlay and the keyboard-shortcuts docs page automatically

RIS import

  • src/lib/citation/importers/ris.ts mirrors the BibTeX importer: 20+ TY types mapped to source types, authors/editors/translators, dates, page ranges, DOI, wrapped continuation lines, BOM handling, derived citekeys for the multi-entry picker
  • Cite page tab renamed to "Import BibTeX / RIS" — format auto-detected on paste, .ris accepted on upload (closes the Zotero/EndNote/Mendeley interop gap)

Settings page (/settings)

  • Device-local defaults for citation style (built-ins + CSL), source type, access type, plus a theme picker — persisted via new src/lib/preferences.ts
  • The cite page applies saved defaults on load (URL params still win)
  • Option lists extracted to src/lib/citation-options.ts, shared between cite and settings; linked from the user menu and palette; public route since prefs are device-local

Global search (/search)

  • New GET /api/search?q= searches project/list names and descriptions plus citations (title, authors, formatted text, tags, notes) across all the user's lists, capped at 50 citation hits
  • Debounced search page with grouped, linked results; "Search" added to the signed-in nav

Testing

  • 695 tests pass (27 new: fuzzy matcher, RIS importer, search API route)
  • lint, typecheck, and build all clean locally
  • Verified live in the browser: palette open/filter/Enter-navigation, settings persistence picked up by the cite page (IEEE default), RIS single- and multi-record import rendering correct citations

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added global search functionality to find projects, lists, and citations across your account.
    • Added Settings page to configure default citation style, source type, access type, and theme preference.
    • Added Command Palette (⌘K/Ctrl+K) for quick navigation and theme switching.
    • Added RIS importer support alongside existing BibTeX import.

Four power-user features:

- Command palette (⌘K/Ctrl+K): fuzzy-matched navigation, theme toggle,
  and jump-to for the user's lists and projects, mounted in WikiLayout.
  Backed by a small fuzzy matcher (exact > word-aligned > acronym >
  subsequence scoring).
- RIS import: src/lib/citation/importers/ris.ts mirrors the BibTeX
  importer (20+ TY types, authors/editors/translators, dates, pages,
  continuation lines). The cite page Import tab auto-detects BibTeX vs
  RIS and accepts .ris uploads.
- Settings page (/settings): device-local defaults for citation style,
  source type, and access type plus a theme picker, stored in
  localStorage. The cite page applies them on load; URL params win.
  Option lists moved to src/lib/citation-options.ts, shared between the
  cite and settings pages.
- Global search (/search + GET /api/search): searches project and list
  names/descriptions and citations (title, authors, formatted text,
  tags, notes) across all the user's lists, grouped results, linked
  from the signed-in nav and the palette.

695 tests (27 new: fuzzy matcher, RIS importer, search route).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 10, 2026 05:54
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
opencitation Ready Ready Preview, Comment Jun 10, 2026 5:54am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request implements a complete search ecosystem with companion features: a /search page with debounced API queries, a settings page for user preferences and theme management, a keyboard-driven command palette with fuzzy matching, RIS citation import support, and supporting infrastructure (preferences persistence, fuzzy matching library, shared citation options). All changes are integrated into existing navigation and menus.

Changes

Search, Settings, Command Palette, and Citation Features

Layer / File(s) Summary
Fuzzy Match Library
src/lib/fuzzy-match.ts, src/lib/fuzzy-match.test.ts
New fuzzy matching utility that performs case-insensitive substring and subsequence matching with word-boundary-aware scoring, returning match score and highlighted character indices for both search and command palette.
Search API Route and Tests
src/app/api/search/route.ts, src/app/api/search/route.test.ts
Backend authenticated search handler that accepts query parameter, filters user's projects/lists by substring match, fetches and filters citations by title/text/tags/authors, enforces minimum query length (2 chars), and returns grouped results with proper 401/400/500 error handling.
Search Results Page
src/app/search/page.tsx
Client search page synchronized to URL for shareability, with debounced 300ms requests to search API, stale-response protection via request IDs, and grouped display of projects/lists/citations with appropriate loading/error/empty states.
Preferences Persistence and Settings Page
src/lib/preferences.ts, src/app/settings/page.tsx
User preferences module with localStorage persistence, SSR-safe defaults, and merge-on-update. Settings page allows users to configure default citation style/source/access and toggle theme (light/dark) with transient "Saved" confirmation.
Command Palette with Keyboard Shortcuts
src/components/wiki/wiki-command-palette.tsx, src/components/wiki/index.ts, src/lib/keyboard-shortcuts.ts
Interactive command palette (⌘K/Ctrl+K) with static auth-dependent commands, dynamically loaded user lists/projects, and fuzzy search ranking. Supports keyboard navigation and auto-executes selected command. Integrated into WikiLayout with theme toggle action.
RIS Citation Importer
src/lib/citation/importers/ris.ts, src/lib/citation/importers/ris.test.ts, src/lib/citation-options.ts
New RIS format importer parsing records into structured fields, handling authors/editors/translators/dates/identifiers with source-specific mapping (journal/book/chapter/conference/thesis), plus RIS-vs-BibTeX heuristic detector. Centralizes citation option constants (SOURCE_TYPES, CITATION_STYLES, ACCESS_TYPES) for reuse across pages.
Cite Page RIS Import Support
src/app/cite/page.tsx
Updated citation import to auto-detect and parse both BibTeX and RIS formats, applies user preferences on mount before URL params, and uses centralized citation-options module for consistent styling.
Navigation and UI Integration
src/components/wiki/wiki-layout.tsx, src/components/wiki/wiki-user-menu.tsx, src/middleware.ts
Adds Search link to authenticated desktop/mobile navigation, Settings entry to user menu, registers Meta+K shortcut, and marks /settings as public route bypassing auth middleware.
Documentation and Architecture Updates
CLAUDE.md
Updated test coverage count (668→695), documented citation importers with auto-detection, search endpoint, new /search and /settings directories, expanded /lib details (citation-options, preferences, fuzzy-match), and revised Common Tasks for adding citation styles and source types.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A search so swift with fuzzy glow,
Settings saved and themes that flow,
RIS citations hop on through,
Command palette at Cmd+K, it's true!
Navigation weaves them all together—
Features bouncing light as feather! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes all four main features added in this PR: command palette (⌘K), RIS import, settings page, and global search.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/zen-mirzakhani-bc3042

Comment @coderabbitai help to get the list of available commands and usage tips.

@aicoder2009 aicoder2009 merged commit b69285b into main Jun 10, 2026
6 of 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.

2 participants