From edf245a21c055367ec9df7099cfd926b94626e25 Mon Sep 17 00:00:00 2001 From: Julian Appel Date: Tue, 28 Jul 2026 20:43:08 +0200 Subject: [PATCH] Use full-width editor device drawer --- docs/current-architecture.md | 6 +++ src/app/globals.css | 52 ++++++++++++++++--- .../[circuitListId]/tree-edit/page.tsx | 4 +- .../components/circuit-tree-editor.tsx | 37 ++++++++++++- 4 files changed, 88 insertions(+), 11 deletions(-) diff --git a/docs/current-architecture.md b/docs/current-architecture.md index 4b40f51..55913aa 100644 --- a/docs/current-architecture.md +++ b/docs/current-architecture.md @@ -167,6 +167,12 @@ Felder und vollständiger Zeilenbestand unverändert sind. Der Editor erzeugt die vollständigen Move-Zuweisungen aus dem geladenen Tree, vergibt für neue Ziele vor dem Kommando eine stabile UUID und führt das Toolbar-Undo/Redo über die projektweite Historie aus. +Die Projektgerätepalette belegt keine permanente Layoutspalte mehr. Sie wird +über die Editor-Toolbar als überlagernder Drawer geöffnet, während das +Stromkreis-Grid standardmäßig die gesamte verfügbare Breite nutzt. Auswahl, +Schnelleinfügen und die vorhandenen Drag-and-drop-Payloads bleiben im Drawer +unverändert verfügbar; während eines aktiven Projektgeräte-Drags kann er nicht +geschlossen werden. `circuit.reorder-section` speichert die erwartete und neue Sortierposition jedes Stromkreises eines vollständigen Abschnitts. Forward, Undo und Redo ändern ausschließlich `sortOrder`; Stromkreisblöcke, Gerätezeilen und BMKs diff --git a/src/app/globals.css b/src/app/globals.css index e3a6ab1..7eb2c4f 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -71,6 +71,13 @@ body { opacity: 0.45; } +.editor-toolbar .project-device-drawer-toggle { + border-color: #2563eb; + background: #2563eb; + color: #fff; + font-weight: 600; +} + .active-view-summary { display: flex; flex-wrap: wrap; @@ -271,12 +278,10 @@ body { } .tree-editor-layout { - display: grid; - grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); - gap: 0.75rem; + display: block; min-height: 560px; min-width: 0; - align-items: start; + position: relative; } .project-device-sidebar { @@ -404,6 +409,38 @@ body { cursor: pointer; } +.project-device-drawer { + position: fixed; + z-index: 1040; + top: 5.5rem; + left: 1rem; + width: min(360px, calc(100vw - 2rem)); + max-height: calc(100vh - 7rem); + overflow: auto; + border-radius: 0.5rem; + box-shadow: 0 0.75rem 2rem rgba(31, 41, 55, 0.22); +} + +.project-device-drawer-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 0.75rem; +} + +.project-device-drawer-header span { + color: #6b7280; + font-size: 0.75rem; +} + +.project-device-drawer-header button { + border: 1px solid #c4cddc; + background: #fff; + border-radius: 4px; + padding: 0.25rem 0.4rem; + font-size: 0.78rem; +} + .tree-grid .header-sort-btn:hover span:first-child, .tree-grid .header-sort-btn:focus-visible span:first-child { text-decoration: underline; @@ -783,8 +820,9 @@ body { margin: 0; } -@media (max-width: 1200px) { - .tree-editor-layout { - grid-template-columns: 1fr; +@media (max-width: 720px) { + .project-device-drawer { + top: 4.5rem; + max-height: calc(100vh - 5.5rem); } } diff --git a/src/app/projects/[projectId]/circuit-lists/[circuitListId]/tree-edit/page.tsx b/src/app/projects/[projectId]/circuit-lists/[circuitListId]/tree-edit/page.tsx index 4c4ce86..f661942 100644 --- a/src/app/projects/[projectId]/circuit-lists/[circuitListId]/tree-edit/page.tsx +++ b/src/app/projects/[projectId]/circuit-lists/[circuitListId]/tree-edit/page.tsx @@ -8,8 +8,8 @@ export default function CircuitTreeEditPage() { const params = useParams<{ projectId: string; circuitListId: string }>(); return ( -
-
+
+

Stromkreisliste

Stromkreise und zugeordnete Geräte bearbeiten.

diff --git a/src/frontend/components/circuit-tree-editor.tsx b/src/frontend/components/circuit-tree-editor.tsx index 92eeae5..729f4fe 100644 --- a/src/frontend/components/circuit-tree-editor.tsx +++ b/src/frontend/components/circuit-tree-editor.tsx @@ -196,6 +196,8 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str const [activeSectionId, setActiveSectionId] = useState(null); const [isSaving, setIsSaving] = useState(false); const [projectDevices, setProjectDevices] = useState([]); + const [isProjectDeviceDrawerOpen, setIsProjectDeviceDrawerOpen] = + useState(false); const [projectDeviceSearch, setProjectDeviceSearch] = useState(""); const [selectedProjectDeviceId, setSelectedProjectDeviceId] = useState(null); const [targetSectionId, setTargetSectionId] = useState(null); @@ -2537,6 +2539,19 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str +
: null}
-
+ ) : null}