Commit fc3e490
Prevent Image/Link prop type mismatch in generated components
props.Image returns {src, alt} and props.Link returns {href, target} — not
plain strings. Components that typed these as string caused [object Object]
rendering at runtime (found in AvatarGroup, Breadcrumbs, CarouselSlider,
CmsFilterSearch).
Three-layer fix:
1. Prompt (generate_react_component@v1): Added rule 11 with explicit table,
rules, and code example showing correct types and JSX usage
2. Deterministic check Webflow-Examples#12: Detects when a prop declared as props.Image or
props.Link in the webflow declaration is typed as string in the React
component — fails the quality gate and feeds back exact fix instructions
3. types.ts / workflow.ts: Added imageLinkPropsCorrect to DeterministicChecks
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent 6d43d56 commit fc3e490
File tree
4 files changed
+62
-2
lines changed- webflow-code-components/src/workflows/component_generator
- prompts
4 files changed
+62
-2
lines changedLines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
114 | 150 | | |
115 | 151 | | |
116 | 152 | | |
| |||
121 | 157 | | |
122 | 158 | | |
123 | 159 | | |
124 | | - | |
| 160 | + | |
125 | 161 | | |
126 | 162 | | |
127 | 163 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
301 | 322 | | |
302 | 323 | | |
303 | 324 | | |
| |||
310 | 331 | | |
311 | 332 | | |
312 | 333 | | |
| 334 | + | |
313 | 335 | | |
314 | 336 | | |
315 | 337 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
0 commit comments