···25522552 const detectedMode = detectModeFromUrl(url);
25532553 const currentEntry = getContextEntry('mode', windowId);
2554255425552555- // Don't override group mode with page mode (group mode persists)
25562556- if (currentEntry?.value === 'space' && detectedMode === 'page') {
25572557- DEBUG && console.log('main', `Preserving space mode for window ${windowId} during navigation`);
25552555+ // Don't override space/group mode with page mode — they persist through navigation
25562556+ if (
25572557+ (currentEntry?.value === 'space' || currentEntry?.value === 'group') &&
25582558+ detectedMode === 'page'
25592559+ ) {
25602560+ DEBUG && console.log('main', `Preserving ${currentEntry.value} mode for window ${windowId} during navigation`);
25582561 return;
25592562 }
25602563
+3-3
tests/unit/cmd-state-machine.test.js
···227227 assert.equal(machine.getState(), States.PARAM_MODE);
228228 });
229229230230- it('TYPING + Tab with params but partial text -> TYPING (complete name first)', () => {
230230+ it('TYPING + Tab with params on partial text -> PARAM_MODE (complete name and enter params)', () => {
231231 machine.getMutableData().matches = ['kagi'];
232232 machine.getMutableData().typed = 'ka';
233233 machine.getMutableData().commands = {
···237237 commandName: 'kagi',
238238 hasParams: true
239239 });
240240- // Should stay in TYPING — complete the name, don't enter param mode yet
241241- assert.equal(machine.getState(), States.TYPING);
240240+ // Should enter PARAM_MODE — Tab both completes the name AND enters param mode in one action
241241+ assert.equal(machine.getState(), States.PARAM_MODE);
242242 assert.equal(result.handled, true);
243243 });
244244