[143] Baugrube: Sohle aus drawingLevels (las nicht vorhandene floors, immer −0.30), Hinweise statt stillem Scheitern (ohne Gelände, ausserhalb, nur Aufschüttung, kein Geschoss), Gelände-Befehl sofort

This commit is contained in:
Claude committed 2026-11-05 23:22:23 +00:00
1 parent b9db259c9c
commit 45b4e4d080
8 files changed
+117 -21

No files matched your search

+12 -2
View File
@@ -67,7 +67,7 @@ export interface EngineHost {
*/
inputUnits?(): DisplayUnits;
/** Optional: Hinweis zeigen (i18n-Key), z. B. „erst Objekte wählen" (`Command.needsSelection`). */
notify?(key: string): void;
notify?(key: string, params?: Record<string, string | number>, kind?: "info" | "warning" | "error"): void;
}
/** Öffentlicher Schnappschuss für die Command-Line-UI (rein lesend). */
@@ -323,7 +323,16 @@ export class CommandEngine {
/** Startet einen konkreten Befehl (z. B. zur Wiederholung). */
startCommand(cmd: Command): boolean {
if (cmd.floorOnly && !this.host.isFloor()) return false;
if (cmd.floorOnly && !this.host.isFloor()) {
// [143] Nicht still scheitern (Schnitt/Ansicht/Blatt aktiv).
this.host.notify?.("cmd.needsFloor", undefined, "info");
return false;
}
const blocked = cmd.precondition?.(this.host.context(null));
if (blocked) {
this.host.notify?.(blocked, undefined, "warning");
return false;
}
if (cmd.needsSelection && !hasTransformSelection(this.host.context(null).selection)) {
this.host.notify?.(cmd.needsSelection);
return false;
@@ -624,6 +633,7 @@ export class CommandEngine {
private applyResult(res: CommandResult): void {
if (res.commit) this.host.commit(res.commit);
if (res.focusDrawingId) this.host.focusDrawing?.(res.focusDrawingId, res.focusMinHeightM);
if (res.notice) this.host.notify?.(res.notice.key, res.notice.params, res.notice.kind ?? "info");
if (res.draft) this.host.setDraft(res.draft);
else this.host.setDraft(null);
if (res.done) {