|
6 | 6 |
|
7 | 7 | > **Status: archival.** This log describes the factory-based public API (`createWorkflowBuilder({...})`) that was the SDK entry point as of 22.04.2026. Superseded by `refactor/wb-root-context` — `createWorkflowBuilder`, `Editor`, `WorkflowBuilderConfig`, `WorkflowBuilderInstance(Props)`, and `defineNodeTemplate` are all gone; the entry point is now `<WorkflowBuilder.Root>`. References below describe the world as of the decision date and are intentionally not rewritten — see current SDK exports in `packages/sdk/src/index.ts` for the post-refactor surface. |
8 | 8 |
|
| 9 | +> **CSS namespace note:** `--wb-background-color` references below preserve the historical name. The supported control is now `--wb-public-background-color`. |
| 10 | +
|
9 | 11 | ## Context |
10 | 12 |
|
11 | 13 | Phase 1 of the SDK work shipped `@workflowbuilder/sdk` as a thin facade over `apps/frontend`: the SDK's `src/index.ts` barrel just re-exported `Editor` and `createWorkflowBuilder` from the frontend via `@workflow-builder/frontend/app/*` tsconfig paths and Vite aliases. That worked as a distribution shell but left a mess underneath — "frontend" was simultaneously an SPA and the canonical source of the editor component, and the SDK looked like it was what it wasn't. |
@@ -136,7 +138,7 @@ Two regressions and one gap became visible only once an external consumer app ac |
136 | 138 |
|
137 | 139 | - **i18n regression (Phase 3a side-effect).** Plugins used to register translations via module-load side effects, which populated the shared `pluginsResource` before `i18n.init()` read it. Phase 3a moved plugin registration into the `createWorkflowBuilder({ plugins: [...] })` factory call, which executes **after** the SDK module graph has initialized i18next — so `registerPluginTranslation` updates a module-level object that i18next no longer consults. Plugin keys (`plugins.flowRunner.groupFlow`, `plugins.help.helpSupport`, etc.) surfaced as raw strings in the UI. Fix: `registerPluginTranslation` now calls `i18n.addResourceBundle(lang, 'translation', { plugins: ... }, true, true)` in addition to updating `pluginsResource`. Works regardless of when plugins register relative to i18next init. |
138 | 140 |
|
139 | | -- **CSS incompleteness — SDK's `index.css` was a partial copy of demo's `global.css`.** Missing `body { margin: 0; background-color: var(--wb-public-background-color); overflow: hidden; }` rule left consumer apps with a white canvas instead of the tokenized grey background. Missing `@layer ui { @layer base, component; }` sub-layer declaration. Missing Google Fonts `@import` for Poppins left consumers with `sans-serif` fallback (since SDK's font stack was `'Poppins', sans-serif`). All three folded into [`packages/sdk/src/index.css`](./src/index.css). The Poppins `@import` plus a widened fallback chain (`system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif`) means consumers get a correct render without wiring up Google Fonts themselves. |
| 141 | +- **CSS incompleteness — SDK's `index.css` was a partial copy of demo's `global.css`.** Missing `body { margin: 0; background-color: var(--wb-background-color); overflow: hidden; }` rule left consumer apps with a white canvas instead of the tokenized grey background. Missing `@layer ui { @layer base, component; }` sub-layer declaration. Missing Google Fonts `@import` for Poppins left consumers with `sans-serif` fallback (since SDK's font stack was `'Poppins', sans-serif`). All three folded into [`packages/sdk/src/index.css`](./src/index.css). The Poppins `@import` plus a widened fallback chain (`system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif`) means consumers get a correct render without wiring up Google Fonts themselves. |
140 | 142 |
|
141 | 143 | - **CSS `@import` ordering.** CSS spec requires `@import` before every other statement except `@charset` and _empty_ `@layer` declarations. The sub-layer block (`@layer ui { @layer base, component; }`) has a body and therefore counts as a statement — it must come **after** all `@import`s. PostCSS flagged this in demo's build. Reordered. |
142 | 144 |
|
@@ -164,7 +166,7 @@ Smaller follow-ups from the next review pass. None are architectural; together t |
164 | 166 |
|
165 | 167 | - **`@xyflow/react` peer-dep range tightened.** `>=12.0.0` accepted any future major; replaced with `^12.0.0` to keep semver-major changes from auto-installing into consumer apps without us having validated the SDK against them. |
166 | 168 |
|
167 | | -- **CSS body reset documented.** `packages/sdk/src/index.css` resets `body` (`margin: 0`, `background-color: var(--wb-public-background-color)`, `overflow: hidden`) inside `@layer reset` — the lowest-precedence layer in the SDK's cascade, so consumer rules win without `!important`. The behaviour is still a surprise to a consumer who imports `style.css`, especially the `overflow: hidden` (which prevents page-level scrolling outside the editor). Added a `packages/sdk/README.md` documenting the resets, what they do, and how to override. The README is intentionally minimal — broader consumer docs (install / usage / screenshots) ride on the npm-publish prep that's still deferred. |
| 169 | +- **CSS body reset documented.** `packages/sdk/src/index.css` resets `body` (`margin: 0`, `background-color: var(--wb-background-color)`, `overflow: hidden`) inside `@layer reset` — the lowest-precedence layer in the SDK's cascade, so consumer rules win without `!important`. The behaviour is still a surprise to a consumer who imports `style.css`, especially the `overflow: hidden` (which prevents page-level scrolling outside the editor). Added a `packages/sdk/README.md` documenting the resets, what they do, and how to override. The README is intentionally minimal — broader consumer docs (install / usage / screenshots) ride on the npm-publish prep that's still deferred. |
168 | 170 |
|
169 | 171 | **Why:** the schema move closes the gap left after § 8 — once the public barrel is curated, anything still in it has to clear the same scope-boundary bar. The default-export cleanup is hygiene against a lint convention that wasn't enforced as a rule. The peer-dep tightening protects consumers against drive-by majors. The README closes the most likely "I imported your CSS and now my page can't scroll" support ticket. |
170 | 172 |
|
|
0 commit comments