AGPL-3.0 Dual-Lizenz + Pill-Stil-UI + Section-Style-Overhaul + Plan-Mode-Template
Lizenz: - AGPL-3.0 LICENSE-File im Repo-Root (GNU Volltext) - SPDX-Header + Copyright in allen Source-Files (Python/JSX/JS/Rust) - license-Feld in package.json + Cargo.toml - About-App komplett neu: Dual-Lizenz-Block (AGPL + Commercial), openbureau-Branding, Version-Pills, made-in-Switzerland-Footer UI-Restyle (3 Wellen) — alle Dialoge + Satellites + Panel-Sidebars auf gemeinsamen Pill-Stil aus BarControls (BarToggle/BarButton/BarCombo): - Welle 1: GeschossDialog/Settings, AusschnittSettings, LayoutDialog - Welle 2: ConfirmDeleteEbene, Kamera, MasseSettings, Osm, Swisstopo, TextEditor, AusschnittLayerDialog, LayerCombinations - Welle 3: LayoutsApp, MassstabApp, WerkzeugeApp, OverridesApp, ZeichnungsebenenApp; Werkzeuge mit ElementeApp-PillGroup-Layout GeschossDialog Header-Refactor: +Geschoss/+Zeichnung in Toolbar oben, move-Pfeile-Spalte breiter (kein Overlap mit G-Haken) Ausschnitte Rows als Pills, kein Outer-Border ums Suchfeld Section-Style komplett neu (gestaltung.py + GestaltungApp.jsx): - ObjectSectionAttributesSource.FromObject (richtiger Enum-Name fuer Mac) - HatchPatternPrintColor + BoundaryPrintColor mit-setzen (Display = Print) - BoundaryColor nur bei explizitem User-Override, sonst Rhino-Default - background_color_hex Parameter (BackgroundFillMode=SolidColor) - Readback aus GetCustomSectionStyle statt direkt aus Attributes - UI: Schnittkante > Section Style > Solid-Fill mit proper SectionHead - 'Boundary' (3D Pen) -> 'Background' weil sich's wie Section-Hintergrund verhaelt Plan-Mode 'Dossier Plan' via Template: - rhino/templates/dossier_plan.ini wird direkt geladen - Fallback auf Technical-Clone + ini-Patch wenn Template fehlt - Auto-Cleanup von Orphan-Modes vor Import (Name- oder Guid-Match) - ClipSectionUsage=1 + TechnicalMask=15 als bekannte Soll-Werte - Bei Template-Pfad keine ini-Patches (1:1 wie User exportiert) - Sanity-Print listet alle registrierten Modes nach Anlegen Bridge-Unification: 4 Settings-Apps (Ebenen/Project/Geschoss*Dialog) benutzen jetzt chunkende send() statt eigene bridgeSend ohne Chunk- Logik -> grosse Payloads (Hatch-Refs etc.) kommen nicht mehr truncated bei Python an (loeste 'JSON-Fehler char 990'-Regression in Ebenen- Settings) Library-Imports robust: 'import library' jetzt Top-Level in elemente.py + rhinopanel.py (statt Lazy in Methoden) -> 'No module named library'- Crashes weg auch wenn sys.path zwischendurch resettet wird Tools fuer Display-Mode-Maintenance: - _clean_display_modes.py (loescht alle Custom-Modes, Built-ins bleiben) - _inspect_plan_mode.py / _inspect_obj_section.py / _inspect_obj_boundary.py (Diagnose-Skripte fuer SectionStyle-Property-Reverse-Engineering) - _reset_rhino_settings.sh (Backup + Nuke der Rhino-Settings als letzte Bastion gegen korrupte Display-Modes)
This commit is contained in:
+101
-111
@@ -1,6 +1,9 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
// Copyright (C) 2026 Karim Gabriele Varano
|
||||
import { useState, useEffect } from 'react'
|
||||
import Icon from './components/Icon'
|
||||
import ContextMenu from './components/ContextMenu'
|
||||
import { BarToggle, BarButton, BarCombo, BAR_H } from './components/BarControls'
|
||||
import {
|
||||
onMessage, notifyReady,
|
||||
setOverridesEnabled, addRule, updateRule, deleteRule,
|
||||
@@ -29,6 +32,18 @@ const labelXs = {
|
||||
fontWeight: 600,
|
||||
}
|
||||
|
||||
const pillInput = {
|
||||
height: BAR_H,
|
||||
background: 'var(--bg-input)',
|
||||
border: '1px solid var(--border)',
|
||||
borderRadius: 999,
|
||||
color: 'var(--text-primary)',
|
||||
fontSize: 11, fontFamily: 'var(--font)',
|
||||
padding: '0 10px',
|
||||
outline: 'none',
|
||||
boxSizing: 'border-box',
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function ConditionLeaf({ cond, layers, onChange, onRemove, canRemove }) {
|
||||
@@ -42,18 +57,14 @@ function ConditionLeaf({ cond, layers, onChange, onRemove, canRemove }) {
|
||||
background: 'var(--bg-section)',
|
||||
}}>
|
||||
<div style={{ display: 'flex', gap: 6, alignItems: 'center' }}>
|
||||
<select
|
||||
<BarCombo stretch
|
||||
value={t}
|
||||
onChange={(e) => onChange({ ...cond, type: e.target.value })}
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
>
|
||||
onChange={(v) => onChange({ ...cond, type: v })}>
|
||||
{COND_TYPES.map(c => <option key={c.value} value={c.value}>{c.label}</option>)}
|
||||
</select>
|
||||
</BarCombo>
|
||||
{canRemove && (
|
||||
<button onClick={onRemove} className="btn-icon-danger"
|
||||
title="Diese Bedingung entfernen">
|
||||
<Icon name="close" size={14} />
|
||||
</button>
|
||||
<BarButton icon="close" onClick={onRemove}
|
||||
title="Diese Bedingung entfernen" />
|
||||
)}
|
||||
</div>
|
||||
{t === 'user_string' && (
|
||||
@@ -61,34 +72,31 @@ function ConditionLeaf({ cond, layers, onChange, onRemove, canRemove }) {
|
||||
type="text" placeholder="Key"
|
||||
value={cond?.key || ''}
|
||||
onChange={(e) => onChange({ ...cond, key: e.target.value })}
|
||||
style={{ width: '100%' }}
|
||||
style={{ ...pillInput, width: '100%' }}
|
||||
/>
|
||||
)}
|
||||
<div style={{ display: 'flex', gap: 6, alignItems: 'center' }}>
|
||||
<select
|
||||
<BarCombo
|
||||
value={op}
|
||||
onChange={(e) => onChange({ ...cond, operator: e.target.value })}
|
||||
style={{ flexShrink: 0 }}
|
||||
>
|
||||
onChange={(v) => onChange({ ...cond, operator: v })}
|
||||
width={100}>
|
||||
{OPS.map(o => <option key={o.value} value={o.value}>{o.label}</option>)}
|
||||
</select>
|
||||
</BarCombo>
|
||||
{t === 'layer_name' ? (
|
||||
<select
|
||||
<BarCombo stretch
|
||||
value={cond?.value || ''}
|
||||
onChange={(e) => onChange({ ...cond, value: e.target.value })}
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
>
|
||||
onChange={(v) => onChange({ ...cond, value: v })}>
|
||||
<option value="">—</option>
|
||||
{(layers || []).map(l => (
|
||||
<option key={l.fullPath} value={l.fullPath}>{l.fullPath}</option>
|
||||
))}
|
||||
</select>
|
||||
</BarCombo>
|
||||
) : (
|
||||
<input
|
||||
type="text" placeholder="Wert"
|
||||
value={cond?.value || ''}
|
||||
onChange={(e) => onChange({ ...cond, value: e.target.value })}
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
style={{ ...pillInput, flex: 1, minWidth: 0 }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -124,16 +132,14 @@ function ConditionsEditor({ rule, layers, onChange }) {
|
||||
{conds.length > 1 && (
|
||||
<div style={{ display: 'flex', gap: 4, alignItems: 'center' }}>
|
||||
<span style={{ fontSize: 10, color: 'var(--text-muted)' }}>Logik:</span>
|
||||
<button
|
||||
<BarToggle label="AND"
|
||||
active={logic === 'and'}
|
||||
onClick={() => setLogic('and')}
|
||||
className={logic === 'and' ? 'btn-contained' : 'btn-outlined'}
|
||||
title="Alle Bedingungen müssen zutreffen"
|
||||
>AND</button>
|
||||
<button
|
||||
title="Alle Bedingungen müssen zutreffen" />
|
||||
<BarToggle label="OR"
|
||||
active={logic === 'or'}
|
||||
onClick={() => setLogic('or')}
|
||||
className={logic === 'or' ? 'btn-contained' : 'btn-outlined'}
|
||||
title="Mindestens eine Bedingung muss zutreffen"
|
||||
>OR</button>
|
||||
title="Mindestens eine Bedingung muss zutreffen" />
|
||||
</div>
|
||||
)}
|
||||
{conds.map((c, i) => (
|
||||
@@ -146,11 +152,11 @@ function ConditionsEditor({ rule, layers, onChange }) {
|
||||
canRemove={conds.length > 1}
|
||||
/>
|
||||
))}
|
||||
<button onClick={add} className="btn-outlined" style={{ alignSelf: 'flex-start' }}
|
||||
title="Weitere Bedingung hinzufügen">
|
||||
<Icon name="add" size={14} />
|
||||
<span>Bedingung</span>
|
||||
</button>
|
||||
<div style={{ alignSelf: 'flex-start' }}>
|
||||
<BarToggle icon="add" label="Bedingung"
|
||||
onClick={add}
|
||||
title="Weitere Bedingung hinzufügen" />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -200,14 +206,16 @@ function ActionsEditor({ actions, linetypes, hatchPatterns, onChange }) {
|
||||
type="color"
|
||||
value={a.color || '#888888'}
|
||||
onChange={(e) => setProp('color', e.target.value)}
|
||||
style={{ width: 36, height: 26, padding: 2, flexShrink: 0 }}
|
||||
style={{ width: 32, height: BAR_H, padding: 0, flexShrink: 0,
|
||||
border: '1px solid var(--border)', borderRadius: 999,
|
||||
background: 'var(--bg-input)' }}
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
value={a.color || ''}
|
||||
placeholder="#rrggbb"
|
||||
onChange={(e) => setProp('color', e.target.value)}
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
style={{ ...pillInput, flex: 1, minWidth: 0, fontFamily: 'DM Mono, monospace' }}
|
||||
/>
|
||||
</ActionRow>
|
||||
|
||||
@@ -220,7 +228,7 @@ function ActionsEditor({ actions, linetypes, hatchPatterns, onChange }) {
|
||||
type="number" step={0.05} min={0}
|
||||
value={a.lineweight ?? ''}
|
||||
onChange={(e) => setProp('lineweight', parseFloat(e.target.value) || 0)}
|
||||
style={{ width: 80 }}
|
||||
style={{ ...pillInput, width: 80, fontFamily: 'DM Mono, monospace' }}
|
||||
/>
|
||||
<span style={{ fontSize: 10, color: 'var(--text-muted)' }}>mm</span>
|
||||
</ActionRow>
|
||||
@@ -230,14 +238,12 @@ function ActionsEditor({ actions, linetypes, hatchPatterns, onChange }) {
|
||||
active={'linetype' in a}
|
||||
onToggle={(e) => setProp('linetype', e.target.checked ? (a.linetype || 'Continuous') : '')}
|
||||
>
|
||||
<select
|
||||
<BarCombo stretch
|
||||
value={a.linetype || ''}
|
||||
onChange={(e) => setProp('linetype', e.target.value)}
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
>
|
||||
onChange={(v) => setProp('linetype', v)}>
|
||||
<option value="">—</option>
|
||||
{(linetypes || []).map(lt => <option key={lt} value={lt}>{lt}</option>)}
|
||||
</select>
|
||||
</BarCombo>
|
||||
</ActionRow>
|
||||
|
||||
<ActionRow
|
||||
@@ -245,14 +251,12 @@ function ActionsEditor({ actions, linetypes, hatchPatterns, onChange }) {
|
||||
active={'hatchPattern' in a}
|
||||
onToggle={(e) => setProp('hatchPattern', e.target.checked ? (a.hatchPattern || 'Solid') : '')}
|
||||
>
|
||||
<select
|
||||
<BarCombo stretch
|
||||
value={a.hatchPattern || ''}
|
||||
onChange={(e) => setProp('hatchPattern', e.target.value)}
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
>
|
||||
onChange={(v) => setProp('hatchPattern', v)}>
|
||||
<option value="">—</option>
|
||||
{(hatchPatterns || []).map(hp => <option key={hp} value={hp}>{hp}</option>)}
|
||||
</select>
|
||||
</BarCombo>
|
||||
</ActionRow>
|
||||
|
||||
<ActionRow
|
||||
@@ -264,7 +268,7 @@ function ActionsEditor({ actions, linetypes, hatchPatterns, onChange }) {
|
||||
type="number" step={0.1} min={0.001}
|
||||
value={a.hatchScale ?? ''}
|
||||
onChange={(e) => setProp('hatchScale', parseFloat(e.target.value) || 1.0)}
|
||||
style={{ width: 80 }}
|
||||
style={{ ...pillInput, width: 80, fontFamily: 'DM Mono, monospace' }}
|
||||
/>
|
||||
</ActionRow>
|
||||
|
||||
@@ -322,12 +326,11 @@ function RuleCard({ rule, index, total, layers, linetypes, hatchPatterns, onPatc
|
||||
value={rule.name || ''}
|
||||
placeholder="Regel-Name"
|
||||
onChange={(e) => onPatch({ ...rule, name: e.target.value })}
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
style={{ ...pillInput, flex: 1, minWidth: 0 }}
|
||||
/>
|
||||
<button onClick={() => setOpen(!open)} className="btn-icon"
|
||||
title={open ? 'Einklappen' : 'Bearbeiten'}>
|
||||
<Icon name={open ? 'expand_less' : 'edit'} size={14} />
|
||||
</button>
|
||||
<BarButton icon={open ? 'expand_less' : 'edit'}
|
||||
onClick={() => setOpen(!open)}
|
||||
title={open ? 'Einklappen' : 'Bearbeiten'} />
|
||||
</div>
|
||||
|
||||
{!open && (
|
||||
@@ -339,23 +342,22 @@ function RuleCard({ rule, index, total, layers, linetypes, hatchPatterns, onPatc
|
||||
|
||||
{open && (
|
||||
<>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 2, marginTop: 8 }}>
|
||||
<button onClick={() => onMoveUp()} disabled={index === 0}
|
||||
className="btn-icon-sm" title="Prio höher (nach oben)">
|
||||
<Icon name="arrow_upward" size={14} />
|
||||
</button>
|
||||
<button onClick={() => onMoveDown()} disabled={index === total - 1}
|
||||
className="btn-icon-sm" title="Prio tiefer (nach unten)">
|
||||
<Icon name="arrow_downward" size={14} />
|
||||
</button>
|
||||
<button onClick={() => onDuplicate()} className="btn-icon-sm" title="Duplizieren">
|
||||
<Icon name="content_copy" size={14} />
|
||||
</button>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4, marginTop: 8 }}>
|
||||
<BarButton icon="arrow_upward"
|
||||
onClick={() => onMoveUp()}
|
||||
disabled={index === 0}
|
||||
title="Prio höher (nach oben)" />
|
||||
<BarButton icon="arrow_downward"
|
||||
onClick={() => onMoveDown()}
|
||||
disabled={index === total - 1}
|
||||
title="Prio tiefer (nach unten)" />
|
||||
<BarButton icon="content_copy"
|
||||
onClick={() => onDuplicate()}
|
||||
title="Duplizieren" />
|
||||
<div style={{ flex: 1 }} />
|
||||
<button onClick={() => { if (confirm(`Regel "${rule.name}" löschen?`)) onDelete() }}
|
||||
className="btn-icon-danger" title="Löschen">
|
||||
<Icon name="delete" size={14} />
|
||||
</button>
|
||||
<BarButton icon="delete"
|
||||
onClick={() => { if (confirm(`Regel "${rule.name}" löschen?`)) onDelete() }}
|
||||
title="Löschen" />
|
||||
</div>
|
||||
|
||||
<div style={{ marginTop: 10, display: 'flex', flexDirection: 'column', gap: 10 }}>
|
||||
@@ -476,10 +478,9 @@ export default function OverridesApp() {
|
||||
borderRadius: 'var(--r-lg)',
|
||||
}}>
|
||||
<span style={labelXs}>Override-Kombinationen</span>
|
||||
<select
|
||||
<BarCombo stretch
|
||||
value={selectedPreset}
|
||||
onChange={(e) => {
|
||||
const v = e.target.value
|
||||
onChange={(v) => {
|
||||
setSelectedPreset(v)
|
||||
if (v) {
|
||||
loadPreset(v, 'replace')
|
||||
@@ -487,40 +488,36 @@ export default function OverridesApp() {
|
||||
clearOverrideRules()
|
||||
}
|
||||
}}
|
||||
style={{ width: '100%' }}
|
||||
title="Kombination zum Bearbeiten oeffnen"
|
||||
>
|
||||
title="Kombination zum Bearbeiten oeffnen">
|
||||
<option value="">— neu / keine —</option>
|
||||
{(state.presets || []).map(p => (
|
||||
<option key={p.name} value={p.name}>
|
||||
{p.name} ({p.ruleCount})
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</BarCombo>
|
||||
<div style={{ display: 'flex', gap: 6 }}>
|
||||
<button
|
||||
onClick={() => {
|
||||
if (selectedPreset) { savePreset(selectedPreset); return }
|
||||
const existing = (state.presets || []).map(p => p.name)
|
||||
const def = `Kombination ${existing.length + 1}`
|
||||
const name = window.prompt('Name für neue Kombination:', def)
|
||||
if (!name || !name.trim()) return
|
||||
const t = name.trim()
|
||||
if (existing.includes(t) && !window.confirm(`Kombination "${t}" überschreiben?`)) return
|
||||
savePreset(t)
|
||||
setSelectedPreset(t)
|
||||
}}
|
||||
disabled={state.rules.length === 0}
|
||||
className="btn-outlined"
|
||||
style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 6 }}
|
||||
title={selectedPreset
|
||||
? `Änderungen in "${selectedPreset}" speichern`
|
||||
: 'Aktuelle Regeln als neue Kombination speichern'}
|
||||
>
|
||||
<Icon name="save" size={14} />
|
||||
<span>{selectedPreset ? 'Speichern' : 'Als Kombination speichern…'}</span>
|
||||
</button>
|
||||
<button
|
||||
<div style={{ flex: 1 }}>
|
||||
<BarToggle icon="save"
|
||||
label={selectedPreset ? 'Speichern' : 'Als Kombination speichern…'}
|
||||
active={state.rules.length > 0}
|
||||
disabled={state.rules.length === 0}
|
||||
onClick={() => {
|
||||
if (selectedPreset) { savePreset(selectedPreset); return }
|
||||
const existing = (state.presets || []).map(p => p.name)
|
||||
const def = `Kombination ${existing.length + 1}`
|
||||
const name = window.prompt('Name für neue Kombination:', def)
|
||||
if (!name || !name.trim()) return
|
||||
const t = name.trim()
|
||||
if (existing.includes(t) && !window.confirm(`Kombination "${t}" überschreiben?`)) return
|
||||
savePreset(t)
|
||||
setSelectedPreset(t)
|
||||
}}
|
||||
title={selectedPreset
|
||||
? `Änderungen in "${selectedPreset}" speichern`
|
||||
: 'Aktuelle Regeln als neue Kombination speichern'} />
|
||||
</div>
|
||||
<BarButton icon="delete"
|
||||
onClick={() => {
|
||||
if (!selectedPreset) return
|
||||
if (!window.confirm(`Kombination "${selectedPreset}" dauerhaft loeschen?`)) return
|
||||
@@ -528,11 +525,7 @@ export default function OverridesApp() {
|
||||
setSelectedPreset('')
|
||||
}}
|
||||
disabled={!selectedPreset}
|
||||
className="btn-icon-danger"
|
||||
title="Gewaehlte Kombination dauerhaft loeschen"
|
||||
>
|
||||
<Icon name="delete" size={14} />
|
||||
</button>
|
||||
title="Gewaehlte Kombination dauerhaft loeschen" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -551,10 +544,9 @@ export default function OverridesApp() {
|
||||
>
|
||||
<Icon name="add" size={16} />
|
||||
</button>
|
||||
<select
|
||||
<BarCombo stretch
|
||||
value={selectedTemplate}
|
||||
onChange={(e) => {
|
||||
const v = e.target.value
|
||||
onChange={(v) => {
|
||||
if (!v) { setSelectedTemplate(''); return }
|
||||
if (v === '__delete__') {
|
||||
if (!selectedTemplate) return
|
||||
@@ -566,9 +558,7 @@ export default function OverridesApp() {
|
||||
addFromTemplate(v)
|
||||
setSelectedTemplate(v)
|
||||
}}
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
title="Regel aus Vorlage einfuegen"
|
||||
>
|
||||
title="Regel aus Vorlage einfuegen">
|
||||
<option value="">+ Aus Vorlage…</option>
|
||||
{(state.ruleTemplates || []).map(t => (
|
||||
<option key={t.name} value={t.name}>{t.name}</option>
|
||||
@@ -579,7 +569,7 @@ export default function OverridesApp() {
|
||||
<option value="__delete__">🗑 "{selectedTemplate}" loeschen</option>
|
||||
</>
|
||||
)}
|
||||
</select>
|
||||
</BarCombo>
|
||||
</div>
|
||||
|
||||
<div style={{ fontSize: 10, color: 'var(--text-muted)', fontStyle: 'italic', lineHeight: 1.4 }}>
|
||||
|
||||
Reference in New Issue
Block a user