From 90f1ba69b2b3df0df1cc3c553904954a659f1cb1 Mon Sep 17 00:00:00 2001 From: Bharat Middha <5100938+bmiddha@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:26:05 -0700 Subject: [PATCH 1/2] fix(rush-serve): preserve text select-all Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- apps/rush-serve-dashboard/src/modules/mainBar.ts | 10 +++++++++- .../src/test/actionWiring.test.ts | 14 +++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/apps/rush-serve-dashboard/src/modules/mainBar.ts b/apps/rush-serve-dashboard/src/modules/mainBar.ts index fd05d76114..d4a8b216a0 100644 --- a/apps/rush-serve-dashboard/src/modules/mainBar.ts +++ b/apps/rush-serve-dashboard/src/modules/mainBar.ts @@ -20,6 +20,14 @@ export interface IMainBarActionWiringOptions { render: () => void; } +function isTextEditingTarget(target: EventTarget | undefined): boolean { + return ( + target instanceof HTMLInputElement || + target instanceof HTMLTextAreaElement || + (target instanceof HTMLElement && target.isContentEditable) + ); +} + export function wireMainBarActions(options: IMainBarActionWiringOptions): void { const { connect, @@ -94,7 +102,7 @@ export function wireMainBarActions(options: IMainBarActionWiringOptions): void { } window.addEventListener('keydown', (e: KeyboardEvent) => { - if (e.key === 'a' && (e.metaKey || e.ctrlKey)) { + if (e.key === 'a' && (e.metaKey || e.ctrlKey) && !isTextEditingTarget(e.target ?? undefined)) { e.preventDefault(); setSelection(new Set(getOperationNames())); render(); diff --git a/apps/rush-serve-dashboard/src/test/actionWiring.test.ts b/apps/rush-serve-dashboard/src/test/actionWiring.test.ts index 27d3559bbc..7493402b51 100644 --- a/apps/rush-serve-dashboard/src/test/actionWiring.test.ts +++ b/apps/rush-serve-dashboard/src/test/actionWiring.test.ts @@ -65,7 +65,7 @@ describe('action wiring', () => { it('wires manager commands and keyboard selection', () => { document.body.innerHTML = - ''; + ''; const debugBtn: HTMLButtonElement = document.createElement('button'); const verboseBtn: HTMLButtonElement = document.createElement('button'); const parallelismInput: HTMLInputElement = document.createElement('input'); @@ -100,6 +100,18 @@ describe('action wiring', () => { verboseBtn.click(); parallelismInput.dispatchEvent(new Event('change')); playPauseBtn.click(); + const textField: HTMLInputElement = document.getElementById('name-search') as HTMLInputElement; + const textFieldSelectAllEvent: KeyboardEvent = new KeyboardEvent('keydown', { + key: 'a', + ctrlKey: true, + bubbles: true, + cancelable: true + }); + textField.dispatchEvent(textFieldSelectAllEvent); + expect(textFieldSelectAllEvent.defaultPrevented).toBe(false); + expect(setSelection).not.toHaveBeenCalled(); + expect(render).not.toHaveBeenCalled(); + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'a', ctrlKey: true })); window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' })); From 24508b324a24e243f0e3925ea952956c14f63153 Mon Sep 17 00:00:00 2001 From: Bharat Middha <5100938+bmiddha@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:26:58 -0700 Subject: [PATCH 2/2] chore(rush-serve): add change file Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ...serve-dashboard-select-all_2026-08-07-15-26-00.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@microsoft/rush/rush-serve-dashboard-select-all_2026-08-07-15-26-00.json diff --git a/common/changes/@microsoft/rush/rush-serve-dashboard-select-all_2026-08-07-15-26-00.json b/common/changes/@microsoft/rush/rush-serve-dashboard-select-all_2026-08-07-15-26-00.json new file mode 100644 index 0000000000..633261c271 --- /dev/null +++ b/common/changes/@microsoft/rush/rush-serve-dashboard-select-all_2026-08-07-15-26-00.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Allow Ctrl+A and Command+A to select text in Rush serve dashboard fields.", + "type": "patch" + } + ], + "packageName": "@microsoft/rush" +}