OdysseyUI

Search Modal

A full-featured chat search modal with conversation preview, inline rename/delete, keyboard navigation, and time-grouped results.

Loading...

Installation

This component ships with a MarkdownRenderer helper (installed alongside it) that renders assistant messages with syntax-highlighted code blocks. It requires react-markdown, remark-gfm, and rehype-highlight — all included as dependencies. For code block syntax highlighting styles, add a highlight.js theme CSS to your project (e.g. highlight.js/styles/github-dark.css).

Usage

import { useState } from 'react';
import SearchModal from '@/components/odysseyui/search-modal';

export default function Page() {
  const [open, setOpen] = useState(false);

  return (
    <>
      <button onClick={() => setOpen(true)}>Search</button>
      <SearchModal
        open={open}
        onClose={() => setOpen(false)}
        onNewChat={() => {
          /* start a new chat */
        }}
      />
    </>
  );
}

Keyboard Shortcuts

KeyAction
/ Navigate between conversations
EnterGo to selected conversation
EscapeClose the modal
Ctrl+Shift+PToggle preview panel
Ctrl+Shift+ERename selected conversation
Ctrl+Shift+DDelete selected conversation

How It Works

  • Search: Filters conversations by title and message content as you type.
  • Time groups: Conversations are automatically bucketed into Today, Yesterday, Last 7 Days, and Earlier.
  • Preview panel: Selecting a conversation shows its full message thread on the right, with MarkdownRenderer rendering assistant messages.
  • Inline rename: Click the pencil icon (or Ctrl+Shift+E) to rename a chat in-place; confirm with Enter or Escape to cancel.
  • Delete: Click the trash icon (or Ctrl+Shift+D) to remove a conversation without confirmation.
  • Auto-select: The first result is always pre-selected when the query changes.

API Reference

SearchModal

PropTypeDefaultDescription
openbooleanControls modal visibility
onClose() => voidCalled when the modal requests to close
onNewChat() => voidundefinedCalled when the user clicks "New Chat"

Built by Shr3kx & iam-sahil. The source code is available on GitHub.

Last updated: 4/6/2026