mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 06:59:42 +02:00
fix(review): preserve shortcutOverrides across settings saves + keep help modal reachable (PR #146)
- saveAppSettings() rebuilds settings from the DOM; carry over shortcutOverrides like showTokenCount/showCost so rebinding survives unrelated saves - shortcut overlay footer links to the full help modal (its only opener was the legacy Ctrl+? route this PR replaced) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,22 @@ describe('shortcut registry and overlay', () => {
|
||||
expect(css).toContain('.shortcut-capture-btn,');
|
||||
expect(css).toContain('.shortcut-overlay-row {');
|
||||
});
|
||||
|
||||
it('saveAppSettings preserves shortcutOverrides (rebuilt-from-DOM saves must not wipe them)', () => {
|
||||
// Same trap as showTokenCount/showCost: saveAppSettings() rebuilds the settings
|
||||
// object fresh from the DOM, so keys edited elsewhere (the Shortcuts tab) must be
|
||||
// explicitly carried over from the previously stored blob.
|
||||
expect(settingsSource).toContain(
|
||||
'if (_prev.shortcutOverrides !== undefined) settings.shortcutOverrides = _prev.shortcutOverrides;'
|
||||
);
|
||||
});
|
||||
|
||||
it('keeps the full help modal reachable now that Ctrl+? opens the registry overlay', () => {
|
||||
// The legacy #helpModal (full shortcut reference) lost its only opener when
|
||||
// Ctrl+? was rerouted to the overlay; the overlay footer must link to it.
|
||||
expect(htmlSource).toContain('shortcut-overlay-footer');
|
||||
expect(htmlSource).toContain('app.closeShortcutOverlay(); app.showHelp()');
|
||||
});
|
||||
});
|
||||
|
||||
// ─── Functional coverage (vm-sandbox harness, mirrors run-mode-ui.test.ts) ────
|
||||
|
||||
Reference in New Issue
Block a user