Improve startup dictionary progress and fix overlay/plugin input handlin

- show a dedicated startup OSD "building" phase for character dictionary sync
- forward bare `Tab` from visible overlay to mpv so AniSkip works while focused
- fix Windows plugin env override resolution for `SUBMINER_BINARY_PATH`
This commit is contained in:
2026-03-09 02:35:03 -07:00
parent e0f82d28f0
commit e59192bbe1
28 changed files with 577 additions and 104 deletions

View File

@@ -38,6 +38,7 @@ function createContext(subtitleHeight: number) {
state: {
currentYPercent: null,
persistedSubtitlePosition: { yPercent: 10 },
isOverSubtitle: false,
},
};
}

View File

@@ -84,6 +84,19 @@ function getNextPersistedPosition(
};
}
function applyMarginBottom(ctx: RendererContext, yPercent: number): void {
const clampedPercent = clampYPercent(ctx, yPercent);
ctx.state.currentYPercent = clampedPercent;
const marginBottom = (clampedPercent / 100) * getViewportHeight();
ctx.dom.subtitleContainer.style.position = '';
ctx.dom.subtitleContainer.style.left = '';
ctx.dom.subtitleContainer.style.top = '';
ctx.dom.subtitleContainer.style.right = '';
ctx.dom.subtitleContainer.style.transform = '';
ctx.dom.subtitleContainer.style.marginBottom = `${marginBottom}px`;
}
export function createInMemorySubtitlePositionController(
ctx: RendererContext,
): SubtitlePositionController {
@@ -98,16 +111,7 @@ export function createInMemorySubtitlePositionController(
}
function applyYPercent(yPercent: number): void {
const clampedPercent = clampYPercent(ctx, yPercent);
ctx.state.currentYPercent = clampedPercent;
const marginBottom = (clampedPercent / 100) * getViewportHeight();
ctx.dom.subtitleContainer.style.position = '';
ctx.dom.subtitleContainer.style.left = '';
ctx.dom.subtitleContainer.style.top = '';
ctx.dom.subtitleContainer.style.right = '';
ctx.dom.subtitleContainer.style.transform = '';
ctx.dom.subtitleContainer.style.marginBottom = `${marginBottom}px`;
applyMarginBottom(ctx, yPercent);
}
function persistSubtitlePositionPatch(patch: Partial<SubtitlePosition>): void {

View File

@@ -374,7 +374,8 @@ async function init(): Promise<void> {
await keyboardHandlers.setupMpvInputForwarding();
subtitleRenderer.applySubtitleStyle(await window.electronAPI.getSubtitleStyle());
const initialSubtitleStyle = await window.electronAPI.getSubtitleStyle();
subtitleRenderer.applySubtitleStyle(initialSubtitleStyle);
positioning.applyStoredSubtitlePosition(
await window.electronAPI.getSubtitlePosition(),