feat(ui): confirm ending a show and surface help

End-session buttons, Escape, and window close share one confirm. Help is a question-mark icon on the control panel and after the version. About opens directly. Scene editor follows the UI language.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-10-02 08:10:54 +08:00
parent d228b9aab7
commit 060bbd471a
12 changed files with 245 additions and 176 deletions
+20 -6
View File
@@ -1958,6 +1958,22 @@ export function ControlApp() {
</svg>
</span>
</Button>
<Button
variant="ghost"
iconOnly
title={t('control.helpTool')}
ariaLabel={t('control.helpTool')}
data-testid="control-help-tool"
onClick={() => {
void api.invoke(ipcChannels.windows.openInstructions, { section: 'controlPanel' }).catch((err) => {
console.error('[control] openInstructions failed', err);
});
}}
>
<span className={styles.iconGlyph} aria-hidden>
?
</span>
</Button>
</div>
<div className={styles.spacer12} />
<>
@@ -2498,9 +2514,7 @@ export function ControlApp() {
: t('control.showPlayers')}
</Button>
) : null}
<Button onClick={() => void api.invoke(ipcChannels.windows.closeMultiWindow, {})}>
{t('control.stopPresentation')}
</Button>
<Button onClick={() => setStopConfirmOpen(true)}>{t('control.stopPresentation')}</Button>
</div>
</div>
<div className={styles.spacer10} />
@@ -2508,7 +2522,7 @@ export function ControlApp() {
<div
ref={previewFrameRef}
className={styles.previewFrame}
title="Колесо — зум; перетаскивание СКМ/ПКМ или Space+ЛКМ — пан"
title={t('control.previewPanHint')}
>
<div
ref={previewHostRef}
@@ -3124,9 +3138,9 @@ export function ControlApp() {
<Button
variant="primary"
disabled={!session?.project?.currentGraphNodeId}
onClick={() => void api.invoke(ipcChannels.windows.closeMultiWindow, {})}
onClick={() => setStopConfirmOpen(true)}
>
{t('control.endPresentation')}
{t('control.stopPresentation')}
</Button>
</div>
) : null}
@@ -323,6 +323,10 @@ void test('ControlApp: Escape → своя модалка подтвержден
assert.ok(src.includes('stopConfirmOpen'));
assert.ok(src.includes('control.stopConfirm.title'));
assert.ok(src.includes('data-testid="stop-confirm-modal"'));
assert.ok(src.includes('data-testid="control-help-tool"'));
assert.match(src, /data-testid="control-help-tool"[\s\S]{0,180}iconOnly|iconOnly[\s\S]{0,180}data-testid="control-help-tool"/);
assert.ok(src.includes("section: 'controlPanel'"));
assert.equal((src.match(/windows\.closeMultiWindow,/g) ?? []).length, 1);
assert.ok(!src.includes('showMessageBox'));
assert.ok(!src.includes('window.confirm'));
});