mock: スタビ位置は、どのサイズも何も選ばない状態から始める(T-30 単位8)

候補が1つのサイズも既定で選ばない。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017yoUu9Xd8dhwyQdCfKfaXG
This commit is contained in:
2026-10-23 22:18:50 +09:00
co-authored by Claude Opus 5.5
parent eacf8a1581
commit 785daa23c2
4 changed files with 9 additions and 29 deletions
+3 -9
View File
@@ -1,11 +1,6 @@
import type { KeyNode, Node, PhyFile, Transform } from "../../domain/phy";
import type { ProjectFile } from "../../domain/project";
import {
defaultStabilizerSelection,
stabilizerCandidates,
stabilizerPoints,
switchPoint,
} from "../../domain/stabilizers";
import { stabilizerCandidates, stabilizerPoints, switchPoint } from "../../domain/stabilizers";
import { apply, compose, inverse, matrix, type Affine } from "../../domain/geometry";
export function normalizeSelection(file: PhyFile, ids: string[]): string[] {
@@ -337,10 +332,9 @@ export function stabilizerSelections(project: ProjectFile): StabilizerSelections
const ui = project.ui as { phy?: { stabilizers?: StabilizerSelections } } | undefined;
return ui?.phy?.stabilizers ?? {};
}
/** 記録がなければサイズの既定。サイズが変わって候補にない記録は捨てて読む。 */
/** 記録がなければ何も選ばない。サイズが変わって候補にない記録は捨てて読む。 */
export function selectedStabilizers(selections: StabilizerSelections, key: KeyNode): string[] {
const ids = selections[key.id];
if (!ids) return defaultStabilizerSelection(key.size);
const ids = selections[key.id] ?? [];
const known = new Set(stabilizerCandidates(key.size).map((c) => c.id));
return ids.filter((id) => known.has(id));
}