From c5b5ca600c1e8df1d7e49ff35025304494d8d373 Mon Sep 17 00:00:00 2001 From: Karim Date: Sun, 5 Jul 2026 14:48:37 +0200 Subject: [PATCH] =?UTF-8?q?Import-Befehl:=20autoRun=20statt=20onConfirm=20?= =?UTF-8?q?=E2=80=94=20Datei-Dialog=20oeffnet=20synchron=20in=20der=20Gest?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/cmds/import.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/commands/cmds/import.ts b/src/commands/cmds/import.ts index da416f8..c7ff207 100644 --- a/src/commands/cmds/import.ts +++ b/src/commands/cmds/import.ts @@ -26,6 +26,16 @@ export const importCommand: Command = { options: () => [], init: () => ({ ...IDLE }), + // Sofort-Befehl (wie Join/Split): `startCommand` ruft `autoRun` SYNCHRON im + // selben Aufruf-Stack wie die Enter-/Klick-Geste auf. Genau das braucht der + // Datei-Dialog — ein `.click()` öffnet den OS-Dialog nur + // innerhalb einer echten Nutzer-Geste; ein State-Update/async-Hop dazwischen + // (wie beim reinen onConfirm/onInput-Weg) lässt ihn verzögern oder ausbleiben. + autoRun: (): CommandResult => { + openDxfImport(); + return { draft: null, done: true }; + }, + // Der Befehl hat keine Schritte: Start/Enter/Input öffnet den Dialog + endet. onInput: () => open(), onMove: (state): [CommandState, CommandResult] => [state, { draft: null }],