Skip to content

Restore Linux desktop settings section metadata#689

Open
colonelpanic8 wants to merge 1 commit into
ilysenko:mainfrom
colonelpanic8:colonelpanic/fix-linux-desktop-section-metadata
Open

Restore Linux desktop settings section metadata#689
colonelpanic8 wants to merge 1 commit into
ilysenko:mainfrom
colonelpanic8:colonelpanic/fix-linux-desktop-section-metadata

Conversation

@colonelpanic8

Copy link
Copy Markdown
Contributor

Summary

  • compose keybinds/Linux desktop webview asset patches per file so route/navigation writes do not overwrite section metadata writes
  • tighten Linux desktop section metadata idempotence so split section-order and slug-list shapes are both verified
  • add regression coverage for the current app-initial~app-main~automations-page bundle carrying both route and section metadata

Validation

  • 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.js
  • PATH=/run/current-system/sw/bin:$PATH nix build .#codex-desktop-computer-use-ui-remote-mobile-control --no-link --print-out-paths
  • inspected generated package /nix/store/97xy72qqhz4xjhiyljwzxlkx2c387s10-codex-desktop-computer-use-ui-remote-mobile-control-26.623.101652: webview assets include slug:\linux-desktop`inapp-initialapp-mainautomations-page-Bl6HoLGr.jsand still referencelinux-desktop-settings-linux.js`

@Yo-DDV

Yo-DDV commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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:

  • git diff --check origin/main...HEAD
  • node --test --test-name-pattern 'Linux desktop|Keyboard Shortcuts|settings route|section' scripts/patch-linux-window-ui.test.js
  • node --test scripts/patch-linux-window-ui.test.js
  • node --check on the touched JS files

@avifenesh avifenesh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is an auto review done by revuto.


Found one ASAR patch-helper invariant issue.

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`,");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

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.

3 participants