logancyang_obsidian-copilot/src/components
Zero Liu bf0308dd51
feat(agent-mode): make note links clickable in chat and tool cards (#2503)
* feat(agent-mode): make note links clickable in chat and tool cards

Switches markdown rendering to the modern `MarkdownRenderer.render(app, …)`
API via a shared `renderMarkdown` wrapper, and adds a delegated click
handler so `a.internal-link` inside chat/agent/plan-preview views opens
via `app.workspace.openLinkText` (left-click in current pane, cmd/middle
in a new tab). Tool ActionCards now also expose the collapsed line as
a clickable target once the call has completed.

Threads `app` explicitly through the components and utilities that
previously relied on the global `app` (lexicalTextUtils, notePreviewUtils,
vaultPath, AtMention/Note/Paste/TextInsertion plugins) using the
`useApp()` hook at the leaf, and updates AGENTS.md to discourage new
uses of the global.

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

* test(chat): fix ChatSingleMessage mocks for wireInternalLinks

The `renderMarkdown` wrapper now calls `component.register(...)` after
`MarkdownRenderer.render(...)`. The test's `obsidian.Component` mock was
missing `register`, causing the promise to reject and `logError` (which
calls the unmocked `getSettings()`) to crash. Add `register` to the
Component mock and mock `getSettings` as a safety net.

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

* fix(agent-mode): resolve internal links against active note

Pass the active file path as sourcePath to renderMarkdown so wikilinks
with duplicate basenames or heading-only references resolve to the right
file instead of falling back to vault root.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 10:05:10 -07:00
..
chat-components feat(agent-mode): make note links clickable in chat and tool cards (#2503) 2026-05-21 10:05:10 -07:00
command-ui chore(deps): remove unused deps and dead code to shrink bundle (#2460) 2026-05-14 22:25:59 -07:00
composer feat(agent-mode): introduce Agent Mode feature 2026-05-20 19:05:41 -07:00
modals feat(agent-mode): introduce Agent Mode feature 2026-05-20 19:05:41 -07:00
project chore(lint): fix no-array-index-key and other React lint warnings (#2453) 2026-05-14 02:19:38 -07:00
quick-ask feat(agent-mode): introduce Agent Mode feature 2026-05-20 19:05:41 -07:00
ui feat(agent-mode): tint chat input border and mode picker by mode (#2486) 2026-05-20 19:05:41 -07:00
Chat.tsx feat(agent-mode): introduce Agent Mode feature 2026-05-20 19:05:41 -07:00
CopilotView.tsx chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00
CustomPromptSyntaxInstruction.tsx Add tw prefix to tailwind (#1497) 2025-05-31 22:30:54 -07:00
IndexingProgressCard.tsx chore(popout): window-global API swaps — timers, globalThis, base64 (W3/9) (#2401) 2026-05-12 22:24:17 -07:00
SystemPromptSyntaxInstruction.tsx fix(ui): improve system prompt template syntax hints (#2235) (#2245) 2026-03-02 21:58:29 -08:00
TruncatedText.tsx chore(deps): remove unused deps and dead code to shrink bundle (#2460) 2026-05-14 22:25:59 -07:00