Commit d4b260c
fix(studio): designer canvas no longer freezes on drawer/modal form blocks (#1840)
The page designer's live block preview (PageBlockCanvas → BlockLivePreview)
renders each block with the real runtime renderer behind a `pointer-events-none`
click-trap. For an `object-form` block whose `formType` is `drawer` (or `modal`),
the rendered DrawerForm/ModalForm mounts a Radix Sheet/Dialog through a portal at
<body> with `open` defaulting to true. The portalled overlay escapes the
click-trap, and Radix's modal mode sets `pointer-events:none` on <body> plus a
focus trap — so the entire designer becomes unresponsive ("the UI freezes") the
moment you pick "Drawer" for a form block.
Coerce overlay form types to an inline `simple` form before handing the schema to
SchemaRenderer (new `toCanvasSchema`), mirroring the existing ViewPreview
INLINE_FORM_TYPES guard. The canvas shows the form's field layout in place; the
saved metadata keeps its real formType.
Adds unit tests for the coercion (drawer/modal → simple, inline types untouched,
top-level + properties shapes, no input mutation, non-form blocks unchanged).
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent d237e6f commit d4b260c
2 files changed
Lines changed: 82 additions & 4 deletions
File tree
- packages/app-shell/src/views/metadata-admin/previews
Lines changed: 50 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
Lines changed: 32 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
41 | 71 | | |
42 | | - | |
43 | | - | |
| 72 | + | |
44 | 73 | | |
45 | 74 | | |
46 | 75 | | |
47 | 76 | | |
48 | 77 | | |
49 | 78 | | |
50 | | - | |
| 79 | + | |
51 | 80 | | |
52 | 81 | | |
53 | 82 | | |
| |||
0 commit comments