fix: make settings panel scrollable (html/body height:100%), bump window size, robust load
This commit is contained in:
1 parent
ce5aa025aa
commit
56b1e7e161
2 files changed
+6
-2
No files matched your search
+1
-1
@@ -527,7 +527,7 @@ export default function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
showUI({ width: 320, height: 200, themeColors: true, title: 'AI assistant (MVP)' })
|
showUI({ width: 380, height: 480, themeColors: true, title: 'AI assistant (MVP)' })
|
||||||
|
|
||||||
// Restore persisted window placement (saved in clientStorage on the Figma file).
|
// Restore persisted window placement (saved in clientStorage on the Figma file).
|
||||||
// Default when nothing is stored: behave like the Center button (50% viewport, centered).
|
// Default when nothing is stored: behave like the Center button (50% viewport, centered).
|
||||||
|
|||||||
+5
-1
@@ -223,7 +223,10 @@ function Plugin () {
|
|||||||
const [settings, setSettings] = useState<Settings>(defaultSettings())
|
const [settings, setSettings] = useState<Settings>(defaultSettings())
|
||||||
const [loaded, setLoaded] = useState(false)
|
const [loaded, setLoaded] = useState(false)
|
||||||
useEffect(function () {
|
useEffect(function () {
|
||||||
loadSettings().then(function (s) { setSettings(s); setLoaded(true) })
|
loadSettings()
|
||||||
|
.then(function (s) { setSettings(s) })
|
||||||
|
.catch(function () {})
|
||||||
|
.finally(function () { setLoaded(true) })
|
||||||
}, [])
|
}, [])
|
||||||
const resizeRef = useRef({ active: false, dir: '', startX: 0, startY: 0, startW: 0, startH: 0, fixedAxis: 'none' as 'none' | 'x' | 'y' })
|
const resizeRef = useRef({ active: false, dir: '', startX: 0, startY: 0, startW: 0, startH: 0, fixedAxis: 'none' as 'none' | 'x' | 'y' })
|
||||||
// Current dock position (for "window is edge-docked" detection in UI). Center and
|
// Current dock position (for "window is edge-docked" detection in UI). Center and
|
||||||
@@ -516,6 +519,7 @@ function Plugin () {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="plugin-root" style={{ position: 'relative', width: '100%', height: '100%' }}>
|
<div className="plugin-root" style={{ position: 'relative', width: '100%', height: '100%' }}>
|
||||||
|
<style>{'html,body{height:100%;overflow:hidden}'}</style>
|
||||||
<Container space="medium" style={{ height: '100%', display: 'flex', flexDirection: 'column', padding: 0 }}>
|
<Container space="medium" style={{ height: '100%', display: 'flex', flexDirection: 'column', padding: 0 }}>
|
||||||
{/* Header — navigation bar */}
|
{/* Header — navigation bar */}
|
||||||
<header style={{ display: 'flex', alignItems: 'center', flex: '0 0 auto', padding: 'var(--space-8)' }}>
|
<header style={{ display: 'flex', alignItems: 'center', flex: '0 0 auto', padding: 'var(--space-8)' }}>
|
||||||
|
|||||||
Reference in new issue
Block a user