mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 12:55:16 -07:00
feat(config): reorganize settings window and move annotation colors to subtitleStyle
- Reorganize Configuration window into Appearance, Behavior, Anki, Input, and Integration sections - Add AnkiConnect-backed deck, note-type, and field pickers in the Anki section - Add click-to-learn keybinding controls - Move known-word and N+1 highlight colors to subtitleStyle.knownWordColor / subtitleStyle.nPlusOneColor; legacy ankiConnect.knownWords.color and ankiConnect.nPlusOne.nPlusOne keys still accepted with deprecation warnings - Add deckNames, modelNames, modelFieldNames, and fieldNamesForDeck methods to AnkiConnectClient - Mark discordPresence.presenceStyle as an enum in the config registry
This commit is contained in:
@@ -157,6 +157,8 @@ export function applySubtitleDomainConfig(context: ResolveContext): void {
|
||||
resolved.subtitleStyle.hoverTokenBackgroundColor;
|
||||
const fallbackSubtitleStyleNameMatchEnabled = resolved.subtitleStyle.nameMatchEnabled;
|
||||
const fallbackSubtitleStyleNameMatchColor = resolved.subtitleStyle.nameMatchColor;
|
||||
const fallbackSubtitleStyleKnownWordColor = resolved.subtitleStyle.knownWordColor;
|
||||
const fallbackSubtitleStyleNPlusOneColor = resolved.subtitleStyle.nPlusOneColor;
|
||||
const fallbackFrequencyDictionary = {
|
||||
...resolved.subtitleStyle.frequencyDictionary,
|
||||
};
|
||||
@@ -333,6 +335,36 @@ export function applySubtitleDomainConfig(context: ResolveContext): void {
|
||||
);
|
||||
}
|
||||
|
||||
const knownWordColor = asColor(
|
||||
(src.subtitleStyle as { knownWordColor?: unknown }).knownWordColor,
|
||||
);
|
||||
if (knownWordColor !== undefined) {
|
||||
resolved.subtitleStyle.knownWordColor = knownWordColor;
|
||||
} else if ((src.subtitleStyle as { knownWordColor?: unknown }).knownWordColor !== undefined) {
|
||||
resolved.subtitleStyle.knownWordColor = fallbackSubtitleStyleKnownWordColor;
|
||||
warn(
|
||||
'subtitleStyle.knownWordColor',
|
||||
(src.subtitleStyle as { knownWordColor?: unknown }).knownWordColor,
|
||||
resolved.subtitleStyle.knownWordColor,
|
||||
'Expected hex color.',
|
||||
);
|
||||
}
|
||||
|
||||
const nPlusOneColor = asColor(
|
||||
(src.subtitleStyle as { nPlusOneColor?: unknown }).nPlusOneColor,
|
||||
);
|
||||
if (nPlusOneColor !== undefined) {
|
||||
resolved.subtitleStyle.nPlusOneColor = nPlusOneColor;
|
||||
} else if ((src.subtitleStyle as { nPlusOneColor?: unknown }).nPlusOneColor !== undefined) {
|
||||
resolved.subtitleStyle.nPlusOneColor = fallbackSubtitleStyleNPlusOneColor;
|
||||
warn(
|
||||
'subtitleStyle.nPlusOneColor',
|
||||
(src.subtitleStyle as { nPlusOneColor?: unknown }).nPlusOneColor,
|
||||
resolved.subtitleStyle.nPlusOneColor,
|
||||
'Expected hex color.',
|
||||
);
|
||||
}
|
||||
|
||||
const frequencyDictionary = isObject(
|
||||
(src.subtitleStyle as { frequencyDictionary?: unknown }).frequencyDictionary,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user