Skip to content

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

Merged
teezeit merged 1 commit into
mainfrom
feat/vscode-md-navigation-and-panel-fix
Apr 17, 2026
Merged

feat(vscode): .md link navigation and stale panel fix#7
teezeit merged 1 commit into
mainfrom
feat/vscode-md-navigation-and-panel-fix

Conversation

@teezeit
Copy link
Copy Markdown
Owner

@teezeit teezeit commented Apr 17, 2026

Summary

vscode-plugin-navigation.mp4
  • .md link navigation — clicking <a href="*.md"> links in the preview switches the editor to that file in the same column instead of opening a new 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).

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 merged commit e157d68 into main Apr 17, 2026
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