build.sh: improve regexp quick window patch regexp readibility (#420)

* build.sh: improve regexp quick window patch regexp readibility

* docs(readme): credit @Andrej730 for quick-window regex readability

Co-Authored-By: Claude <claude@anthropic.com>

---------

Co-authored-by: aaddrick <aaddrick@gmail.com>
Co-authored-by: Claude <claude@anthropic.com>
This commit is contained in:
Andrej730
2026-04-27 18:18:45 +05:00
committed by GitHub
parent ea9b8aa0ab
commit 31c557acca
2 changed files with 4 additions and 2 deletions

View File

@@ -243,6 +243,7 @@ Special thanks to:
- **[davidamacey](https://github.com/davidamacey)** for identifying and fixing the XRDP GPU compositing blank-window issue on remote desktop sessions
- **[pb3ck](https://github.com/pb3ck)** for diagnosing the Cowork `CLAUDE_CODE_OAUTH_TOKEN` env-strip bug with a working reference diff
- **[aJV99](https://github.com/aJV99)** for exporting `GDK_BACKEND=wayland` in native Wayland mode to fix XWayland fallback blur on HiDPI displays
- **[Andrej730](https://github.com/Andrej730)** for the quick-window regex readability refactor (`String.raw` + `escapeRegExp` helper)
## Sponsorship

View File

@@ -84,6 +84,7 @@ const anchors = [
'Navigating to existing chat',
'Creating new chat with submit_quick_entry',
];
const escapeRegExp = s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
for (const anchor of anchors) {
const anchorIdx = code.indexOf(anchor);
if (anchorIdx === -1) {
@@ -98,9 +99,9 @@ for (const anchor of anchors) {
anchor.substring(0, 30) + '..."');
continue;
}
// matches: <focusFn>()||(someVar).show()
const showRe = new RegExp(
focusFn.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') +
'\\(\\)\\|\\|(\\w+)\\.show\\(\\)'
escapeRegExp(focusFn) + String.raw`\(\)\|\|(\w+)\.show\(\)`
);
const showMatch = region.match(showRe);
if (showMatch) {