Compare commits

...
5 changed files with 25 additions and 4 deletions

No files matched your search

@@ -0,0 +1,5 @@
- Keep single-key app shortcuts off Cmd, Ctrl and Alt combinations, so Cmd+F,
Cmd+C and Cmd+R reach the browser instead of hiding the layer panel or
switching layers on. `F` now collapses the layer panel the way its button
does, instead of hiding the panel and the button that brings it back
(asturksever, #1598).
+1
View File
@@ -542,6 +542,7 @@ export class StyleManager extends ShellFacade {
_toggleOrbit: (...args) => this._toggleOrbit(...args),
toggleCleanView: (...args) => this.toggleCleanView(...args),
_toggleCctvEnabled: (...args) => this._toggleCctvEnabled(...args),
_togglePanel: (panelId) => this._panelChrome._togglePanel(panelId),
_setBloomEnabled: (...args) => this._setBloomEnabled(...args),
_setBloomIntensity: (...args) => this._setBloomIntensity(...args),
_setSharpenEnabled: (...args) => this._setSharpenEnabled(...args),
+5
View File
@@ -27,6 +27,11 @@ export function bindApplicationShortcuts({
event.target?.matches?.('select, input, textarea') ||
event.target === searchInput;
if (isFormControl && event.key !== 'Escape') return;
// Browser and OS shortcuts (Cmd+C, Ctrl+F, Alt+1…) are not ours.
if (event.metaKey || event.ctrlKey || event.altKey) {
if (event.key === 'Escape') actions.dismissSearch();
return;
}
if (STYLE_KEYS[event.key]) actions.setStyle(STYLE_KEYS[event.key]);
if (event.key === 'Escape') actions.dismissSearch();
+2 -2
View File
@@ -64,8 +64,8 @@ export class DisplayBindings {
},
toggleOrbit: () => this._toggleOrbit(),
toggleCleanView: () => this.toggleCleanView(),
toggleLayers: () =>
document.getElementById('data-panel').classList.toggle('active'),
// Same collapse as the panel's own button, so its rail entry stays.
toggleLayers: () => this._togglePanel('data-panel'),
cycleDetection: () => {
this.shareLinkManager?.claimRestoreLane?.('visual');
this.claimDetection();
+12 -2
View File
@@ -117,9 +117,19 @@ test('the supplied search target retains editing even without form markup', () =
assert.deepEqual(f.calls, [['dismissSearch']]);
});
test('shortcut extraction does not change repeat or modifier policy', () => {
test('browser shortcuts with Cmd, Ctrl or Alt never reach app shortcuts', () => {
const f = shortcuts();
f.press('h', new Element(), { repeat: true, ctrlKey: true });
for (const modifier of ['metaKey', 'ctrlKey', 'altKey'])
for (const key of ['1', 'h', 'o', 'v', 'f', 'd', 'c'])
f.press(key, new Element(), { [modifier]: true });
assert.deepEqual(f.calls, []);
f.press('Escape', new Element(), { metaKey: true });
assert.deepEqual(f.calls, [['dismissSearch']]);
});
test('a held key still repeats its shortcut', () => {
const f = shortcuts();
f.press('h', new Element(), { repeat: true });
assert.deepEqual(f.calls, [['toggleHud']]);
});