[283] UX-Nachtrag: Rückmeldung Rampe/Geländer/Träger, Etappen in Umbau-Vorschau, Tooltip Sanieren, Varianten-Namen umbrechen, en Renovation, Rendering-Datum lokalisiert, Qualität Entwurf

This commit is contained in:
Claude committed 2026-11-18 02:09:24 +00:00
1 parent b3db08a1e0
commit 14ae9e18c2
12 files changed
+130 -31

No files matched your search

+4 -3
View File
@@ -53,6 +53,7 @@ export const railingReq = (pts: Vec2[], closed: boolean) => ({
pts: pts.map(xy),
});
const RAILING_DONE = { key: "cmd.railing.done", kind: "info" } as const;
const appendRailing = (pts: Vec2[], closed: boolean, ctx: CommandContext) => createMutation(ctx, railingReq(pts, closed));
interface RailIdle extends CommandState {
@@ -124,7 +125,7 @@ export const railingCommand: Command = {
}
// Schliessen: Treppenauge/Galerie ringsum (≥ 3 Punkte).
if (input.id === "close" && s.points.length >= 3) {
return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true, commit: appendRailing(s.points, true, ctx) }];
return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true, commit: appendRailing(s.points, true, ctx), notice: RAILING_DONE }];
}
return [s, { draft: draft() }];
}
@@ -137,7 +138,7 @@ export const railingCommand: Command = {
}
// Klick nahe Startpunkt → Zug schliessen und committen.
if (s.points.length >= 3 && segLen(s.points[0], pt) < CLOSE_HIT) {
return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true, commit: appendRailing(s.points, true, ctx) }];
return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true, commit: appendRailing(s.points, true, ctx), notice: RAILING_DONE }];
}
// Null-Strecke (Klick auf denselben Punkt) ignorieren.
if (segLen(s.points[s.points.length - 1], pt) < EPS) return [s, { draft: draft() }];
@@ -157,7 +158,7 @@ export const railingCommand: Command = {
onConfirm: (state, ctx): [CommandState, CommandResult] => {
const s = state as RailState;
if (s.phase === "next" && s.points.length >= 2) {
return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true, commit: appendRailing(s.points, false, ctx) }];
return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true, commit: appendRailing(s.points, false, ctx), notice: RAILING_DONE }];
}
return idle();
},
+1 -1
View File
@@ -46,7 +46,7 @@ const idle = (): RampState => ({ phase: "start", points: [], cursor: null, lastP
function commit(s: RampState, percent: number, ctx: CommandContext): [CommandState, CommandResult] {
const req = { cmd: "ramp", pts: s.points.map(xy), from: xy(s.from!), to: xy(s.to!), percent };
return [idle(), { draft: null, done: true, commit: createMutation(ctx, req) }];
return [idle(), { draft: null, done: true, commit: createMutation(ctx, req), notice: { key: "cmd.ramp.done", kind: "info" } }];
}
const closeOutline = (s: RampState): [CommandState, CommandResult] => {
+1 -1
View File
@@ -87,7 +87,7 @@ export const traegerCommand: Command = {
}
const a = s.a as Vec2;
if (Math.hypot(input.point.x - a.x, input.point.y - a.y) < EPS) return [s, { draft: draftTo(a, a, ctx) }];
return [{ phase: "done", lastPoint: null } as BeamState, { draft: null, done: true, commit: createMutation(ctx, request(a, input.point)) }];
return [{ phase: "done", lastPoint: null } as BeamState, { draft: null, done: true, commit: createMutation(ctx, request(a, input.point)), notice: { key: "cmd.beam.done", kind: "info" } }];
},
onMove: (state, point, _snap, ctx): [CommandState, CommandResult] => {
+9 -2
View File
@@ -2066,6 +2066,9 @@ export const de = {
"cmd.ramp.from": "Anfang der Gefällelinie (auf Geschosshöhe):",
"cmd.ramp.to": "Ende der Gefällelinie:",
"cmd.ramp.percent": "Gefälle in % (negativ = abwärts) <6>:",
"cmd.ramp.done": "Rampe angelegt.",
"cmd.beam.done": "Träger angelegt.",
"cmd.railing.done": "Geländer angelegt.",
"cmd.solidbool.label": "Körper verschneiden",
"cmd.solidbool.first": "Ersten Körper wählen:",
"cmd.solidbool.second": "Zweiten Körper wählen:",
@@ -4232,7 +4235,7 @@ export const de = {
"render.camera.view": "Kamera: aktuelle 3D-Ansicht",
"render.camera.preset": "Kamera: Voreinstellung «{name}» (3D-Ansicht nicht offen)",
"render.size": "Bildgrösse",
"render.size.sd": "Vorschau, 960 × 540",
"render.size.sd": "Klein, 960 × 540",
"render.size.hd": "Full HD, 1920 × 1080",
"render.size.uhd": "4K, 3840 × 2160",
"render.size.a4": "A4 quer, 300 dpi",
@@ -4242,7 +4245,7 @@ export const de = {
"render.width": "Breite (Pixel)",
"render.height": "Höhe (Pixel)",
"render.quality": "Qualität",
"render.quality.draft": "Vorschau (32 Samples)",
"render.quality.draft": "Entwurf (32 Samples)",
"render.quality.normal": "Normal (128 Samples)",
"render.quality.high": "Hoch (512 Samples)",
"render.quality.final": "Final (1536 Samples)",
@@ -4257,6 +4260,8 @@ export const de = {
"render.view.colors": "Umbau-Farben im Bild",
"render.view.colorsHint": "Bestand grau, Abbruch gelb, Neu rot (SIA 400). Vorgabe aus: Materialfarben. Wirkt nur mit einem Umbaufilter, der Farben vorsieht (z. B. Umbauplan), und nur beim eingebauten Cycles.",
"render.time": "Datum und Uhrzeit der Sonne",
"render.time.date": "Datum",
"render.time.clock": "Uhrzeit",
"render.sun": "Sonne: Azimut {az}°, Höhe {el}°",
"render.sun.night": "Die Sonne steht dann unter dem Horizont; gerendert wird bei Dämmerung (Sonnenhöhe 1°).",
"render.quality.custom": "Eigene Samples",
@@ -4881,6 +4886,8 @@ export const de = {
"renovation.panel.sanierung.empty": "Noch kein Sanierungstyp. Wand-, Decken- oder Dachtyp wählen und „Sanierungstyp anlegen …“.",
"renovation.panel.sanierung.walls": "{r} von {n} Wänden saniert",
"renovation.panel.sanierung.renovateAll": "Alle Wände vom Typ sanieren",
"renovation.panel.sanierung.renovateAll.none": "Kein Bauteil dieses Typs im Projekt.",
"renovation.panel.sanierung.renovateAll.done": "Alle Bauteile dieses Typs sind bereits saniert.",
"renovation.panel.sanierung.create": "Sanierungstyp anlegen …",
"renovation.panel.sanierung.createFor": "Bestandstyp",
"renovation.panel.sanierung.newName": "{name} saniert",
+25 -18
View File
@@ -2055,6 +2055,9 @@ export const en: Record<TranslationKey, string> = {
"cmd.ramp.from": "Start of the slope line (at storey level):",
"cmd.ramp.to": "End of the slope line:",
"cmd.ramp.percent": "Gradient in % (negative = downward) <6>:",
"cmd.ramp.done": "Ramp created.",
"cmd.beam.done": "Beam created.",
"cmd.railing.done": "Railing created.",
"cmd.solidbool.label": "Boolean solids",
"cmd.solidbool.first": "Select first solid:",
"cmd.solidbool.second": "Select second solid:",
@@ -4218,7 +4221,7 @@ export const en: Record<TranslationKey, string> = {
"render.camera.view": "Camera: current 3D view",
"render.camera.preset": "Camera: preset «{name}» (3D view not open)",
"render.size": "Image size",
"render.size.sd": "Preview, 960 × 540",
"render.size.sd": "Small, 960 × 540",
"render.size.hd": "Full HD, 1920 × 1080",
"render.size.uhd": "4K, 3840 × 2160",
"render.size.a4": "A4 landscape, 300 dpi",
@@ -4228,7 +4231,7 @@ export const en: Record<TranslationKey, string> = {
"render.width": "Width (pixels)",
"render.height": "Height (pixels)",
"render.quality": "Quality",
"render.quality.draft": "Preview (32 samples)",
"render.quality.draft": "Draft (32 samples)",
"render.quality.normal": "Normal (128 samples)",
"render.quality.high": "High (512 samples)",
"render.quality.final": "Final (1536 samples)",
@@ -4243,6 +4246,8 @@ export const en: Record<TranslationKey, string> = {
"render.view.colors": "Renovation colors in the image",
"render.view.colorsHint": "Existing grey, demolition yellow, new red (SIA 400). Default off: material colors. Only effective with a renovation filter that uses colors (e.g. Renovation plan), and only with the built-in Cycles.",
"render.time": "Date and time of the sun",
"render.time.date": "Date",
"render.time.clock": "Time",
"render.sun": "Sun: azimuth {az}°, elevation {el}°",
"render.sun.night": "The sun is below the horizon then; the image is rendered at twilight (sun elevation 1°).",
"render.quality.custom": "Custom samples",
@@ -4853,40 +4858,42 @@ export const en: Record<TranslationKey, string> = {
"renovation.panel.phases.styles": "Own colors of the phase",
"renovation.panel.phases.stylesHint": "Demolition and new elements of phase “{name}” in their own color; empty = project colors.",
"renovation.panel.phases.stylesReset": "Use project colors",
"renovation.buildUp": "New build-up (refurbishment)",
"renovation.buildUp": "New build-up (renovation)",
"renovation.buildUp.none": "none",
"renovation.buildUp.type": "as type: {name}",
"renovation.buildUp.typeMissing": "as type (no refurbishment type)",
"renovation.buildUp.typeMissing": "as type (no renovation type)",
"renovation.buildUp.other": "Type {name}",
"renovation.buildUp.hint": "New build-up only for status existing; demolition and new per layer from the type pair.",
"renovation.strip.old": "Old",
"renovation.strip.new": "New",
"renovation.strip.result": "Result",
"renovation.panel.sanierung.title": "Refurbishment",
"renovation.panel.sanierung.count": "Refurbished elements: {n}",
"renovation.panel.sanierung.empty": "No refurbishment type yet. Pick a wall, slab or roof type and “Create refurbishment type …”.",
"renovation.panel.sanierung.walls": "{r} of {n} walls refurbished",
"renovation.panel.sanierung.renovateAll": "Refurbish all walls of this type",
"renovation.panel.sanierung.create": "Create refurbishment type …",
"renovation.panel.sanierung.title": "Renovation",
"renovation.panel.sanierung.count": "Renovated elements: {n}",
"renovation.panel.sanierung.empty": "No renovation type yet. Pick a wall, slab or roof type and “Create renovation type …”.",
"renovation.panel.sanierung.walls": "{r} of {n} walls renovated",
"renovation.panel.sanierung.renovateAll": "Renovate all walls of this type",
"renovation.panel.sanierung.renovateAll.none": "No element of this type in the project.",
"renovation.panel.sanierung.renovateAll.done": "All elements of this type are already renovated.",
"renovation.panel.sanierung.create": "Create renovation type …",
"renovation.panel.sanierung.createFor": "Existing type",
"renovation.panel.sanierung.newName": "{name} refurbished",
"renovation.panel.sanierung.newName": "{name} renovated",
"renovation.panel.sanierung.edit": "Edit layer mapping",
"renovation.panel.sanierung.target": "Refurbishment type",
"renovation.panel.sanierung.target": "Renovation type",
"renovation.panel.sanierung.side": "Reference side",
"renovation.panel.sanierung.side.inside": "inside (external insulation)",
"renovation.panel.sanierung.side.outside": "outside (internal insulation)",
"renovation.panel.sanierung.oldLayers": "Existing type (old)",
"renovation.panel.sanierung.newLayers": "Refurbishment type (new)",
"renovation.panel.sanierung.newLayers": "Renovation type (new)",
"renovation.panel.sanierung.reset": "Map automatically",
"renovation.panel.sanierung.remove": "Remove refurbishment type",
"renovation.panel.sanierung.remove": "Remove renovation type",
"renovation.panel.sanierung.editLayers": "Layers in the resources …",
"renovation.panel.sanierung.host.wall": "Walls",
"renovation.panel.sanierung.host.ceiling": "Slabs",
"renovation.panel.sanierung.host.roof": "Roofs",
"renovation.panel.sanierung.ceilings": "{r} of {n} slabs refurbished",
"renovation.panel.sanierung.roofs": "{r} of {n} roofs refurbished",
"renovation.panel.sanierung.renovateAll.ceiling": "Refurbish all slabs of this type",
"renovation.panel.sanierung.renovateAll.roof": "Refurbish all roofs of this type",
"renovation.panel.sanierung.ceilings": "{r} of {n} slabs renovated",
"renovation.panel.sanierung.roofs": "{r} of {n} roofs renovated",
"renovation.panel.sanierung.renovateAll.ceiling": "Renovate all slabs of this type",
"renovation.panel.sanierung.renovateAll.roof": "Renovate all roofs of this type",
"renovation.panel.sanierung.side.ceiling.inside": "bottom (structural slab stays)",
"renovation.panel.sanierung.side.ceiling.outside": "top (top level stays)",
"renovation.panel.sanierung.side.roof.inside": "inside (structure stays)",
+11
View File
@@ -178,6 +178,17 @@ export function RenovationPanel() {
{RENOVATION_STATUSES.map((s) => (
<ShowChip key={s} st={sw[s]} status={s} show={shows[s]} />
))}
{/* [283] Etappen mit eigenen Farben: Muster wie im Plan (Abbruch/Neu je Etappe) */}
{phases.filter((ph) => rs.phases[ph.id]).map((ph) => (
<span className="reno-chip reno-chip-phase" key={ph.id} data-testid={`reno-chip-phase-${ph.id}`}>
<Swatch st={rs.phases[ph.id].demolish} show={shows.demolish} />
<Swatch st={rs.phases[ph.id].new} show={shows.new} />
<span className="reno-chip-text">
<span className="reno-chip-status">{ph.name}</span>
<span className="reno-chip-show">{t("renovation.status.demolish")} · {t("renovation.status.new")}</span>
</span>
</span>
))}
</div>
)}
</div>
+1
View File
@@ -167,6 +167,7 @@ export function RenovationSanierung({ project }: { project: Project }) {
className="reno-link-btn"
data-testid="reno-pair-renovate-all"
disabled={pr.elements === 0 || pr.renovated === pr.elements}
title={pr.elements === 0 ? t("renovation.panel.sanierung.renovateAll.none") : pr.renovated === pr.elements ? t("renovation.panel.sanierung.renovateAll.done") : undefined}
onClick={() => applyChange((p) => renovateAllOfTypeOps(p, pr.type, host))}
>
{t((host === "wall" ? "renovation.panel.sanierung.renovateAll" : `renovation.panel.sanierung.renovateAll.${host}`) as TranslationKey)}
+21 -2
View File
@@ -6214,6 +6214,18 @@ body {
font-size: 13px;
color: var(--ink);
}
/* [283] Rendering-Dialog: Datum und Uhrzeit nebeneinander */
.render-time-row {
display: flex;
gap: 6px;
}
.render-time-row .imp-input.imp-input-flush:first-child {
flex: 1 1 auto;
}
.render-time-row .imp-input.imp-input-flush:last-child {
flex: 0 0 116px;
width: 116px;
}
/* Suchfeld ohne Checkbox-Einrückung (Kürzel-Übersicht). */
.imp-input.imp-input-flush {
margin-left: 0;
@@ -10091,8 +10103,16 @@ body {
flex: 1 1 auto;
font-weight: 600;
}
.rm-design-option {
flex-wrap: wrap;
}
.rm-option-name {
flex: 1 1 auto;
flex: 1 1 9em;
min-width: 9em;
}
.rm-option-name .inline-name-text {
white-space: normal;
overflow-wrap: anywhere;
}
.rm-design-option-primary {
flex: 0 0 auto;
@@ -10255,7 +10275,6 @@ body {
display: flex;
align-items: center;
gap: 4px;
padding-left: 22px;
}
.dop-check input {
margin: 0 4px 0 0;
+55 -2
View File
@@ -11,7 +11,7 @@
// Der Auftrag (Szene aus dem Kern, Prozess, Bild) liegt in beiden Fällen im Hauptfenster: `state/renderJob.ts`.
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
import { t } from "../i18n";
import { getLanguage, t } from "../i18n";
import { useModalFocus } from "./modalFocus";
import { BLENDER_DOWNLOAD_URL, RENDER_QUALITY_PRESETS, hasExportView, paperPixels, sunPosition } from "../core";
import { setRenderDialogOpener } from "../state/renderDialogHook";
@@ -52,6 +52,59 @@ const toInputValue = (d: Date): string => {
const MAX_EDGE = 16000;
/** Datum in der Schreibweise der UI-Sprache ([283]: `datetime-local` folgt der Browser-Locale, de-UI zeigte US-Format). */
const formatDay = (ymd: string): string => {
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(ymd);
if (!m) return ymd;
return getLanguage() === "de" ? `${m[3]}.${m[2]}.${m[1]}` : ymd;
};
const parseDay = (txt: string): string | null => {
const s = txt.trim();
const m = getLanguage() === "de" ? /^(\d{1,2})\.(\d{1,2})\.(\d{4})$/.exec(s) : /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(s);
if (!m) return null;
const [y, mo, d] = getLanguage() === "de" ? [m[3], m[2], m[1]] : [m[1], m[2], m[3]];
const iso = `${y}-${mo.padStart(2, "0")}-${d.padStart(2, "0")}`;
const dt = new Date(`${iso}T00:00`);
return Number.isFinite(dt.getTime()) && dt.getMonth() + 1 === Number(mo) ? iso : null;
};
/** Datum (TT.MM.JJJJ bzw. JJJJ-MM-TT) und Uhrzeit (24 h) als zwei Felder; `value` ist `JJJJ-MM-TTThh:mm`. */
function DateTimeField({ value, label, disabled, onChange }: { value: string; label: string; disabled: boolean; onChange: (v: string) => void }) {
const [ymd, hm] = value.split("T");
const [draft, setDraft] = useState<string | null>(null);
const commit = () => {
const iso = draft === null ? null : parseDay(draft);
if (iso) onChange(`${iso}T${hm ?? "12:00"}`);
setDraft(null);
};
return (
<div className="render-time-row" role="group" aria-label={label} data-testid="render-time">
<input
className="imp-input imp-input-flush"
type="text"
inputMode="numeric"
aria-label={`${label}: ${t("render.time.date")}`}
placeholder={getLanguage() === "de" ? "TT.MM.JJJJ" : "YYYY-MM-DD"}
data-testid="render-time-date"
value={draft ?? formatDay(ymd ?? "")}
disabled={disabled}
onChange={(e) => setDraft(e.target.value)}
onBlur={commit}
onKeyDown={(e) => e.key === "Enter" && commit()}
/>
<input
className="imp-input imp-input-flush"
type="time"
aria-label={`${label}: ${t("render.time.clock")}`}
data-testid="render-time-clock"
value={hm ?? ""}
disabled={disabled}
onChange={(e) => e.target.value && onChange(`${ymd}T${e.target.value}`)}
/>
</div>
);
}
export interface RenderDialogViewProps {
info: RenderSetupInfo;
job: RenderJobState;
@@ -362,7 +415,7 @@ export function RenderDialogView({ info, job, imageSrc, commands, onClose, windo
</section>
<section className="imp-section">
<div className="imp-section-title">{t("render.time")}</div>
<input className="imp-input imp-input-flush" type="datetime-local" aria-label={t("render.time")} data-testid="render-time" value={when} disabled={busy} onChange={(e) => setWhen(e.target.value)} />
<DateTimeField value={when} label={t("render.time")} disabled={busy} onChange={setWhen} />
{sun && (
<div className="imp-note" data-testid="render-sun">
{t("render.sun", { az: sun.azimuth.toFixed(0), el: sun.elevation.toFixed(0) })}