[189] Attribute nur Gestaltung, Bauteil-Felder in einklappbaren Gruppen der Objekt-Info; Taste T öffnet Objekteinstellungen

This commit is contained in:
Claude committed 2026-11-11 20:27:59 +00:00
1 parent e87e4a8ed3
commit d926f95078
22 files changed
+791 -201

No files matched your search

+1
View File
@@ -48,6 +48,7 @@ in `ProjectSync`.
| `useDormerNotice.ts` | Gauben-Hinweis (in `ProjectSync`, abonniert nur Dächer und Projekt-Id) |
| `useMouseSelectionHandlers.ts` | Auswahl und Kontextmenü aus Grundriss und 3D |
| `useKeyboardShortcuts.ts`, `keyboardShortcuts.ts`, `commandKeys.ts` | Tastenkürzel, Esc/Enter laufender Befehle |
| `objectSettings.ts` | Taste T / Menü „Objekteinstellungen…" ([189]): Öffnungs-Dialog oder Abschnitt der Objekt-Info |
| `useDisplayResolvers.ts` | sichtbar, gedimmt, gesperrt je Ebene und Kategorie |
| `useTextTarget.ts`, `useSectionLineState.ts`, `useStatusBarInfo.ts` | Text-Ziel der Formatierleiste; Schnittlinie, 3D-Live-Schnitt; Status-Leiste (je mit schmalen Selektoren) |
| `usePanelHostBase.ts`, `panelHost/` | Host-Wert für die Panels: Zusammenbau aus Teil-Bauern je Bereich (`toolsHost`, `selectionStyleHost`, `elementAttributesHost`, `siteHost`, `viewSnapshotsHost` + `viewState`, `layoutsHost`); `stableHost.ts` hält die Identität fest (Handler als Trampoline), solange sich kein Wert-Feld ändert. Projekt und Objekt-Info kommen beim Bau aus dem Store; die Fassung hinter den Trampolinen wird bei geändertem Projekt/Auswahl erst beim Aufruf neu gebaut |
+4 -1
View File
@@ -52,7 +52,8 @@ export type ShortcutId =
| "floorDown"
| "floorUp"
| "showSelection3d"
| "hideSelection3d";
| "hideSelection3d"
| "objectSettings";
export type ShortcutCategory =
| "general"
@@ -214,6 +215,8 @@ export const SHORTCUT_DEFS: ShortcutDef[] = [
{ id: "floorUp", category: "navigation", labelKey: "shortcut.floorUp", defaultCombo: "mod+6" },
{ id: "showSelection3d", category: "navigation", labelKey: "shortcut.showSelection3d", defaultCombo: "mod+3" },
{ id: "hideSelection3d", category: "navigation", labelKey: "shortcut.hideSelection3d", defaultCombo: "mod+4" },
// [189] Einstellungsdialog des gewählten Objekts (Archicad Cmd+T), hier schlicht „t".
{ id: "objectSettings", category: "edit", labelKey: "shortcut.objectSettings", defaultCombo: "t", bareKeyOnly: true },
];
const DEFS_BY_ID = new Map<ShortcutId, ShortcutDef>(SHORTCUT_DEFS.map((d) => [d.id, d]));
+41
View File
@@ -0,0 +1,41 @@
// [189] Taste T (wie Archicad Cmd+T): Einstellungen des gewählten Objekts öffnen. Fenster/Tür → der Öffnungs-
// Dialog; alles andere → die Objekt-Info (Panel zeigen, passenden Abschnitt aufklappen und fokussieren);
// ohne Auswahl die Voreinstellung des aktiven Werkzeugs (Wand/Decke: Typ des neuen Bauteils), sonst nichts.
// Die Zuordnung Auswahl → Ziel ist rein (`panels/objectInfo/groups.ts::objectSettingsTarget`).
import { objectSettingsTarget } from "../panels/objectInfo/groups";
import { expandAndFocusInfoGroup } from "../panels/objectInfo/infoGroupState";
import { getState } from "./appStore";
import { selectionInfoFor } from "./useSelectionInfo";
export interface ObjectSettingsDeps {
/** Aktives Werkzeug (React-State der App). */
activeTool: string;
openOpeningEditor: (openingId: string) => void;
/** Objekt-Info-Panel sichtbar machen (Dock-Tab, schwebendes Fenster …). */
revealObjectInfo: () => void;
}
/** Öffnet die Einstellungen; `false`, wenn es nichts zu öffnen gibt. */
export function openObjectSettings(deps: ObjectSettingsDeps): boolean {
const { project, selection } = getState();
const sel = selectionInfoFor(project, selection);
let target = objectSettingsTarget(sel, deps.activeTool, isGridDrawing(sel?.kind === "drawing2d" ? sel.id : undefined));
// Baum, Lage-Darstellung und Schnittlinie sind keine `SelectionInfo`, haben aber ihre Felder in der Objekt-Info.
if (!target && (selection.trees.length > 0 || selection.site.length > 0 || selection.sectionLines.length > 0)) {
target = { kind: "info", group: selection.sectionLines.length > 0 ? "sectionLine" : null };
}
if (!target) return false;
if (target.kind === "opening") {
deps.openOpeningEditor(target.id);
return true;
}
if (target.group) expandAndFocusInfoGroup(target.group);
deps.revealObjectInfo();
return true;
}
function isGridDrawing(id: string | undefined): boolean {
if (!id) return false;
return getState().project.drawings2d.find((d) => d.id === id)?.geom.shape === "grid";
}
+27
View File
@@ -672,3 +672,30 @@ export function useViewNavigationShortcuts(overrides: ShortcutOverrides): void {
return () => window.removeEventListener("keydown", onKey);
}, [overrides]);
}
/**
* [189] Taste T (rebindbar, `objectSettings`): Einstellungen des gewählten Objekts öffnen (`state/objectSettings.ts`).
* Nicht in Textfeldern/Auswahllisten und nicht, wenn ein laufender Befehl diese Taste als Option-Kürzel belegt.
* `run` liefert `true`, wenn es etwas zu öffnen gab (dann wird die Taste verbraucht).
*/
export function useObjectSettingsShortcut(
overrides: ShortcutOverrides,
engineRef: RefObject<CommandEngine | null>,
run: () => boolean,
): void {
const runRef = useRef(run);
runRef.current = run;
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
if (e.defaultPrevented || isEditableTarget(e) || (e.target as HTMLElement | null)?.tagName === "SELECT") return;
if (!matchesShortcut(e, "objectSettings", overrides)) return;
// Ein laufender Befehl behält seine Option-Kürzel (U/I/O/P …); sonst gilt T auch mitten im Zeichnen.
const eng = engineRef.current;
const k = e.key.toLowerCase();
if (eng?.isActive() && eng.view().options.some((o) => o.key?.toLowerCase() === k)) return;
if (runRef.current()) e.preventDefault();
};
window.addEventListener("keydown", onKey);
return () => window.removeEventListener("keydown", onKey);
}, [overrides, engineRef]);
}
+3
View File
@@ -52,6 +52,8 @@ export function useNativeMenu(opts: {
openSettings: () => void;
openLayerSettings: (code: string, x: number, y: number) => void;
activeCategoryCode: string;
/** [189] Objekteinstellungen (Taste T): Öffnungs-Dialog bzw. Objekt-Info. */
onObjectSettings: () => boolean;
}) {
const {
notify,
@@ -154,6 +156,7 @@ export function useNativeMenu(opts: {
onMove: () => onRunCommand("move"),
onMirror: () => onRunCommand("mirror"),
onRotate: () => onRunCommand("rotate"),
onObjectSettings: () => void opts.onObjectSettings(),
onViewType: setViewType,
onView3d: setView3d,
onReferenceLines: setReferenceLines,