Codex/react starter contribution using AI#153
Open
adorayi wants to merge 15 commits intocds-snc:mainfrom
Open
Conversation
daine
requested changes
Mar 12, 2026
starter-apps/react/react-template/e2e/aboutPageBreadcrumbs.spec.ts
Outdated
Show resolved
Hide resolved
cd051f2 to
32a97ea
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new React + TypeScript starter app (modeled after the existing Vue starter) to help teams bootstrap GCDS-based apps with localized routing, i18n, and a basic page/form flow, along with unit and Playwright e2e/a11y coverage.
Changes:
- Introduces
starter-apps/react/react-template(Vite + React Router localized routes, i18next, GCDS shell/components, sample pages). - Adds unit tests (Vitest/Testing Library) and Playwright e2e + axe a11y smoke tests for the starter.
- Updates starter-app documentation and root README to list the new React starter.
Reviewed changes
Copilot reviewed 42 out of 44 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| starter-apps/react/react-template/vitest.config.ts | Adds Vitest config merged with Vite config. |
| starter-apps/react/react-template/vite.config.ts | Adds Vite config with React plugin and @ alias. |
| starter-apps/react/react-template/tsconfig.node.json | Adds tooling TS config (Vite/Vitest/Playwright). |
| starter-apps/react/react-template/tsconfig.json | Adds TS project references (app + node). |
| starter-apps/react/react-template/tsconfig.app.json | Adds app TS config for React code. |
| starter-apps/react/react-template/src/utils/githubIssue.ts | Adds helper to build prefilled GitHub issue URL. |
| starter-apps/react/react-template/src/types/report.ts | Adds report-a-bug form types + initial state. |
| starter-apps/react/react-template/src/setupTests.ts | Adds Vitest setup (jest-dom + i18n init). |
| starter-apps/react/react-template/src/routing/localizedRoutes.ts | Adds localized route helpers (route-key mapping, locale switching). |
| starter-apps/react/react-template/src/routing/localizedRoutes.test.ts | Adds unit tests for localized route helpers. |
| starter-apps/react/react-template/src/routing/constants.ts | Defines locales, route keys, and localized route segments. |
| starter-apps/react/react-template/src/routing/LocaleRoute.tsx | Locale guard + i18n/document attribute switching. |
| starter-apps/react/react-template/src/routing/AppRoutes.tsx | React Router route tree (localized slugs + NotFound). |
| starter-apps/react/react-template/src/pages/ReportABug.tsx | Implements report-a-bug form + confirmation + issue link. |
| starter-apps/react/react-template/src/pages/ReportABug.test.tsx | Unit test for report-a-bug submission flow. |
| starter-apps/react/react-template/src/pages/NotFound.tsx | Adds Not Found page content. |
| starter-apps/react/react-template/src/pages/NotFound.test.tsx | Unit test for Not Found content. |
| starter-apps/react/react-template/src/pages/Home.tsx | Adds Home page content. |
| starter-apps/react/react-template/src/pages/AboutTopic.tsx | Adds nested About Topic page. |
| starter-apps/react/react-template/src/pages/About.tsx | Adds About page linking to nested topic route. |
| starter-apps/react/react-template/src/main.tsx | App entry: router + GCDS CSS imports. |
| starter-apps/react/react-template/src/i18n/resources.ts | Adds EN/FR translation resources + locale metadata. |
| starter-apps/react/react-template/src/i18n/index.ts | Initializes i18next + sets <html lang/dir>. |
| starter-apps/react/react-template/src/components/AppShell.tsx | Adds GCDS header/topnav/breadcrumbs/container/footer shell. |
| starter-apps/react/react-template/src/components/AppShell.test.tsx | Unit test for language-toggle href behavior. |
| starter-apps/react/react-template/src/components/AppLink.tsx | Router-aware wrapper for GCDS link/nav/breadcrumb items. |
| starter-apps/react/react-template/public/favicon.ico | Adds starter favicon. |
| starter-apps/react/react-template/playwright.config.ts | Adds Playwright config + dev/CI webServer settings. |
| starter-apps/react/react-template/package.json | Adds starter dependencies/scripts (check, unit, e2e). |
| starter-apps/react/react-template/index.html | Adds Vite HTML template. |
| starter-apps/react/react-template/eslint.config.js | Adds ESLint flat config for TS/React. |
| starter-apps/react/react-template/e2e/reportABug/reportABugSubmission.spec.ts | E2E: happy-path form submission. |
| starter-apps/react/react-template/e2e/reportABug/reportABugErrors.spec.ts | E2E: required-field validation errors. |
| starter-apps/react/react-template/e2e/reportABug/reportABug.spec.ts | E2E: report-a-bug page + locale switch. |
| starter-apps/react/react-template/e2e/app.spec.ts | E2E: home page + locale toggle helper. |
| starter-apps/react/react-template/e2e/aboutPageBreadcrumbs.spec.ts | E2E: localized breadcrumbs across nested routes + locale switch. |
| starter-apps/react/react-template/e2e/a11y.spec.ts | Axe smoke tests for critical/serious violations. |
| starter-apps/react/react-template/README.md | Starter-specific setup and usage docs. |
| starter-apps/react/react-template/.prettierrc.json | Prettier config for the starter. |
| starter-apps/react/react-template/.gitignore | Starter-specific ignores (dist, reports, etc.). |
| starter-apps/react/README.md | Adds React starter index/structure documentation. |
| starter-apps/README.md | Updates starter-apps index to include React starter. |
| README.md | Updates root README starter apps list to include React starter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+29
to
+30
| "include": ["src", "playwright.config.ts", "vitest.config.ts"] | ||
| } |
| confirmation: 'Confirmation' | ||
| }, | ||
| openGithub: 'Start an issue on GitHub', | ||
| openGithubButton: 'Open issue on Github' |
Comment on lines
+125
to
+126
| openGithub: 'Créer un ticket sur Github', | ||
| openGithubButton: 'Ouvrir un ticket sur Github' |
Comment on lines
12
to
+14
| ## Starter apps | ||
| - [Vue3](/starter-apps/vue/vue-template) | ||
| - [React](/starter-apps/react/react-template) |
Comment on lines
+1
to
+4
| import type { ReportBugFormData } from '@/types/report' | ||
|
|
||
| export function buildGithubIssueUrl(formData: ReportBugFormData): string { | ||
| const params = new URLSearchParams({ |
Comment on lines
+185
to
+186
| <GcdsButton href={buildGithubIssueUrl(formData)} target="_blank" type="link"> | ||
| {t('reportABugPage.openGithubButton')} |
Comment on lines
+52
to
+58
| <GcdsNavLink | ||
| current={currentRouteKey === 'home'} | ||
| href={getLocalizedPath('home', locale)} | ||
| slot="home" | ||
| > | ||
| {t('homeNavLink')} | ||
| </GcdsNavLink> |
| } | ||
| ], | ||
| webServer: { | ||
| command: process.env.CI ? 'vite preview --port 5173' : 'vite dev --port 5173', |
melaniebmn
requested changes
Mar 17, 2026
Contributor
melaniebmn
left a comment
There was a problem hiding this comment.
Some semantic, consistency suggestions
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
Co-authored-by: Melanie Boeckmann <melanie.bockmann@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary | Résumé
Experiment by creating a React starter app using AI based on the existing Vue starter app#2331
This is one of our OKRs for GCDS.
Goal:
https://app.zenhub.com/workspaces/gc-design-system-6100624a19f4cf000e46e458/issues/gh/cds-snc/design-gc-conception/2331
The React starter now exists with localized routing, i18n, GCDS shell/components, typed report form flow, unit tests, e2e tests, a11y smoke tests, docs, lockfile, and repo CI wiring.
Key additions
New React starter: starter-apps/react/react-template
React starter docs: starter-apps/react/react-template/README.md
Starter-level React index doc: starter-apps/react/README.md
Repo docs updated
Root README now lists React starter: README.md
Starter apps index updated: starter-apps/README.md
Validation run
React:
npm run check passed
npm run test:e2e -- --project=chromium passed (10/10)
Notes
Vite shows chunk-size warnings for both starters (non-blocking).
Vue npm install reported existing audit vulnerabilities from dependency tree (not introduced by structural changes).
Fixed a bug:
Replace fragile text-based language-toggle clicks in React e2e tests with deterministic selectors based on gcds-header lang-href and target href.
This avoids shadow-DOM/text-render differences that show up in Firefox.
Implementation Changes
Update starter-apps/react/react-template/e2e/app.spec.ts:
In switches to french and switches to english, stop using page.click('text=Français') / page.click('text=English').
Add a tiny helper that:
Asserts gcds-header has expected lang-href (/fr/ or /en/).
Clicks the language toggle via href-based locator (for example gcds-header a[href="/en/"]).
Test instructions | Instructions pour tester la modification
Devs requested to review the quality, implementation and decide on next steps for this contribtution.