Skip to content

Commit d13eb8a

Browse files
committed
fix: align View action locale types with SupportedLocale
tsc -b failed because buildViewActions typed the locale code as plain string, rejecting the i18n SupportedLocale values and the readonly availableLocales array passed from App. Assisted-by: Claude Opus 4.8
1 parent aebd3ce commit d13eb8a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/actions/registry.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { getRoiIconUrl } from "../assets/roiIcons";
1919
import { getRootIconUrl } from "../assets/rootIcons";
2020
import datalabIconUrl from "../assets/DataLab.svg?url";
2121
import { t } from "../i18n/translate";
22+
import type { SupportedLocale } from "../i18n/locale";
2223
import type { ActionDescriptor, ActionState } from "./types";
2324

2425
/** Callbacks needed to build the static (non-feature) actions. */
@@ -466,11 +467,11 @@ export interface ViewActionCallbacks {
466467
/** Toggle the Macro panel placement (tab ⇄ floating). */
467468
onToggleMacroFloating: () => void;
468469
/** Currently active locale code (e.g. ``"en"`` / ``"fr"``). */
469-
locale: string;
470+
locale: SupportedLocale;
470471
/** Locales offered in the Language submenu (code + native label). */
471-
availableLocales: { code: string; label: string }[];
472+
availableLocales: ReadonlyArray<{ code: SupportedLocale; label: string }>;
472473
/** Switch the UI locale (triggers a full reload, see ``locale.ts``). */
473-
onSetLocale: (code: string) => void;
474+
onSetLocale: (code: SupportedLocale) => void;
474475
}
475476

476477
/** Wire View menu actions (UI preferences only). */

0 commit comments

Comments
 (0)