Overlay 2.0 (#12)

This commit is contained in:
2026-03-01 02:36:51 -08:00
committed by GitHub
parent 45df3c466b
commit 44c7761c7c
397 changed files with 15139 additions and 7127 deletions

View File

@@ -251,7 +251,6 @@ export function createJimakuModal(
}
function openJimakuModal(): void {
if (ctx.platform.isInvisibleLayer) return;
if (ctx.state.jimakuModalOpen) return;
ctx.state.jimakuModalOpen = true;

View File

@@ -66,7 +66,6 @@ export function createKikuModal(
original: KikuDuplicateCardInfo;
duplicate: KikuDuplicateCardInfo;
}): void {
if (ctx.platform.isInvisibleLayer) return;
if (ctx.state.kikuModalOpen) return;
ctx.state.kikuModalOpen = true;

View File

@@ -1,6 +1,20 @@
import type { RuntimeOptionApplyResult, RuntimeOptionState, RuntimeOptionValue } from '../../types';
import type { ModalStateReader, RendererContext } from '../context';
type RuntimeOptionsListLike = Pick<HTMLUListElement, 'querySelector'>;
export function scrollActiveRuntimeOptionIntoView(list: RuntimeOptionsListLike): void {
const active = list.querySelector('.runtime-options-item.active');
if (!active) return;
const maybeScrollable = active as unknown as {
scrollIntoView?: (options?: ScrollIntoViewOptions) => void;
};
if (typeof maybeScrollable.scrollIntoView !== 'function') return;
maybeScrollable.scrollIntoView({ block: 'nearest' });
}
export function createRuntimeOptionsModal(
ctx: RendererContext,
options: {
@@ -82,6 +96,8 @@ export function createRuntimeOptionsModal(
ctx.dom.runtimeOptionsList.appendChild(li);
});
scrollActiveRuntimeOptionIntoView(ctx.dom.runtimeOptionsList);
}
function updateRuntimeOptions(optionsList: RuntimeOptionState[]): void {
@@ -162,8 +178,6 @@ export function createRuntimeOptionsModal(
}
async function openRuntimeOptionsModal(): Promise<void> {
if (ctx.platform.isInvisibleLayer) return;
const optionsList = await window.electronAPI.getRuntimeOptions();
updateRuntimeOptions(optionsList);

View File

@@ -96,7 +96,6 @@ const OVERLAY_SHORTCUTS: Array<{
{ key: 'openRuntimeOptions', label: 'Open runtime options' },
{ key: 'openJimaku', label: 'Open jimaku' },
{ key: 'toggleVisibleOverlayGlobal', label: 'Show/hide visible overlay' },
{ key: 'toggleInvisibleOverlayGlobal', label: 'Show/hide invisible overlay' },
];
function buildOverlayShortcutSections(shortcuts: RuntimeShortcutConfig): SessionHelpSection[] {

View File

@@ -45,8 +45,6 @@ export function createSubsyncModal(
}
function openSubsyncModal(payload: SubsyncManualPayload): void {
if (ctx.platform.isInvisibleLayer) return;
ctx.state.subsyncSubmitting = false;
ctx.dom.subsyncRunButton.disabled = false;
ctx.state.subsyncSourceTracks = payload.sourceTracks;