Repository navigation
Escape index tooltips and disable unnecessary Markdown command trust - #996
Merged
Tomasz Naumowicz (tnaum-ms) merged 2 commits intoOct 12, 2026
Merged
Conversation
… trust Render index and shard-key metadata as literal text and safe code spans, and turn off command trust, HTML, and theme icons where tooltips do not need them. Operator documentation keeps its HTTP(S) links and HTML setting without command trust. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Tomasz Naumowicz (tnaum-ms)
force-pushed
the
dev/tnaum/tooltips-issue
branch
from
October 9, 2026 14:43
94811bc to
2a0ba73
Compare
Tomasz Naumowicz (tnaum-ms)
marked this pull request as ready for review
October 9, 2026 14:44
Contributor
✅ Code Quality Checks
This comment is updated automatically on each push. |
Contributor
📦 Build Size Report
Download artifact · updated automatically on each push. |
Tomasz Naumowicz (tnaum-ms)
changed the base branch from
main
to
release/0.11.1
October 12, 2026 05:13
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The least-privilege Markdown changes are consistent, comprehensively tested, and have no identified unresolved defects.
0 open findings
What changed in this PR
Secures Markdown tooltips by escaping database-derived content and removing unnecessary command trust.
Changes:
- Adds safe prose and inline-code formatting helpers.
- Hardens index, collection, hover, and completion Markdown.
- Adds regression tests and documents the escaping policy.
Case 2 applies; the PR reports all applicable checks passed.
| File | Description |
|---|---|
src/webviews/utils/escapeMarkdown.ts |
Adds URL and inline-code escaping. |
src/webviews/utils/escapeMarkdown.test.ts |
Tests escaping helpers. |
src/webviews/query-language-support/documentdbQueryHoverProvider.ts |
Disables hover command trust. |
src/webviews/query-language-support/documentdbQueryHoverProvider.test.ts |
Tests safe link rendering. |
src/webviews/query-language-support/documentdbQueryCompletionProvider.test.ts |
Verifies untrusted completion docs. |
src/webviews/query-language-support/completions/mapCompletionItems.ts |
Disables completion command trust. |
src/tree/documentdb/IndexItem.ts |
Hardens index tooltip rendering. |
src/tree/documentdb/IndexItem.test.ts |
Adds tooltip security regressions. |
src/tree/documentdb/CollectionItem.ts |
Safely formats shard keys. |
src/tree/documentdb/CollectionItem.test.ts |
Tests backtick-containing shard keys. |
src/plugins/service-atlas-mongodb/discovery-tree/AtlasProjectItem.test.ts |
Updates colon-escaping expectations. |
src/documentdb/query-language/playground-completions/tdd/hoverAndEdgeCases.test.ts |
Tests Playground Markdown policy. |
src/documentdb/query-language/playground-completions/PlaygroundHoverProvider.ts |
Shares escaping and disables trust. |
docs/ai-and-plans/README.md |
Registers the escaping feature. |
docs/ai-and-plans/features/escaping/README.md |
Documents active escaping policy. |
docs/ai-and-plans/features/escaping/iterations/01-markdown-tooltips.md |
Records implementation and validation. |
docs/ai-and-plans/features/escaping/iterations/01-markdown-tooltips-review.md |
Records review outcomes. |
docs/ai-and-plans/features/completions-and-schema/README.md |
Updates completion Markdown policy. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Render database-derived tooltip metadata as literal, readable content and remove unnecessary Markdown capabilities (command trust, HTML, theme icons) from index tooltips and operator documentation.
Why and Changes
Index metadata should never become active Markdown. Index tooltips now disable command trust, HTML, and theme icons, escape dynamic text, and delimit inline code and JSON safely, including values that contain backticks or newlines. The database models and stored names are unchanged.
escapeMarkdownnow also escapes:, so a barehttps://…value cannot become a GFM autolink. This applies to every caller of the shared helper.formatInlineCodehelper is used for index keys, the index type badge, and collection shard keys.escapeMarkdowninstead of its own copy.Validation
Full pre-review (Case 2) checks passed on 2026-10-09:
npm run prettier-fixnpm run lintnpm run buildnpm run packagenpm run l10nwas not needed because no localized strings changed.The renderer test was also run separately under jsdom with real Monaco, and all 19 hover tests passed. The operator manually confirmed that Collection View and Playground hovers and completion details, with their clickable HTTPS documentation links, the index tooltip, and database-field hovers all work as before.
Feature Documentation
Target milestone:
0.11.1.