Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .claude/docs/AGENT_FAILURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ shown below when adding new failures.
- How to reproduce: Run a Playwright test from `site` with
`pnpm playwright:test`, let it fail, and discard the generated output before
reporting the failure.
- How to diagnose: Check `site/e2e/playwright.config.ts`, `site/e2e/README.md`,
and the terminal output for the report or `test-results` location.
- How to diagnose: Playwright writes per-test failure artifacts (screenshots,
videos, and traces) to `site/test-results/`, the HTML report to
`site/playwright-report/`, and the coderd debug log to
`site/e2e/test-results/debug.log`. In CI, the `test-e2e` job uploads
artifacts named `playwright-artifacts-`, `coderd-debug-logs-`, and
`debug-pprof-dumps-`, each followed by the matrix job name and commit SHA.
- Existing docs or tools: [Frontend Development Guidelines](../../site/AGENTS.md),
`site/e2e/README.md`, and `pnpm playwright:test`.
- Missing harness piece: No central checklist tells agents which browser
Expand Down Expand Up @@ -102,7 +106,7 @@ shown below when adding new failures.
- How to diagnose: Search the test diff for `time.Sleep`. Inspect whether the
code under test can use `quartz` or another explicit synchronization point.
- Existing docs or tools: `AGENTS.md`, [Testing Patterns and Best Practices](TESTING.md),
and the quartz README referenced from `AGENTS.md`.
and the quartz README linked from `TESTING.md`.
- Missing harness piece: Agents need a failure entry that labels sleep-based
waiting as a flake risk before review.
- Proposed prevention: Replace `time.Sleep` with a fake clock, trapped ticker,
Expand Down
11 changes: 11 additions & 0 deletions .claude/docs/FRONTEND_PATTERNS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function actually exercises the interaction. Jest/RTL tests are for pure logic
not only the happy path.
- Assert both sides of an invariant: the item that changed and a neighboring
item that must not change.
- When a component depends on the current time or date, accept it as a prop or
via context instead of reading `new Date()` or `Date.now()` internally, so
stories render deterministically without mocking globals.

**Incorrect (interaction test in Jest/RTL):**

Expand Down Expand Up @@ -61,6 +64,8 @@ export const SelectModel: Story = {
- Use generated types from `api/typesGenerated.ts` for all API data. Never
re-declare a type that the backend already generates.
- If a component requires a prop to function, make the prop required.
- Avoid `@ts-ignore` and `biome-ignore` suppression comments. Seek a
better-typed alternative first, and document why when one is unavoidable.

**Incorrect:**

Expand Down Expand Up @@ -121,6 +126,9 @@ Every view that renders server data must handle this matrix:
- When a mutation partially fails, the UI must reflect what succeeded and what
did not (see FE7 for cache invalidation).
- Render a visible fallback ("Untitled", "N/A") for nullable display data.
- Never use `key={String(booleanState)}` to force a remount. When the boolean
flips, React synchronously unmounts and remounts the subtree, discarding its
state and killing exit animations.

## FE6: Accessibility is behavior, not decoration

Expand All @@ -133,6 +141,9 @@ Every view that renders server data must handle this matrix:
- Preserve focus position across dialogs and route transitions.
- When visually hiding an interactive element, also remove it from the tab
order and accessibility tree, or conditionally render it out of the DOM.
- Generate IDs for form elements, labels, and ARIA attributes with
`React.useId()`. Hard-coded string IDs collide when a component renders more
than once on a page.

## FE7: React Query discipline

Expand Down
Loading
Loading