Skip to content

Add Open in Wiki Site to the Explorer and editor-tab right-click menus - #55

Merged
AlexJSully merged 2 commits into
mainfrom
ajs-261212-missed
Nov 12, 2026
Merged

AlexJSully merged 2 commits into
mainfrom
ajs-261212-missed

Conversation

@AlexJSully

@AlexJSully AlexJSully commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Right-clicking a wiki file in the Explorer or on its editor tab now offers Open in Wiki Site. Before this change, the item was only on the Workspace Wiki sidebar's right-click menu.

The item shows only for files the wiki indexes. Each wiki scan sets the workspaceWiki.indexedFiles context key to the scanned file URIs, and the new menu entries test resource in workspaceWiki.indexedFiles.

Before the first scan, the item shows for every Markdown file. Choosing it for a file outside the wiki opens the site's existing "This page is not part of the wiki." message.

brag.mp4

Each wiki scan publishes its files as the workspaceWiki.indexedFiles
context key, and the new explorer/context and editor/title/context
entries show only for files in it. Before the first scan they show for
every Markdown file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An older scan can overwrite the newer menu index, and the tests do not verify Explorer or editor-tab visibility in VS Code.

2 open issues
What changed in this PR

Adds Open in Wiki Site to the Explorer and editor-tab context menus, extending the existing Workspace Wiki sidebar action.

Changes:

  • Publishes indexed file URIs after each wiki tree load to control menu visibility.
  • Adds both menu entries with a Markdown fallback before the first scan.
  • Adds context-publication unit tests and updates user and architecture documentation.
File Description
src/​tree/​loadWikiTree.ts Publishes indexed file URIs as a VS Code context key.
src/​tree/​loadWikiTree.test.ts Tests populated and empty context indexes.
README.md Documents the additional menu locations.
package.json Adds Explorer and editor-tab menu contributions.
docs/​usage/​tutorials.md Updates instructions for opening individual files.
docs/​architecture/​wiki-site.md Explains menu visibility and the pre-scan fallback.

Review effort: Balanced

Comment thread package.json
"explorer/context": [
{
"command": "workspace-wiki.openInSite",
"when": "!explorerResourceIsFolder && (resource in workspaceWiki.indexedFiles || (!workspaceWiki.indexedFiles && resourceLangId == markdown))",
Comment thread src/tree/loadWikiTree.ts Outdated
const tree = await buildTree(uris, directorySort, acronyms);

const indexedFiles = Object.fromEntries(flattenFiles(tree).map((node) => [node.uri.toString(), true]));
void vscode.commands.executeCommand('setContext', INDEXED_FILES_CONTEXT, indexedFiles);
The sidebar and the site each run loadWikiTree, so two scans can overlap. Only the most recently started scan now sets workspaceWiki.indexedFiles, so a slower, older scan cannot overwrite a newer file list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AlexJSully
AlexJSully merged commit f09b4c9 into main Nov 12, 2026
2 checks passed
@AlexJSully
AlexJSully deleted the ajs-261212-missed branch November 12, 2026 12:10
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.

2 participants