feat: route-based demo lab + Playwright setup for Copilot cloud agent#6
feat: route-based demo lab + Playwright setup for Copilot cloud agent#6Copilot wants to merge 6 commits into
Conversation
Agent-Logs-Url: https://github.com/GoodDollar/GoodWidget/sessions/83384538-fcc4-43e4-b1ac-26e3879bd517 Co-authored-by: L03TJ3 <6606028+L03TJ3@users.noreply.github.com>
…Timeout) Agent-Logs-Url: https://github.com/GoodDollar/GoodWidget/sessions/83384538-fcc4-43e4-b1ac-26e3879bd517 Co-authored-by: L03TJ3 <6606028+L03TJ3@users.noreply.github.com>
|
@copilot please revert all demo-able flows which are based on components that are in |
…fied components/ Agent-Logs-Url: https://github.com/GoodDollar/GoodWidget/sessions/f8d68ea4-2e3d-4bab-9067-6500b15acc0e Co-authored-by: L03TJ3 <6606028+L03TJ3@users.noreply.github.com>
Done in commit |
|
@copilot okay, can we test the flow and you sharing screenshots of the different routes. |
|
@copilot, can you fix the mocked wagmi flow so we can also test and take screenshots from the claim-widget example and include them in the pull-request description? |
…nected state Agent-Logs-Url: https://github.com/GoodDollar/GoodWidget/sessions/1bb20bd8-7b37-4763-9a1b-d69dd106c661 Co-authored-by: L03TJ3 <6606028+L03TJ3@users.noreply.github.com>
Fixed in commit All three instances (Default, Cobalt override, Teal override) now show "Claim": |
|
@copilot The claimwidget page demo is not truly showcasing isolation, rather, it shows a limitiation of how tamagui handles different providers on the same page and clashing styling assigment. (all widget examples show only the last assigned themeOverrides, in this case, teal) The better way to showcase the isolation of components with different themeOverrides is to follow the themeOverrides pages setup and put them behind different tabs (render upon tab active) |
…ui theme clashing Agent-Logs-Url: https://github.com/GoodDollar/GoodWidget/sessions/101b3175-fd76-4a15-8a5a-118d394ed002 Co-authored-by: L03TJ3 <6606028+L03TJ3@users.noreply.github.com>
Fixed in commit Each tab renders its widget cleanly in isolation: Default tab — preset baseline, no overrides: Cobalt tab — cobalt brand Teal tab — teal brand The smoke tests were updated to match: each tab is now tested independently by clicking |
|
@copilot Goal: Context:
Do not treat the existing route-based examples/react-web approach as something that must be preserved. GoodWidget needs a demo/docs environment because it is:
The environment should let developers and external contributors:
Task: Implementation direction:
Storybook must support:
Initial representative stories:
Theme playground requirements:
The story/docs copy must clearly explain:
Playwright/cloud-agent requirements:
Suggested scripts:
Repository cleanup:
Documentation requirements:
Acceptance criteria:
Validation commands:
Important: |
|
Closing this in favor of #8 where we introduce storybook |




examples/react-webhad no routing, no per-component demo pages, no stable test selectors, no Playwright config, and no cloud agent bootstrap. This PR converts it into a complete, Playwright-compatible demo lab.Routing (
examples/react-web)App.tsx→ React Router shell; originalOverrideShowcasecontent preserved at/theme-overrides/— index with link grid to all routes/components/:name— per-primitive demo pages, scoped to verified components frompackages/ui/src/components/only: Card, GlowCard, Drawer, TokenAmount/widget/claim— ClaimWidget demo with tab-based isolation (Default / Cobalt / Teal); only one widget instance is active at a time/theme-overrides— 5-tab OverrideShowcase unchanged in behaviorComponents still in
packages/ui/src/components-test/(Button, Input, Alert, Badge, etc.) do not have dedicated demo pages until they are promoted tocomponents/.Route screenshots (verified working)
/(index)/components/card/components/glowcard/components/drawer/components/tokenamount/widget/claim— Default tab/widget/claim— Cobalt tab/widget/claim— Teal tabKnown issues / TODO
Function components cannot be given refs— the Drawer component itself triggers this warning; it does not break rendering but should be fixed whenDraweris reviewed.Wagmi mock connector
The
/widget/claimpage uses a lightweight mock EIP-1193 provider scoped to that route — no browser wallet required. The mock provider is passed as theproviderprop to eachClaimWidget(which owns its ownGoodWidgetProviderboundary), so every tab renders in a connected state showing the "Claim" button:ClaimWidget tab isolation
Tamagui resolves theme tokens at mount time. Rendering multiple
GoodWidgetProvidertrees with differentthemeOverridessimultaneously causes the last-mounted provider to win for shared theme keys. The tab-based layout (mirroring/theme-overrides) ensures only oneClaimWidgetis mounted at a time, giving each instance a clean, isolated Tamagui theme context with no style bleed between overrides.Stable selectors
data-testidon key elements followingComponentName-variantconvention (e.g.Card-default,GlowCard-default,tab-default,nav-Card,tab-cobalt,tab-teal).Playwright
playwright.config.tsat repo root — Chromium,baseURL: http://localhost:3000, screenshot always, trace on first retry, video on failure,reuseExistingServer: truetests/demo/smoke.spec.ts— smoke test per verified component route + tab cycling for/theme-overrides+ three separate tab tests for/widget/claim(default, cobalt, teal)package.json:"test:demo": "playwright test tests/demo"+@playwright/testdev depCloud agent bootstrap
.github/workflows/copilot-setup-steps.yml— corepack enable,pnpm install,pnpm build,playwright install chromium --with-depsDocs
docs/demo-environment.md— route map, testid convention, mock wallet rationale, cloud agent quick-start, and guidance on when to add new component demo pagesAGENTS.md/ARCHITECTURE.md— updated with demo environment section and monorepo layoutNo changes to
packages/ui,packages/core,packages/claim-widget, orpackages/embed.