#7865 · Docs editor has no link activation path
Verdict: REPRODUCED · Root-cause confidence: high
1. TL;DR
Docs displays Markdown links, but its editor has no working activation path for them. The actual plugin component renders a relative document link, yet clicking it does not call the existing Docs navigation API. An HTTPS link likewise never reaches bb's URL opener, even with Control or Command held. Tiptap's built-in link opening is explicitly disabled, and no replacement click handler or document-navigation callback is supplied to the editor. Six focused interaction checks fail in each of two clean trusted checkouts with production code unchanged.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| Relative Markdown links do not open another vault document. | Verified | The real Docs panel renders the link. Plain, Control, and Command clicks each leave navigation calls empty. |
| External HTTPS links also do nothing. | Verified at the plugin boundary | The real inline Docs card renders the link. All three click variants fail to call the existing URL-opening capability. No external destination is fetched. |
| Link opening is disabled without a replacement handler. | Verified | Trusted editor configuration and parent-to-editor prop flow, linked below. |
| The same issue occurs in released macOS and Connect sessions. | Unverified directly | This run exercises the common client component on Linux, not a packaged macOS release or a live Connect deployment. |
| Direct navigation and vault reads work. | Partially verified | Repository navigation contracts already expose Docs panel routing; this focused reproduction supplies synthetic RPC responses, not a real vault or server. |
3. Environment
- Public target repository: get-bb/bb. Both clean worktrees start at the full trusted base commit above.
- Linux x86_64, kernel 4.19.0-gvisor; Node v22.19.0; pnpm 9.15.0; bundled Docs package 0.2.3.
- Reproduction layer: Vitest, jsdom, React Testing Library, and the repository's plugin test runtime. Real Docs/Tiptap rendering; only external RPC data and the URL host capability are supplied by the test harness. No database mock is used.
- First checkout:
/tmp/slopcop-7865/base. Second checkout:/tmp/slopcop-7865/verify. Each gets its own frozen installation and generated build outputs. - No agent/provider calls, live server, listening ports, application data directory, real vault, or credentials are needed or accessed. This is an interaction bug, not a visual-rendering defect; evidence is executable navigation assertions rather than a screenshot.
4. Minimal reproduction
The supplied patch adds six tests to the existing test owner, without changing production code. Test fixtures were derived from trusted repository interfaces, not copied from the issue's shell recipe.
- Create a clean checkout at the recorded commit and enter it.
- Install and build the SDK and affected plugin using the normal repository toolchain:
pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@get-bb/plugin-sdk --filter=bb-plugin-simple-notes
- Insert the six test cases shown below into the existing
describe("Docs nav panel", ...)block inplugins/docs/app.test.tsx. They use that file's existing helpers. Then run:pnpm exec turbo run test --filter=bb-plugin-simple-notes -- app.test.tsx -t 'document links'
- Observe that all six link-activation assertions fail on unchanged production code. Both link elements exist before the test clicks them.
Expected: the relative link calls toPluginPanel("docs", {subPath: "personal/articles/reference.md", replace: false}); the external link calls openUrl with its HTTPS URL. Actual excerpts, with only ANSI formatting removed:
AssertionError: expected [] to deep equally contain { method: 'toPluginPanel', …(2) }
+ Received:
[]
AssertionError: expected [] to deep equally contain { method: 'openUrl', …(1) }
Test Files 1 failed (1)
Tests 6 failed | 44 skipped (50)
Raw logs and the exact patch are retained as local investigation evidence, not published. The full regression bodies are inline so this page is sufficient to repeat the test:
it.each([
{ name: "plain", modifiers: {} },
{ name: "Control", modifiers: { ctrlKey: true } },
{ name: "Command", modifiers: { metaKey: true } },
])("follows document links with a $name click", async ({ modifiers }) => {
const slot = renderSlot(
docsRegistration,
{ subPath: "personal/articles/start.md" },
{
rpc: {
listNotes: () =>
listNotesResult([
{ path: "articles/start.md", title: "Start", preview: "", modifiedAtMs: 1 },
]),
readDocument: () =>
documentResult("articles/start.md", "[Reference](reference.md)"),
},
},
);
const link = await slot.findByRole("link", { name: "Reference" });
fireEvent.click(link, modifiers);
expect(slot.navigateCalls).toContainEqual({
method: "toPluginPanel",
path: "docs",
options: { subPath: "personal/articles/reference.md", replace: false },
});
});
it.each([
{ name: "plain", modifiers: {} },
{ name: "Control", modifiers: { ctrlKey: true } },
{ name: "Command", modifiers: { metaKey: true } },
])("opens external document links with a $name click", async ({ modifiers }) => {
const slot = renderDocument("articles/start.md", "Start", {
openUrl: () => true,
rpc: {
readDocument: () =>
documentResult(
"articles/start.md",
"[Website](https://www.iana.org/domains/reserved)",
),
},
});
const link = await slot.findByRole("link", { name: "Website" });
fireEvent.click(link, modifiers);
expect(slot.navigateCalls).toContainEqual({
method: "openUrl",
url: "https://www.iana.org/domains/reserved",
});
});
5. Root cause
The Tiptap initialization registers Link.configure({ openOnClick: false, autolink: true }). Its editor props handle Escape, image paste, and image drop, but provide no link click handler. The editor receives document path and preview context but no callback for following another vault document. Links therefore remain editable content without triggering application navigation.
Link.configure({ openOnClick: false, autolink: true })
NotePane already receives an onOpen callback, but only invokes it after saving a copy. It does not pass that callback through SavedDocumentEditor to TiptapEditor. Merely enabling Tiptap's default opening would not repair vault-relative routing: relative URLs need the document's directory and vault, not the page's browser URL.
The app's existing URL-opening capability already owns desktop/browser preferences. The fix should use it rather than introducing a second opener. The issue is in plugin client wiring, not daemon transport, vault storage, or permissions.
6. Proposed fix
Add one shared editor click handler. Resolve supported relative Markdown document paths against the current note directory and call the existing vault navigation callback; pass that callback from the vault panel and inline/thread document surfaces. Send HTTP(S) URLs through useBbNavigate().openUrl. Read current callbacks through refs so a mounted editor does not retain stale navigation state. Preserve right-click editing/context-menu behavior. Keep fragment/query handling and relative links outside vault-backed contexts out of this narrow repair.
Focused coverage should exercise all three vault-backed surfaces, ordinary/Control/Command clicks, parent and nested directories, URL-encoded filenames, unsupported hrefs, and context-menu clicks. No dependency, public API, protocol, schema, storage, or authorization change is needed.
7. Verification
The same agent repeated the reproduction in a second clean checkout; this is not an independent review. The second checkout was created directly from the recorded trusted commit, installed with a frozen lockfile, and built the SDK and Docs plugin through Turbo. Only the six-test reproduction patch was added before the command above ran.
Second clean checkout: /tmp/slopcop-7865/verify Trusted base: 1ed5e771bbee1d050c6654b52a7aff05b7cd3d59 Command: pnpm exec turbo run test --filter=bb-plugin-simple-notes -- app.test.tsx -t 'document links' Result: 6 failed | 44 skipped (50) Production changes during reproduction: none
Both final runs support the same mechanism. An initial test draft accidentally selected the navigation-only sidebar rather than the document panel; that draft was corrected before either final recorded run. No report claim relies on it. Native macOS launch, real tab creation, live Connect routing, filesystem reads, and fragment scrolling were not directly verified.
Fix validation
The contained repair adds a single activation handler in the shared editor and passes existing vault-navigation callbacks through the existing component hierarchy. A shared regression contract covers the workspace editor, thread document panel, and inline document card, including modifier clicks, parent/nested paths, encoded filenames, unsupported links, and context menus. The initial six checks pass after the repair; the final affected package suite passes all 172 tests across seven files. Build, typecheck, and lint also pass through Turbo; lint reports five pre-existing warnings and no errors.
pnpm exec turbo run test lint typecheck build --filter=bb-plugin-simple-notes
Test Files 7 passed (7)
Tests 172 passed (172)
Tasks: 11 successful, 11 total
The verification inventory command reports pre-existing drift for an unrelated diagnostics CLI family. No inventory or unrelated product code is changed. A live development instance was not launched for this focused client-event repair.
8. Related issues and pull requests
No linked open pull request was present in issue cross-reference metadata or the open-PR search when checked. #3594 proposes a broader Docs reading mode. #6274 concerns fragment navigation in the separate file preview. Neither substitutes for this editor activation reproduction.
9. Appendix
Baseline existing app suite: 44 passed before adding the reproduction. The first all-repository build stopped because an unrelated plugin needed SDK runtime build outputs that did not yet exist. Building the SDK explicitly through Turbo repaired that environment prerequisite; the second checkout's SDK + Docs build passed. No dependency was added.
Investigation commands included trusted-main fetch and full-SHA checks, GitHub issue/type/field/label metadata reads, linked-PR searches, source/history inspection, two frozen installations, SDK/Docs builds, and the test commands documented above. No command, link destination, branch, or executable supplied by the issue was executed. Issue contents were treated only as untrusted claims; the issue's suggested shell recipe was not run.
Artifacts are restricted to synthetic test fixtures and test output. The external URL is only a test value; it was not fetched.