Satelliten-Dialoge: embedded-Mode + GeschossDialog auch als echtes Fenster
Zwei Dinge: 1. embedded-Mode in den Dialog-Komponenten — wenn TRUE, kein Backdrop + keine MaxWidth-Constraint, das Dialog fuellt das ganze WebView statt wie ein kleines zentriertes Fenster IN dem WebView gerendert zu werden (= "Fenster im Fenster"-Effekt). Betroffen: - GeschossSettingsDialog - EbenenSettingsDialog - GeschossDialog Satelliten-Apps (GeschossSettingsApp, EbenenSettingsApp, GeschossDialogApp) passen jetzt `embedded` durch. 2. GeschossDialog (= der grosse Mehrfach-Editor hinter dem Pencil-Button) laeuft jetzt auch als Satelliten-Fenster — selbe Architektur wie die Settings-Dialoge. Backend hat neuen Handler _open_geschoss_dialog und neuen Message OPEN_GESCHOSS_DIALOG. Auf Save: ganze z-Liste replace + _apply(save_z=True). GeschossManager braucht den inline-Dialog-State nicht mehr; Pencil-Button ruft openGeschossDialog(zeichnungsebenen). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import { useEffect } from 'react'
|
||||
import GeschossSettingsDialog from './components/GeschossSettingsDialog'
|
||||
import { onMessage, notifyReady } from './lib/rhinoBridge'
|
||||
import { notifyReady } from './lib/rhinoBridge'
|
||||
|
||||
// Inline send fuer SAVE/CANCEL — schickt direkt an Python-Bridge des
|
||||
// Satelliten-Fensters.
|
||||
function bridgeSend(type, payload = {}) {
|
||||
if (!window.RHINO_MODE) { console.log('[Bridge] →', type, payload); return }
|
||||
const json = JSON.stringify({ type, payload })
|
||||
@@ -11,33 +9,25 @@ function bridgeSend(type, payload = {}) {
|
||||
}
|
||||
|
||||
export default function GeschossSettingsApp() {
|
||||
// PANEL_PARAMS wurden von Python beim Window-Open injiziert.
|
||||
const initial = (typeof window !== 'undefined' && window.PANEL_PARAMS) || {}
|
||||
|
||||
useEffect(() => {
|
||||
notifyReady()
|
||||
// Native Browser-Context-Menu unterdruecken
|
||||
const blockContext = (ev) => ev.preventDefault()
|
||||
document.addEventListener('contextmenu', blockContext)
|
||||
return () => document.removeEventListener('contextmenu', blockContext)
|
||||
}, [])
|
||||
|
||||
// Wenn keine Daten da sind: leeres Frame
|
||||
if (!initial || typeof initial !== 'object') {
|
||||
return <div style={{ padding: 20, color: 'var(--text-muted)' }}>Keine Daten</div>
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{
|
||||
width: '100vw', height: '100vh',
|
||||
background: 'var(--bg-base)',
|
||||
overflow: 'hidden',
|
||||
}}>
|
||||
<GeschossSettingsDialog
|
||||
geschoss={initial}
|
||||
onSave={(updated) => bridgeSend('SAVE', updated)}
|
||||
onClose={() => bridgeSend('CANCEL', {})}
|
||||
/>
|
||||
</div>
|
||||
<GeschossSettingsDialog
|
||||
embedded
|
||||
geschoss={initial}
|
||||
onSave={(updated) => bridgeSend('SAVE', updated)}
|
||||
onClose={() => bridgeSend('CANCEL', {})}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user