Replace the new-chat <Select label="Agent role"> picker with colored role cards rendered as the empty-state of a brand-new chat (centered in the window), per docs/backlog/ai-chat-role-cards-empty-state.md. Clicking a card selects that identity; sending without a pick falls back to the Universal assistant; the cards disappear once the chat is non-empty. Purely client-side — the existing selectedAiRoleIdAtom + roleId request wiring (server role fixation on chat creation) is unchanged. - new RoleCards rendered through the existing emptyState prop chain (AiChatWindow -> ChatThread -> MessageList); MessageList already supported it. - Universal assistant card (gray, value null, default-selected) + one card per enabled role, color cycled from a 10-name Mantine palette via the pure roleCardColor() helper; theme-aware CSS vars (light/-light-color/-filled). - each card is an UnstyledButton with aria-pressed for a11y + testability. - tests: role-card-color (palette cycling, negative-safe) + role-cards.test.tsx (render, emoji/name, selection highlight, click -> onSelect). 9 tests green, client tsc clean. Verified live in-browser: cards (not a Select) show for a new chat; selecting Пират binds the chat to that role end-to-end (badge + pirate reply); no pick => Universal; cards vanish after the first message. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist