Repository navigation
Fix manifest editor: repeated elements, CDATA, UWP-only SupportsMultipleInstances, image path probing - #394
Open
Chiara Mooney (chiaramooney) wants to merge 18 commits into
Open
Chiara Mooney (chiaramooney) wants to merge 18 commits into
Chiara Mooney (chiaramooney) wants to merge 18 commits into
Conversation
… image path probing - Target repeated extension child elements by element path and label them (Task[2].Type) (#128, #151, #289) - Preserve CDATA sections when editing text content (#152) - Only offer SupportsMultipleInstances for UWP apps; warn when set on desktop apps (#263) - Never inspect webview-supplied image paths outside the package/workspace; copy them only via a native picker (#167) - Fix extension-field validation routing regex that emitted 'd' instead of '\d' Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
VSIX Build
Updated 2026-12-01 23:18:17 UTC · commit |
…py, schema-based FTA name check - applyFieldChange inserts only when the element is missing, so writing the current value no longer duplicates it - Browse copies images from outside the package/workspace into Assets; drop the second picker link - Validate FileTypeAssociation.Name against ST_FTAName instead of a stricter regex - Split '</' inside CDATA so later edits find the real closing tag - Test that repeated-element errors route to the matching input Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ances (#263) Template manifests use EntryPoint="$targetentrypoint$" with no RuntimeBehavior. The editor now reads the project file next to the manifest (UseWinUI / Windows App SDK / .wapproj vs UAP / UseUwp) and falls back to the runFullTrust capability (without a windows.fullTrustProcess helper) when no project file is recognized. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…WP detection - Extract relativeImagePathOrCopy so the Browse copy-vs-relative decision is unit tested - Live VS Code spec: a UWP project beside a template manifest keeps Supports Multiple Instances Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Chiara Mooney (chiaramooney)
marked this pull request as ready for review
November 25, 2026 17:54
…-editor-fixes # Conflicts: # package.json
… inside it Preserving CDATA (#152) let the editor write raw text such as '<Logo>' into the document, which later regex-based edits (for example the Logo field) matched instead of the real element, corrupting the manifest. Split every '<' that is not followed by whitespace, plus ']]>', across CDATA sections. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…DATA text Edits locate elements by text search, so tag-like text inside CDATA or comments could be matched instead of the real element. The provider and the save path now swap CDATA sections and comments for placeholders while edits run and restore them afterwards. CDATA the editor writes stays clean (only ']]>' is split, as XML requires), and hand-written CDATA containing the element's own closing tag no longer breaks the next edit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…aceholders - Save flush hides CDATA and comments before each change, so CDATA written by an earlier change in the same save can't be matched by a later one - One placeholder per line keeps line-based removals from reaching past multi-line comments - Processing instructions are skipped so a '<!--' inside one isn't read as a comment - Placeholders carry a per-edit nonce and restore only their own Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The hiding scan is quadratic on unclosed '<?', '<!--' or '<![CDATA['. Unparseable text is never edited, so skip the scan for it and keep each webview message linear on crafted manifests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A DOCTYPE entity value can hold unclosed '<!--', '<?' or '<![CDATA[' openers and still parse, which made the alternation regex quadratic on every webview message. Scan left to right with indexOf and remember terminators already known to be missing. Output is unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The child-element scanner ended a tag at the first '>', so a '>' inside an attribute value miscounted children and silently dropped element-path edits (main edited by first name match). Find tag ends while skipping quoted values, skip processing instructions in the nested scan, and with an element path replace text and attributes using the target's real tag bounds. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The attribute regex had no name boundary, so 'Name' could match inside 'DisplayName' or inside another attribute's quoted value. Walk the opening tag's attributes sequentially and match the exact (optionally prefixed) name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…g attributes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…line Badge and splash-screen removal deleted everything to the end of the line, which cut a multi-line comment starting on that line and could leave the manifest unparseable. Remove the element (self-closing or open/close) with its surrounding spaces, and the whole line only when nothing else is on it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…rations - Remove the LockScreen/SplashScreen that is a direct child of the app's VisualElements, using the element scanner, so look-alike names in extension metadata or a processing instruction inside the element can't be matched - Attribute matching skips only 'xmlns' and 'xmlns:*', so custom attributes like 'xmlnsMode' save Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Console apps must declare SupportsMultipleInstances (Application schema remarks), including full-trust desktop console apps such as the Python Install Manager. Don't warn about it or hide the Add button when the application declares Subsystem="console" in any namespace. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
#263 only asks the editor to stop offering the attribute for non-UWP apps. Shipped full-trust manifests (for example the Python Install Manager) declare it on windowed apps, so telling users to remove it was overreach. The Add button stays hidden for non-console desktop apps. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Description
Four manifest editor fixes:
<Task>,<uap3:Host>or<uap:FileType>overwrote the first. Each field now carries the path to its element. Labels are numbered when names repeat (Task[1].Type,Task[2].Type), and edits land on that exact element. If the document changed and the path no longer points at an element with that name, the edit is skipped.<![CDATA[...]]>(package Description, extension text such asFileType) keeps the CDATA wrapper instead of rewriting it as escaped text; only a literal]]>is split, as XML requires. The editor's edits find elements by searching the file text, so CDATA sections and comments are now hidden from that search while an edit runs. Tag-like text inside them (for exampleUse <Logo> here, or a commented-out<Capability>) can no longer be mistaken for a real element.Subsystem="console") keep the button, because they must declare the attribute. An app counts as desktop when:RuntimeBehaviorispackagedClassicApporwin32App, orEntryPointisWindows.FullTrustApplication/Windows.PartialTrustApplication; orEntryPoint="$targetentrypoint$"and the project file next to the manifest is a desktop project (UseWinUI, the Windows App SDK,WindowsPackageType, or a.wapproj). A UAP orUseUwpproject keeps it UWP; orrunFullTrustwithout awindows.fullTrustProcesshelper. UWP templates don't declarerunFullTrust.checkImagePathno longer touches disk for paths outside the manifest folder and open workspace folders. Such paths show "Image is outside the package and workspace. Use Choose file to copy it into Assets." When Choose file picks an image outside the package and workspace, it is copied intoAssets\in one step, because a package can't reference files outside it.Related fixes found along the way:
\dinside a template literal, which emits a plaind, so extension-field errors were never shown in the form. They now appear, and errors for repeated elements land on the correct input.FileTypeAssociation.Nameis validated against the schema typeST_FTANameinstead of a stricter regex that rejected valid names likemy-files.>inside an attribute value no longer confuses them) and match the exact attribute name, so editingNamecan't changeDisplayName, a namespace declaration, or text inside another attribute's value.VisualElements), so a comment or other element on the same line is kept and the manifest stays valid.Usage Example
The editor shows
Task[1].TypeandTask[2].Type. Editing the second changes only<Task Type="systemEvent" />(covered by unit tests).Related Issue
Fixes #128
Fixes #151
Fixes #152
Fixes #263
Fixes #167
Fixes #289
Type of Change
Checklist
Screenshots / Demo
Not captured yet. The webview behavior is covered by Playwright specs (
webview-state.spec.ts,applications-tab.spec.ts,project-app-kind.spec.ts).Additional Notes
Validation (local, Windows):
npm run compile-tsc: passednpm run lint: 0 errors (10 warnings, all already present)npm run test:unit: passed (1735 + 31 node tests, 40 mocha)npm run test:e2e(full suite, real VS Code) on f7d3c6b: 277 passed, 3 skipped, 3 flaky, 0 failed. The flaky tests arecan remove Square 310x310 Logo visual asset(also flaky on unmodifiedmain) and twoproperties-tabtiming tests.applications-tab,webview-stateandproject-app-kindpassed (81 passed, 1 flaky: the 310x310 test). Earlier (d8512da), the editor specs (webview-state,properties-tab,applications-tab,identity-tab,dependencies-tab,capabilities-tab,resources-tab,parse-error,project-app-kind): 165 passed, 2 flaky (same tests).project-app-kind.spec.tsfails when the project-file wiring is removed, so it guards that path.relativeImagePathOrCopy).Behavior change (#167): typing an absolute path to an image outside the workspace no longer gives a one-click "Copy to Assets" link. Use Choose file, which now copies outside images into
Assets\directly. Files inside the workspace but outside the package still get the one-click link.Project detection (#263) reads only project files in the manifest's own folder (up to 1 MB each), once when the editor opens. A manifest whose project lives elsewhere falls back to the
runFullTrustcheck.AI Description
This section is auto-generated by AI when the PR is opened or updated. To opt out, delete this entire section including the marker comments.