logancyang_obsidian-copilot/docs/chat-interface.md
Zero Liu f3e5840af5
feat(relevant-notes): dedicated pane with redesigned populated view (#2559)
* feat(relevant-notes): dedicated pane with redesigned populated view

Move Relevant Notes out of the chat into its own command-opened pane
("Open Relevant Notes") and redesign the populated view: a toolbar with
the active-note context line + Build index, color-graded relevance
meters/percentages, a "Best" tag, hover quick actions, a live indexing
overlay, and a restyled hover preview card. Add-to-Chat routes a wikilink
into the open chat/agent view via a new INSERT_TEXT_TO_CHAT event.

Rank relevant notes by semantic similarity only so the displayed
percentages stay monotonic — links no longer boost the score (link-only
notes still appear, without a meter). Remove the old in-chat Relevant
Notes block and its showRelevantNotes setting; update docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refine(relevant-notes): linear meter, link badges, excluded state, preview fixes

- Meter width now maps 1:1 to the similarity score (70% → 70%).
- Add an excluded-file empty state when the active note is outside the
  index inclusion/exclusion settings (takes priority over build/list).
- Replace the "Best" badge with Outgoing-link / Backlink badges; the
  badge+percentage cluster swaps for the action buttons on hover.
- Move row action buttons into the flex flow so the title never overlaps
  them and truncates with an ellipsis in both states.
- Render preview snippet line breaks (whitespace-pre-line).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(relevant-notes): route Add to Chat to the last-focused chat view

The Relevant Notes "Add to Chat" action hardcoded agent-first when picking
the target chat (getLeavesOfType(CHAT_AGENT_VIEWTYPE)[0] ?? legacy), so with
both chats open the wikilink landed in the wrong one. Reuse the existing
lastActiveChatViewType tracking (added for the add-to-context commands in
#2555) via a shared pickContextChatViewType() helper, so the chat we reveal
and the chat we type into always agree.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refine(relevant-notes): show full note content in a scrollable preview

The hover-card preview truncated content two ways: the loaded text was
sliced to 1000 chars and the paragraph was clamped to 4 lines. Drop the
slice and replace line-clamp with a bounded, scrollable area (max-h-64 +
overflow-y-auto) so the full note is reachable in a slightly larger box.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refine(relevant-notes): replace mount-timing setTimeouts with reliable signals

Address PR review on the Relevant Notes work:

- insertTextIntoActiveChat: drop the 50ms guess. The chat views' event bus
  (ChatViewEventTarget) now latches queued "insert text"; the view drains it
  on mount and ChatInputContext buffers/flushes it when the Lexical editor
  registers, so delivery no longer depends on mount timing.
- RelevantNotesView: drop the 50ms initial dispatch. useActiveFile now seeds
  from the current active file on mount, so the pane populates immediately and
  still updates via the active-leaf-change listener.
- RelevanceMeter: route the score-driven width/color through CSS variables
  (.copilot-relevance-meter-fill) instead of an inline style.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 06:54:12 +08:00

6.8 KiB
Raw Permalink Blame History

Chat Interface

The Copilot chat panel is the main way you interact with AI in Obsidian. This guide covers everything about the chat UI: modes, message controls, history, settings, and advanced features like auto-compact.


Chat Modes

Copilot offers four modes. You can switch between them using the mode selector at the top of the chat panel.

Chat

General-purpose conversation. Good for writing, brainstorming, summarizing, or any task where you want to talk to an AI. Your currently open note and selected text are automatically included as context.

Vault QA (Basic)

Ask questions about your vault content. Copilot uses lexical search (keyword matching) to find relevant notes and passes them as context to the AI. No indexing required. Good for quick questions about your notes.

Copilot Plus

The most powerful mode. Requires a Copilot Plus license. Combines Chat and Vault QA with an autonomous agent that can:

  • Search your vault and the web
  • Read and edit notes
  • Remember things across conversations
  • Use a growing set of tools automatically

Projects (alpha)

Focused workspaces with their own context, model, system prompt, and isolated chat history. Useful for keeping separate AI conversations per project. See Projects for details.


Sending Messages

Type your message in the input box at the bottom of the chat panel and press Enter to send (or Shift+Enter to add a new line). You can change the send key in Settings → Basic → Default Send Shortcut.

While the AI is generating a response, a Stop button appears. Click it to interrupt the stream at any time.

Referencing Notes Inline

You can mention specific notes directly in your message using double-bracket syntax:

[[Note Title]]

Copilot adds the note's content to your message as context in the background. This is different from @-mentions — it's typed directly in your message text.

User Message Buttons

Each message you send has action buttons that appear on hover:

  • Edit — Modify your prompt. Press Enter to re-send the edited message to the AI.
  • Copy — Copy the message text to clipboard
  • Delete — Remove this message from the conversation

AI Message Buttons

Each AI response has action buttons:

  • Insert at cursor — Insert the AI's response at your cursor position in the active note
  • Replace at cursor — Replace the selected text in your note with the AI's response
  • Copy — Copy the response to clipboard
  • Regenerate — Ask the AI to generate a new response to the same message
  • Delete — Remove this response from the conversation

Chat History

Autosave

By default, Copilot automatically saves your conversations as markdown files in your vault. Each saved chat appears in the copilot/copilot-conversations/ folder.

You can turn off autosave in Settings → Basic. When you start a new chat, any unsaved conversation is saved automatically.

Chat File Name Format

The filename template controls how saved chats are named. The default is:

{$topic}@{$date}_{$time}

Where:

  • {$topic} — An AI-generated title (or the first few words of your first message if AI titles are off)
  • {$date} — Date in YYYY-MM-DD format
  • {$time} — Time in HH-MM-SS format

All three variables are required. You can customize the format in Settings → Basic → Conversation note name.

AI-Generated Titles

When Generate AI chat title on save is enabled (default), Copilot asks the AI to generate a short, descriptive title for the conversation when saving. When disabled, the first 10 words of your first message are used instead.

Loading Previous Chats

Click the clock/history icon in the chat panel toolbar to open the Chat History list. You can:

  • Browse previous conversations
  • Click a conversation to load it and continue from where you left off
  • Delete conversations you no longer need

The history list can be sorted by most recent or alphabetically.


Per-Session Settings (Gear Icon)

Click the gear icon inside the chat panel to open per-session settings. These apply only to the current conversation and reset when you start a new chat:

  • System prompt — Override the default system prompt for this session
  • Temperature — Controls randomness (0 = deterministic, 1 = creative)
  • Max tokens — Maximum length of the AI's response

Token Counter

Copilot shows a token count indicator at the bottom of the chat. This estimates how many tokens are being used by your current context. Useful for knowing when you're approaching context limits.


Auto-Compact

When a conversation grows very long, it can exceed the model's context window. Auto-compact automatically summarizes the older portion of the conversation and replaces it with a compressed summary, letting you continue chatting without losing track of what was discussed.

The threshold is configured in Settings → Basic → Auto-compact threshold, which defaults to 128,000 tokens. Valid range: 64,0001,000,000 tokens.

When auto-compact triggers, you'll see a "Compacting" indicator in the chat. The conversation continues normally — older messages are replaced by a summary, so the AI still understands the history even though you can no longer scroll back to see the original messages.


Suggested Prompts

When starting a new chat, Copilot may show suggested prompts based on your active note or previous conversations. You can enable or disable this in Settings → Basic → Show suggested prompts.

Relevant Notes

Copilot can display a list of notes related to your currently active note. This helps surface notes you might want to reference without manually searching. Each note can be opened, dragged in as a wikilink, or sent to the open chat with Add to Chat.

Relevant Notes lives in its own pane. Open it from the command palette: Open Relevant Notes. The pane tracks whichever note you're viewing.

Saving a Chat Manually

If autosave is off, or you want to save mid-conversation, click the Save Chat as Note button above the chat input box. This saves the current conversation to your configured save folder.


New Chat Behavior

Click the pencil/new chat icon to start a fresh conversation. This:

  1. Saves the current conversation (if autosave is enabled)
  2. Clears the chat window
  3. Resets the context to your currently active note

You can also use the command palette: New Copilot Chat.