Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0496979
fix
virakasprova Feb 12, 2025
299aa5d
chore: trigger deployment
Maxwell-Lindsey Jan 7, 2025
39b707f
fix(a11y): add role and aria attributes to SVG elements (Issue 4)
ckouder Feb 25, 2026
ac78a92
fix(a11y): add proper H1 elements and fix heading hierarchy (Issues 5…
ckouder Feb 25, 2026
eff84ee
fix(a11y): add aria-labels to buttons and wrap icon-only controls (Is…
ckouder Feb 25, 2026
5796408
fix(a11y): add accessible names to data tables (Issue 8)
ckouder Feb 25, 2026
35c5fc7
fix(a11y): add labels to form controls (Issue 9)
ckouder Feb 25, 2026
888ceb8
fix(a11y): add listbox role and keyboard nav to PromptList (Issues 10…
ckouder Feb 25, 2026
77a9e75
fix(a11y): use native disabled attribute instead of aria-disabled (Is…
ckouder Feb 25, 2026
ad42adc
fix(a11y): remove user-scalable=no from viewport meta tags (Issue 14)
ckouder Feb 25, 2026
60fc483
fix(a11y): make scrollable regions keyboard accessible (Issue 15)
ckouder Feb 25, 2026
13b15bf
fix(a11y): update chat page title to Illinois Chat (Issue 16)
ckouder Feb 25, 2026
a472363
fix(a11y): add global focus-visible indicators (Issues 17, 18)
ckouder Feb 25, 2026
68f17b2
fix(a11y): remove role="button" from Link and Menu.Item elements (Iss…
ckouder Feb 25, 2026
5a08ccf
fix(a11y): add keyboard nav and aria-expanded to menu toggles (Issue 20)
ckouder Feb 25, 2026
4842a65
fix(a11y): wrap icon-only controls in button elements (Issue 21)
ckouder Feb 25, 2026
a849ffe
fix(a11y): add title attribute to truncated course name (Issue 22)
ckouder Feb 25, 2026
751f961
add CLAUDE.md
ckouder Feb 26, 2026
065c9c2
fix(a11y): comprehensive WCAG 2.1 AA accessibility fixes (Service Req…
ckouder Mar 5, 2026
6276184
fix(a11y): add document titles, h1 headings, and main-content landmar…
ckouder Mar 5, 2026
cabbd86
fix(a11y): add aria-labels to form inputs and fix heading hierarchy
ckouder Mar 5, 2026
cee56c5
fix(a11y): code block theming, form labels, contrast, keyboard nav, a…
ckouder Mar 6, 2026
e9bbc23
chore(a11y): add accessibility tests
ckouder Mar 9, 2026
0d938ab
fix(a11y): add accessibility test as gh actions; fix missing edge case
ckouder Mar 9, 2026
94a9d37
fix(a11y): fix past button on input
ckouder Mar 9, 2026
c2b20cf
fix(a11y): add alt text for user uploaded logo
ckouder Mar 9, 2026
1dd458d
chore(a11y): add axe-jest for accessibility audit
ckouder Mar 9, 2026
e3fbd4f
fix(a11y): show different status for private, login_only, and public …
ckouder Mar 9, 2026
2b89957
fix(a11y): add alt text for use uploaded logo
ckouder Mar 9, 2026
26b77bc
fix: failing test cases
ckouder Mar 9, 2026
2a859b3
fix: throw error if allCourseMetadata failed
ckouder Mar 9, 2026
493f380
fix: do not run useEffect for accessibility label on every render
ckouder Mar 9, 2026
9022fee
fix(a11y): make main element focusable
ckouder Mar 9, 2026
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
37 changes: 37 additions & 0 deletions .github/workflows/a11y-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Accessibility Tests on PR

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
- illinois-chat
workflow_dispatch:

concurrency:
group: a11y-on-pr-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
a11y:
name: Accessibility
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install
run: npm ci

- name: Run accessibility tests
run: npm run test:a11y
124 changes: 124 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Illinois Chat frontend — a Next.js education platform with AI-powered chat (RAG over uploaded documents). Built on the T3 Stack with Keycloak auth, multiple LLM providers, and Qdrant vector search.

## Commands

```bash
# Development
npm run local # Local dev server (no Infisical secrets)
npm run dev # Dev server with Infisical secrets manager

# Build
npm run build # Production build (runs keycloak URL update script first)
npm run build:self-hosted # Build without keycloak URL update

# Testing (Vitest)
npx vitest run # Run all tests once
npx vitest run src/path/to/file # Run a single test file
npx vitest --watch # Watch mode
npx vitest --ui # Browser UI for tests
npm run test:coverage # Coverage report (v8)
npm run test:coverage:check # Coverage with threshold check

# Linting & Formatting
npm run lint # ESLint (next lint --max-warnings=10000)
npm run format # Prettier check
npm run format:fix # Prettier auto-fix

# Database (Drizzle ORM)
npm run db:push # Push schema changes to DB
npm run db:generate # Generate migrations
npm run db:studio # Visual DB editor
npm run db:migrate # Run migrations

# Bundle analysis
npm run analyze # Build with bundle analyzer
```

## Architecture

### Hybrid Next.js Routing

Both routers coexist (gradual migration):

- **Pages Router** (`src/pages/`): Main UI pages — home (`index.tsx`), chat (`chat.tsx`), dynamic course routes (`[course_name]/`)
- **App Router** (`src/app/`): Newer API routes — LLM chat streaming endpoints, chat routing

### State Management — React Query (TanStack Query v5)

React Query is the primary state management layer. No Redux or Zustand.

**Hook patterns** in `src/hooks/queries/`:

- **Declarative fetching**: `useQuery` hooks — auto-fetch on mount/param change
- **Imperative actions**: `useMutation` hooks with `mutateAsync` — for event handlers
- **Non-component contexts**: Import raw fetch functions directly from hook files (exported alongside hooks)

**Query keys**: All centralized in `src/hooks/queries/keys.ts` via `queryKeys` and `mutationKeys` factories. Always use these factories — never inline key arrays. See `docs/QUERY_KEYS_GUIDE.md` for full conventions.

### Authentication — Keycloak OIDC

- Provider: `src/providers/KeycloakProvider.tsx` (wraps `react-oidc-context`)
- API route auth: `withAuth()` wrapper (pages router) and `withCourseAccessFromRequest()` wrapper (app router)
- Middleware (`src/middleware.ts`): Handles auth callbacks and route protection

### LLM Provider Abstraction

Multiple AI providers supported via Vercel AI SDK (`ai` package):

- Provider-specific routes in `src/app/api/chat/` (anthropic, openAI, bedrock, google, ollama, etc.)
- Dynamic routing in `src/app/api/allNewRoutingChat/route.ts`
- Stream processing utilities in `src/utils/streamProcessing.ts`
- Model provider configs in `src/utils/modelProviders/`

### Database Layer

- **ORM**: Drizzle ORM with PostgreSQL (`src/db/schema.ts`)
- **Caching**: Redis for course metadata
- **Vector DB**: Qdrant for RAG document retrieval (`src/utils/qdrantClient.ts`)

### UI Stack

Multiple component libraries coexist:

- **Mantine v6** (`@mantine/core`): Primary component library with Illinois brand theming
- **shadcn/ui** + **Radix UI**: Headless accessible components (`src/components/shadcn/`)
- **Tailwind CSS**: Utility styling with class-based dark mode and CSS variable color system
- **styled-components**: Used in some components

### Provider Hierarchy (`_app.tsx`)

PostHogProvider → KeycloakProvider → QueryClientProvider → MantineProvider → ThemeProvider → MaintenanceGate → Page

### Internationalization

22 languages via `next-i18next`. Locale files in `src/public/locales/`.

## Code Conventions

### TypeScript

- Strict mode enabled with `noUncheckedIndexedAccess`
- Path aliases: `~/` and `@/` both resolve to `./src/`
- Use `type` imports: `import { type Foo }` (enforced by ESLint)
- Unused vars prefixed with `_` are allowed

### Formatting

- No semicolons, single quotes, trailing commas (Prettier)
- `@ts-ignore` requires a description (min 3 chars); prefer `@ts-expect-error`

### Testing

- Framework: Vitest + React Testing Library + MSW for API mocking
- Setup: `vitest.setup.ts` mocks next/router, next/navigation, react-oidc-context, posthog-js, and browser APIs
- Test locations: colocated in `src/**/*.{test,spec}.{ts,tsx}` or `__tests__/` directories

### Node Version

v22.12.0 (see `.nvmrc`)
Loading