Skip to content

feat(vscode): .md link navigation and stale panel fix#84

Open
teezeit wants to merge 1 commit intoakonan:mainfrom
teezeit:feat/vscode-md-navigation-and-panel-fix
Open

feat(vscode): .md link navigation and stale panel fix#84
teezeit wants to merge 1 commit intoakonan:mainfrom
teezeit:feat/vscode-md-navigation-and-panel-fix

Conversation

@teezeit
Copy link
Copy Markdown
Contributor

@teezeit teezeit commented Apr 17, 2026

Summary

vscode-plugin-navigation.mp4
  • .md link navigation — clicking <a href="*.md"> links in the preview now switches the editor to that file (in the same column) instead of opening a browser tab. Supports relative and absolute hrefs; absolute paths walk up the directory tree to locate the target.
  • Stale panel on restoredeserializeWebviewPanel now registers onDidDispose to clear this.panel, matching what createOrShowPreview already does. Prevents stale references after VS Code restart.
  • esbuild bundle — switched vscode:prepublish from plain tsc to an esbuild bundle so wiremd is inlined into the VSIX. Without this the extension silently failed to activate (status bar button missing).

Dependencies

This PR is independent of the parser/renderer PRs (#78#83) — all changes are purely VS Code extension-side. However, merging after those PRs is recommended so the bundled VSIX includes all latest wiremd features.

Test plan

  • Open a wiremd file with a [Label](other.md) link, open the preview, click the link — editor switches to other.md in the same column, preview updates
  • Try an absolute-path link (/pages/other.md) — resolves correctly from any directory depth
  • Close VS Code with a preview open, reopen — panel disposes cleanly on reload
  • Install the VSIX on a clean machine — status bar button appears

🤖 Generated with Claude Code

- Intercept <a href="*.md"> clicks in the webview and post a navigate
  message so clicking a link switches the editor to that file instead
  of opening a browser URL
- Add resolveLink() supporting both relative and absolute hrefs;
  absolute paths walk up the directory tree to find the target file
- showTextDocument uses the current editor's viewColumn so the file
  replaces in-place rather than opening a new tab
- Register onDidDispose in deserializeWebviewPanel (mirrors the
  createOrShowPreview path) so restored panels clean up correctly
- Switch vscode:prepublish from tsc to esbuild bundle so wiremd is
  inlined into the VSIX and the extension activates correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@teezeit teezeit force-pushed the feat/vscode-md-navigation-and-panel-fix branch from 471a6e4 to 72ede83 Compare April 17, 2026 22:31
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.

1 participant