Restore Linux desktop settings section metadata#689
Conversation
|
Thanks Ivan, this looks good on my side. I rechecked the patch against the Linux desktop settings route/section cases, including the same-asset composition case this PR is fixing. The behavior I see in the tests matches the improvement you are making: the route patch and the section metadata patch now compose cleanly instead of one write losing the other. The checks I ran are green on the PR head:
|
| if (!patchedArrayOrderPattern.test(patchedSource)) { | ||
| const arrayInsertPattern = /([A-Za-z_$][\w$]*=\[`general-settings`,)(?!`linux-desktop`)/; | ||
| if (arrayInsertPattern.test(patchedSource)) { | ||
| patchedSource = patchedSource.replace(arrayInsertPattern, "$1`linux-desktop`,"); |
There was a problem hiding this comment.
This is an auto review done by revuto.
This patch helper still applies the section metadata insertions with one-shot replace() calls (same pattern below for the split order and slug list). The repo invariant for ASAR bundle patches is that helpers either process every eligible occurrence or explicitly assert the needle is unique: these webview chunks are concatenated, so once the first occurrence is patched the later patched*Pattern checks become true and any second unpatched section-order/slug-list occurrence in the same asset is silently left behind. Please iterate/count matches (or assert uniqueness for each shape) before returning.
Summary
app-initial~app-main~automations-pagebundle carrying both route and section metadataValidation
PATH=/run/current-system/sw/bin:$PATH node --test scripts/patch-linux-window-ui.test.js --test-name-pattern 'Linux desktop|Keyboard Shortcuts|settings route|section'PATH=/run/current-system/sw/bin:$PATH node --test scripts/patch-linux-window-ui.test.jsPATH=/run/current-system/sw/bin:$PATH nix build .#codex-desktop-computer-use-ui-remote-mobile-control --no-link --print-out-paths/nix/store/97xy72qqhz4xjhiyljwzxlkx2c387s10-codex-desktop-computer-use-ui-remote-mobile-control-26.623.101652: webview assets includeslug:\linux-desktop`inapp-initialapp-mainautomations-page-Bl6HoLGr.jsand still referencelinux-desktop-settings-linux.js`