fix(keybindings): migrate to namespaced ids closes #2391

This commit is contained in:
Mario Zechner
2026-03-20 01:50:47 +01:00
parent 74a46fc7ea
commit e3fee7a511
43 changed files with 1077 additions and 883 deletions

View File

@@ -1,4 +1,4 @@
import { DEFAULT_EDITOR_KEYBINDINGS, EditorKeybindingsManager, setEditorKeybindings } from "@mariozechner/pi-tui";
import { setKeybindings } from "@mariozechner/pi-tui";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { KeybindingsManager } from "../src/core/keybindings.js";
import type { SessionInfo } from "../src/core/session-manager.js";
@@ -34,13 +34,13 @@ describe("session selector rename", () => {
});
beforeEach(() => {
// Ensure test isolation: editor keybindings are a global singleton
setEditorKeybindings(new EditorKeybindingsManager(DEFAULT_EDITOR_KEYBINDINGS));
// Ensure test isolation: keybindings are a global singleton
setKeybindings(new KeybindingsManager());
});
it("shows rename hint in interactive /resume picker configuration", async () => {
const sessions = [makeSession({ id: "a" })];
const keybindings = KeybindingsManager.inMemory();
const keybindings = new KeybindingsManager();
const selector = new SessionSelectorComponent(
async () => sessions,
async () => [],
@@ -59,7 +59,7 @@ describe("session selector rename", () => {
it("does not show rename hint in --resume picker configuration", async () => {
const sessions = [makeSession({ id: "a" })];
const keybindings = KeybindingsManager.inMemory();
const keybindings = new KeybindingsManager();
const selector = new SessionSelectorComponent(
async () => sessions,
async () => [],
@@ -80,7 +80,7 @@ describe("session selector rename", () => {
const sessions = [makeSession({ id: "a", name: "Old" })];
const renameSession = vi.fn(async () => {});
const keybindings = KeybindingsManager.inMemory();
const keybindings = new KeybindingsManager();
const selector = new SessionSelectorComponent(
async () => sessions,
async () => [],