Make Project Management a native feature
- Move the storage and model of the plugin into src/lib/features/pm/ as pure TypeScript, so the skill can still bundle them. - Move the DOM interface onto the host menus, the shared tooltip, and the host icons. - A ribbon button opens Project Management. Board tabs keep the owner runestone.pm and the board-<hex> view IDs through view patterns. - Read only .runestone/pm/. Offer the plugin migration, with backups, for legacy notes. - A save, move, or delete reads only that card again. Watcher paths reach the feature. - Add Settings → Project Management and the projectManagement section. View states move to localStorage. - Background reads the boards from workspace.json. Remove api.backgrounds and the boards service. - Add yaml 2.9.1. Use the host markdown-it. - Move 18 plugin test files to tests/unit/features/pm/ and add native tests.
This commit is contained in:
@@ -11,6 +11,12 @@ import { TerminalSessions, type PtyRequest, type PtyTransport } from "../../../s
|
||||
import { SELECTION_ALPHA, TERMINAL_TOKENS, terminalColors } from "../../../src/lib/features/terminal/theme.ts";
|
||||
import { ANSI_COLORS } from "../../../src/lib/theme/roles.ts";
|
||||
import { SETTINGS_SECTIONS, LEGACY_KEYS } from "../../../src/lib/settings/store.ts";
|
||||
import type { ProjectManagementMigrationHost } from "../../../src/lib/features/pmSettings.ts";
|
||||
|
||||
/** A Project Management host with a section already present. */
|
||||
function presentProjectManagement(): ProjectManagementMigrationHost {
|
||||
return { missing: () => false, write: async () => { throw new Error("not asked"); }, storage: { getItem: () => null, setItem: () => {} } };
|
||||
}
|
||||
|
||||
test("Terminal keeps the ID of the Terminal plugin and follows its package", () => {
|
||||
const terminal = featureEntry("terminal");
|
||||
@@ -254,16 +260,16 @@ test("the feature migration copies the terminal settings also when the package r
|
||||
const terminal = terminalHost(true, JSON.stringify({ fontSize: 20 }));
|
||||
const background = { missing: () => false, hasImage: () => false, migrateFolder: async () => false, write: async () => {} };
|
||||
const host = { read: () => undefined, write: async () => { throw new Error("not asked"); }, legacy: async () => { throw new Error("no host"); } };
|
||||
assert.deepEqual(await migrateFeatures(host, background, terminal), []);
|
||||
assert.deepEqual(await migrateFeatures(host, background, terminal, presentProjectManagement()), []);
|
||||
assert.deepEqual(terminal.written, [{ ...DEFAULT_TERMINAL, fontSize: 20 }]);
|
||||
} finally { console.error = error; }
|
||||
});
|
||||
|
||||
test("the terminal switch follows the enabled state of an installed Terminal plugin", async () => {
|
||||
const writes: unknown[] = [];
|
||||
const host = { read: () => ({ git: true, background: true, pdf: true }), write: async (value: unknown) => { writes.push(value); },
|
||||
const host = { read: () => ({ git: true, background: true, pdf: true, pm: true }), write: async (value: unknown) => { writes.push(value); },
|
||||
legacy: async (ids: string[]) => ids.map(id => ({ id, installed: true, enabled: false, settings: null })) };
|
||||
const background = { missing: () => false, hasImage: () => false, migrateFolder: async () => false, write: async () => {} };
|
||||
assert.deepEqual(await migrateFeatures(host, background, terminalHost(false, null)), ["terminal"]);
|
||||
assert.deepEqual(writes, [{ git: true, background: true, pdf: true, terminal: false }]);
|
||||
assert.deepEqual(await migrateFeatures(host, background, terminalHost(false, null), presentProjectManagement()), ["terminal"]);
|
||||
assert.deepEqual(writes, [{ git: true, background: true, pdf: true, pm: true, terminal: false }]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user