Conversation
pnpm workspace:* protocol and package.json exports fields handle @repo/* resolution natively — the hand-rolled getWorkspaceAliases function was redundant.
- Add react, @tanstack/react-query, and @storybook/react to storybook-utils package.json so it declares its own contracts. - Rename setState param from T to state in preview.ts mock. - Fix import ordering across story and test files (lint autofix).
- Add tsconfig.json for @repo/mocks and @repo/storybook-utils so eslint's project service can find them. - Fix import ordering in mocks/tasks.ts and inbox.test.ts. - Extract QueryClientDecorator component to satisfy rules-of-hooks. - Sort devDependencies in tasks/package.json.
|
/coder-agents-review |
There was a problem hiding this comment.
All 23 DEREM findings are now resolved (21 fixed, 1 accepted with documentation, 1 contested then fixed after panel decision). The author addressed every item, including the contested DEREM-14 which was fixed in ee1d2a6 after the panel's 5/5 rejection of the original defense.
The PR has been substantially refactored based on @EhabY's architectural feedback (new @repo/storybook-utils package, restructured imports, per-package CSS decorators, removed getDefaultFontStack). Those changes are under active human review.
CI is still failing on Lint. Please ensure pnpm lint passes before merging.
No new findings from this round.
🤖 This review was automatically generated with Coder Agents.
These blocks were accidentally added to package.json but belong exclusively in pnpm-workspace.yaml. The duplicate workspaces field used an object format that eslint-plugin-package-json rejected as invalid (expects an array per npm spec).
Reverts e346f15. The --vscode-font-family CSS variable is only referenced in global.css, not defined by the theme data. Without the inline font stack the Storybook preview renders with browser defaults.
CollapsibleToggle and TaskSelection play functions relied on web component attribute reflection and IPC side-effects that don't work reliably in Chromatic's headless environment. The stories remain as visual-only variants covering collapsed and expanded states.
| // Sourced from `vscode-elements/webview-playground`. | ||
| // https://github.com/vscode-elements/webview-playground/blob/f9a6f90413d0cc535839fb92445b7a5eebc540d7/dist/themes/dark-v2.js |
There was a problem hiding this comment.
I meant to say that we can trigger this script and it would pull a new SHA (most recent) and add that comment in the header so we know what upstream SHA we are currently pinned against
b650dcc to
b0ec3f2
Compare
… loading Move per-package CSS injection from a runtime decorator inside src/ to a storybook.preview.ts entry point at the package root. Stories no longer need to import or apply the decorator manually.
…orybook # Conflicts: # pnpm-lock.yaml # pnpm-workspace.yaml
Not going to fix just yet, will wait for this branch to merge to tightly scope and follow up 🙂
Not going to fix just yet, will wait for this branch to merge to tightly scope and follow up 🙂
Hmm, fair enough. I've imported both those components to the story 🙂
Looks like the
Good idea!
Oops, I think I nuked this by accident. |
EhabY
left a comment
There was a problem hiding this comment.
There are a few follow ups in the chromatic one but this one is good!
| @@ -0,0 +1,90 @@ | |||
| #!/usr/bin/env node | |||
There was a problem hiding this comment.
This could be simplified and parallized slightly:
#!/usr/bin/env node
// Fetches dark-v2 and light-v2 theme files from vscode-elements/webview-playground
// and rewrites .storybook/themes/{dark,light}-v2.ts in place.
//
// Usage:
// node scripts/sync-vscode-themes.mjs # fetch latest main
// node scripts/sync-vscode-themes.mjs <sha> # fetch a specific commit
import { writeFileSync } from "node:fs";
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const REPO = "vscode-elements/webview-playground";
const themes = [
{
remotePath: "dist/themes/dark-v2.js",
localPath: ".storybook/themes/dark-v2.ts",
exportName: "darkTheme",
},
{
remotePath: "dist/themes/light-v2.js",
localPath: ".storybook/themes/light-v2.ts",
exportName: "lightTheme",
},
];
async function fetchText(url, headers) {
const res = await fetch(url, { headers });
if (!res.ok) {
throw new Error(`Failed to fetch ${url}: ${res.status} ${res.statusText}`);
}
return res.text();
}
const sha =
process.argv[2] ??
(
await fetchText(`https://api.github.com/repos/${REPO}/commits/main`, {
Accept: "application/vnd.github.sha",
})
).trim();
console.log(`Syncing themes from ${REPO}@${sha}`);
await Promise.all(
themes.map(async ({ remotePath, localPath, exportName }) => {
const js = await fetchText(
`https://raw.githubusercontent.com/${REPO}/${sha}/${remotePath}`,
);
const match = js.match(/export\s+const\s+theme\s*=\s*(\[[\s\S]*\])/);
if (!match) {
throw new Error(`Could not find theme array in ${remotePath}`);
}
// Upstream escapes dots in CSS property names (e.g. `disabled\.background`).
// These are unnecessary in JS strings and break setProperty lookups.
const arrayLiteral = match[1].replaceAll("\\.", ".");
const ts = `// Sourced from \`vscode-elements/webview-playground\`.
// https://github.com/${REPO}/blob/${sha}/${remotePath}
export const ${exportName}: Array<[string, string]> = ${arrayLiteral};
`;
writeFileSync(resolve(ROOT, localPath), ts);
console.log(` ${localPath}`);
}),
);
console.log("Done. Run `pnpm format` to normalize the output.");





Adds Storybook support for developing and previewing webview components in isolation outside of VS Code. Includes stories for all
taskspackage components with a dark/light theme switcher that mirrors VS Code CSS custom properties..storybook/config with Vite integration, workspace alias resolution, codicon injection, andacquireVsCodeApimockvscode-elements/webview-playground) with a toolbar switcher inglobalTypespackages/tasks/src/components/covering all major UI statestest/webview/decorators.tsxwith a sharedwithQueryClientdecorator for stories using React Querystorybookandbuild-storybookscripts to rootpackage.json