From e57e97c34def5cd2276885a4857b3ff2e6f01085 Mon Sep 17 00:00:00 2001 From: Blair McKee <23467862+eblairmckee@users.noreply.github.com> Date: Fri, 21 Nov 2025 13:30:14 -0800 Subject: [PATCH 01/13] feat: replaced hard coded benthos schema json file with new connect query endpoint --- .../skills/frontend-developer/SKILL.md | 304 +++++++++++++++++ .../rp-connect/onboarding/connect-tile.tsx | 6 +- .../rp-connect/onboarding/connect-tiles.tsx | 12 +- .../onboarding/onboarding-wizard.tsx | 23 +- .../pages/rp-connect/pipelines-create.tsx | 10 + .../pages/rp-connect/types/constants.ts | 53 --- .../pages/rp-connect/types/schema.ts | 96 +----- .../pages/rp-connect/utils/categories.ts | 4 +- .../pages/rp-connect/utils/schema.ts | 306 +++++++----------- .../pages/rp-connect/utils/wizard.ts | 6 +- .../components/pages/rp-connect/utils/yaml.ts | 7 +- frontend/src/react-query/api/connect.tsx | 43 +++ 12 files changed, 532 insertions(+), 338 deletions(-) create mode 100644 frontend/.claude/skills/frontend-developer/SKILL.md create mode 100644 frontend/src/react-query/api/connect.tsx diff --git a/frontend/.claude/skills/frontend-developer/SKILL.md b/frontend/.claude/skills/frontend-developer/SKILL.md new file mode 100644 index 000000000..b7b257303 --- /dev/null +++ b/frontend/.claude/skills/frontend-developer/SKILL.md @@ -0,0 +1,304 @@ +--- +name: frontend-developer +description: "Build user interfaces using Redpanda UI Registry components with React, TypeScript, and Vitest testing. Use when user requests UI components, pages, forms, or mentions 'build UI', 'create component', 'design system', 'frontend', or 'registry'." +allowed-tools: Read, Write, Edit, Bash, Glob, Grep, mcp__ide__getDiagnostics +--- + +# Frontend UI Development + +Build UIs using the Redpanda UI Registry design system following this repo's patterns. + +## Critical Rules + +**ALWAYS:** + +- Fetch registry docs FIRST: Invoke `mcp__context7__get-library-docs` with library `/websites/redpanda-ui-registry_netlify_app` +- Use registry components from `src/components/redpanda-ui/` +- Install components via CLI: `yes | bunx @fumadocs/cli add --dir https://redpanda-ui-registry.netlify.app/r ` +- Use functional React components with TypeScript +- Run `bun i --yarn` after installing packages + +**NEVER:** + +- Use deprecated `@redpanda-data/ui` or Chakra UI +- Modify files in registry base directory (check `cli.json`) +- Copy/paste registry source code +- Add margin `className` directly to registry components +- Use inline `style` prop on registry components +- Leave `console.log` or comments in code + +## Workflow + +### 1. Fetch Registry Documentation + +```bash +# REQUIRED FIRST STEP +Invoke: mcp__context7__get-library-docs +Library: /websites/redpanda-ui-registry_netlify_app +``` + +### 2. Install Components + +```bash +# Single component +yes | bunx @fumadocs/cli add --dir https://redpanda-ui-registry.netlify.app/r button + +# Multiple components (space-separated) +yes | bunx @fumadocs/cli add --dir https://redpanda-ui-registry.netlify.app/r card dialog form + +# Then generate yarn.lock +bun i --yarn +``` + +### 3. Write Component + +**Structure:** + +```typescript +// Functional component with explicit types +interface Props { + title: string; + onSubmit: (data: FormData) => void; +} + +export function MyComponent({ title, onSubmit }: Props) { + // Component logic +} +``` + +**Styling:** + +```typescript +// ✅ CORRECT: Use component variants + + +// ✅ CORRECT: Wrap for spacing +
+ +
+ +// ❌ WRONG: Direct margin on component + +``` + +**TypeScript:** + +- Define prop interfaces +- Never use `any` - infer correct types +- Use generics for collections + +**Performance:** + +- Hoist static content outside component +- Use `useMemo` for expensive computations +- Use `memo` for components receiving props + +### 4. Write Tests + +**Test types:** + +- Unit tests (`.test.ts`): Pure logic, utilities, helpers - Node environment +- Integration tests (`.test.tsx`): React components, UI interactions - JSDOM environment + +**Unit test example:** + +```typescript +// utils.test.ts +import { formatNumber } from "./utils"; + +describe("formatNumber", () => { + test("should format numbers with commas", () => { + expect(formatNumber(1000)).toBe("1,000"); + }); +}); +``` + +**Integration test example:** + +```typescript +// component.test.tsx +import { render, screen, fireEvent } from 'test-utils'; +import { MyComponent } from './component'; + +describe('MyComponent', () => { + test('should call onSubmit when button clicked', () => { + const onSubmit = vi.fn(); + render(); + + fireEvent.click(screen.getByRole('button')); + + expect(onSubmit).toHaveBeenCalled(); + }); +}); +``` + +**Mocking:** + +```typescript +vi.mock("module-name", async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + functionToMock: vi.fn(), + }; +}); + +const mockFunction = vi.mocked(functionToMock); +``` + +### 5. Validation + +```bash +# Run in order +bun run type:check # TypeScript errors +bun run test # All tests +bun run lint # Code quality +bun run build # Production build +bun run start # Dev server - check browser +``` + +**Success criteria:** + +- ✓ No TypeScript errors +- ✓ All tests passing +- ✓ No lint errors +- ✓ Build succeeds +- ✓ No runtime errors in browser + +## Testing Commands + +```bash +bun run test # All tests (unit + integration) +bun run test:unit # Unit tests only (.test.ts) +bun run test:integration # Integration tests only (.test.tsx) +bun run test:watch # Watch mode +bun run test:ui # Interactive UI +bun run test:coverage # Coverage report +``` + +## Common Patterns + +### Registry Component Usage + +Check `src/components/redpanda-ui/` for installed components before installing new ones. + +Use component variants instead of custom styling: + +```typescript +