Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
25 lines
716 B
TypeScript
25 lines
716 B
TypeScript
export const MIN_FOCUS_NODE_TARGET_ZOOM = 0.1;
|
|
export const MAX_FOCUS_NODE_TARGET_ZOOM = 2;
|
|
export const FOCUS_NODE_TARGET_ZOOM_STEP = 0.01;
|
|
|
|
export type FocusNodeTargetZoom = number;
|
|
|
|
export function normalizeFocusNodeTargetZoom(
|
|
value: unknown,
|
|
fallback: FocusNodeTargetZoom
|
|
): FocusNodeTargetZoom {
|
|
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
return fallback;
|
|
}
|
|
|
|
const clamped = Math.max(
|
|
MIN_FOCUS_NODE_TARGET_ZOOM,
|
|
Math.min(MAX_FOCUS_NODE_TARGET_ZOOM, value)
|
|
);
|
|
// Keep persisted values stable and avoid float noise.
|
|
const normalized =
|
|
Math.round(clamped / FOCUS_NODE_TARGET_ZOOM_STEP) *
|
|
FOCUS_NODE_TARGET_ZOOM_STEP;
|
|
return Number(normalized.toFixed(2));
|
|
}
|