/** * 「改动」tab 的 diff 模式(统一 / 分栏)解析。 * 纯逻辑:不碰 VS Code API,便于单测。 */ export const DEFAULT_PR_DIFF_MODE = 'unified' as const export type PrDiffMode = 'unified' | 'split' export function isPrDiffMode(x: unknown): x is PrDiffMode { return x === 'unified' || x === 'split' } /** * workspaceState 读出值 → 合法模式。 * 仅精确字符串 `'split'` 才是分栏;其它一律统一(默认路径)。 */ export function parsePrDiffMode(stored: unknown): PrDiffMode { return stored === 'split' ? 'split' : DEFAULT_PR_DIFF_MODE }