Context
#1246 routes every rotor mode name through the dictionary (rotor.dataMode, rotor.gridMode, …). RotorNavigationService (src/service/rotor.ts) still identifies the active mode by comparing the label string, so the comparisons now read mode === t('rotor.gridMode'). getActiveFilterUnit() matches filter units the same way, by unit.label === mode.
This is consistent today: both sides render from the same active locale within one keystroke, and no two mode names collide in English or Korean. It is still a display string doing the job of an identity.
Risk
- A future locale in which two mode names render identically would silently merge those modes;
isDataMode() could then misclassify a compare mode as data mode and disable the rotor.
- Every arrow keystroke re-renders up to seven mode names to find the active one.
Proposal
Give each mode a stable key beside its label and compare on the key:
interface RotorMode {
key: 'data' | 'grid' | 'point' | 'intersection' | 'lower' | 'higher' | `filter:${string}`;
label: string;
}
getAvailableModes() returns RotorMode[], the mode comparisons become mode.key === 'grid', and only the announcement uses label. The same shape would suit RotorFilterUnit (key, label, noun) in src/model/abstract.ts, which already carries a key.
Context
#1246 routes every rotor mode name through the dictionary (
rotor.dataMode,rotor.gridMode, …).RotorNavigationService(src/service/rotor.ts) still identifies the active mode by comparing the label string, so the comparisons now readmode === t('rotor.gridMode').getActiveFilterUnit()matches filter units the same way, byunit.label === mode.This is consistent today: both sides render from the same active locale within one keystroke, and no two mode names collide in English or Korean. It is still a display string doing the job of an identity.
Risk
isDataMode()could then misclassify a compare mode as data mode and disable the rotor.Proposal
Give each mode a stable key beside its label and compare on the key:
getAvailableModes()returnsRotorMode[], the mode comparisons becomemode.key === 'grid', and only the announcement useslabel. The same shape would suitRotorFilterUnit(key,label,noun) insrc/model/abstract.ts, which already carries a key.