Commit c8b7f3d
Two follow-ups to #3025, both about stopping that bug from recurring.
**The ratchet.** #3025 removed two
`const PanelGroup = ResizablePanelGroup as React.FC<any>` casts. Those
casts were not incidental to the bug — they caused it. Erasing a
component's props to `any` meant that when react-resizable-panels v4
renamed `direction` to `orientation`, the stale prop type-checked against
nothing and survived a whole major version as a dead prop React forwarded
to the DOM. Deleting the casts is what turned it back into a hard TS2322.
What makes this worth a ratchet rather than review vigilance is how both
casts were justified: one blamed vite-plugin-dts for "not resolving the
direction prop type correctly", the other a prop that "does not always
narrow cleanly in our TS config". Neither was true — v4's `GroupProps`
simply has no `direction` key. The cast reads as a workaround for a
toolchain quirk while actually disabling the check that catches a
breaking upstream rename, so it is the kind of thing that gets re-added
in good faith.
Repo-wide over `packages/<pkg>/src` and `apps/<app>/src`, following the
existing `*.ratchet.test.ts` shape (#2269, ADR-0054) so it runs in the
gating `pnpm test` job. Covers `FC` / `FunctionComponent` /
`ComponentType` parameterised with `any`, qualified or not. Current count
is zero, which is why now is the moment to set the gate.
Three tests, because a ratchet has two silent failure modes of its own: a
scan path that finds nothing, and a regex that stops matching. Both are
pinned — the second against the exact casts #3025 removed, plus the
legitimate neighbours it must not fire on (`as Record<string, any>`,
`as ComponentProps<typeof Button>`, `const C: React.FC<Props>`).
**The boundary comment.** `renderers/complex/resizable.tsx` maps
`schema.direction` onto the library's `orientation`. That looks exactly
like a site #3025 missed. It is not: `direction` is ObjectUI's own public
authoring vocabulary and appears in stored view metadata, so renaming it
to match the library would break every saved `resizable` schema. Said so
in place, since the next person to grep for `direction` will land there.
Verified the ratchet actually bites: reintroducing the exact cast into
`custom/navigation-overlay.tsx` fails it with the file and line, and the
four sibling ratchets plus the 15 resizable tests stay green.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent e25e300 commit c8b7f3d
2 files changed
Lines changed: 140 additions & 1 deletion
File tree
- packages
- app-shell/src
- components/src/renderers/complex
Lines changed: 133 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 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 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
0 commit comments