-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/version 6.0.0 #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ginccc
wants to merge
9
commits into
master
Choose a base branch
from
feature/version-6.0.0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5e17047
feat(chat-ui): CRA to Vite rewrite β React 19, SSE streaming, contextβ¦
ginccc 27d7f53
chore(chat-ui): add dist/ to .gitignore
ginccc 4c641e8
feat(secrets): secret input handling β password fields, eye toggle, sβ¦
ginccc 86f5c51
test(chat-ui): add 5 secret input reducer tests (SET_INPUT_FIELD, CLEβ¦
ginccc 677db80
refactor(v6): replace unrestrictedβproduction environment in Chat-UI
ginccc 82190be
fix(chat-ui): correct bot to agent rename casing in ScrollToBottom coβ¦
ginccc 41ab931
feat(v6): API endpoint simplification β /agents/{agentId}/start, /ageβ¦
ginccc ac4e08d
chore: untrack .env, add to .gitignore
ginccc 311a46a
fix(chat-ui): parse SSE done event for quickReplies
ginccc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,9 +10,11 @@ | |
|
|
||
| # production | ||
| /build | ||
| /dist | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| .env | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
|
|
||
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # EDDI Chat UI β AI Agent Guidelines | ||
|
|
||
| > **This file is loaded by AI coding assistants. Follow ALL rules below.** | ||
|
|
||
| ## 1. Project Context | ||
|
|
||
| **eddi-chat-ui** is a standalone React 19 chat widget for [EDDI](https://github.com/labsai/EDDI) agents. Built with Vite + TypeScript 5.7, vanilla CSS with CSS custom properties, and `react-markdown` for rich message rendering. | ||
|
|
||
| ### Tech Stack | ||
|
|
||
| | Technology | Version | Purpose | | ||
| | -------------- | ------- | ------------------------------ | | ||
| | React | 19 | UI framework | | ||
| | TypeScript | 5.7 | Type safety | | ||
| | Vite | 6 | Build tool + dev server | | ||
| | Vitest | 3.x | Unit testing (jsdom) | | ||
| | react-markdown | 9.x | Markdown rendering in messages | | ||
|
|
||
| ### Ecosystem | ||
|
|
||
| - **EDDI backend** β Quarkus REST API at `/agents/{env}/{agentId}`, serves chat UI from `META-INF/resources/` | ||
| - **EDDI Manager** β Admin UI with embedded chat panel, shares API patterns | ||
| - All repos at `c:\dev\git\` | ||
|
|
||
| --- | ||
|
|
||
| ## 2. Project Structure | ||
|
|
||
| ``` | ||
| src/ | ||
| βββ api/ # API layer | ||
| β βββ chat-api.ts # Pure fetch functions (start, read, send, stream, undo, redo) | ||
| β βββ demo-api.ts # Mock API for demo mode | ||
| βββ components/ # UI components | ||
| β βββ ChatWidget.tsx # Main orchestrator (lifecycle, SSE, query params) | ||
| β βββ ChatHeader.tsx # Logo/title, undo/redo, theme toggle, new conversation | ||
| β βββ MessageBubble.tsx # User/agent messages with markdown | ||
| β βββ ChatInput.tsx # Auto-grow textarea, Enter/Shift+Enter | ||
| β βββ QuickReplies.tsx # Pill buttons for suggested replies | ||
| β βββ Indicators.tsx # Typing (dots) + Thinking (brain) indicators | ||
| β βββ ScrollToAgenttom.tsx # Floating scroll button | ||
| βββ hooks/ | ||
| β βββ useTheme.ts # Dark/light/system theme with localStorage | ||
| βββ store/ | ||
| β βββ chat-store.tsx # Context + useReducer state management | ||
| βββ styles/ | ||
| β βββ variables.css # CSS custom properties (dark/light tokens) | ||
| β βββ chat.css # All component styles (BEM naming) | ||
| βββ types.ts # Shared TypeScript types | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Key Conventions | ||
|
|
||
| 1. **CSS** β BEM naming: `.chat-header__logo`, `.message--user`, `.quick-replies__btn`. No Tailwind. | ||
| 2. **State** β `ChatProvider` β `useChatState()` / `useChatDispatch()`. No prop drilling. | ||
| 3. **API** β Pure `fetch` in `chat-api.ts`. SSE streaming uses `AsyncGenerator`. | ||
| 4. **Testing** β Wrap components in `<ChatProvider>`. Mock `window.matchMedia` in `test-setup.ts`. | ||
| 5. **Demo mode** β `/chat/demo/showcase` uses `demo-api.ts`. Check with `isDemoMode()`. | ||
| 6. **Query params** β `hideUndo`, `hideRedo`, `hideNewConversation`, `hideLogo`, `theme`, `title`. | ||
|
|
||
| --- | ||
|
|
||
| ## 4. Build & Deploy | ||
|
|
||
| Production build goes to **EDDI backend** at `src/main/resources/META-INF/resources/`: | ||
|
|
||
| ```bash | ||
| npm run build # Outputs to EDDI backend resources | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 5. Mandatory Workflow | ||
|
|
||
| 1. **Before work**: `git status`, read this file + any `changelog.md` | ||
| 2. **During work**: Commit with `feat(chat-ui):` / `fix(chat-ui):`. Each commit must build. | ||
| 3. **After work**: Update `changelog.md` | ||
|
|
||
| ### DO NOT | ||
|
|
||
| - Add external state libraries (zustand, redux) β use Context + useReducer | ||
| - Add CSS frameworks β use CSS custom properties | ||
| - Duplicate logic from `demo-api.ts` into components |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,70 +1,100 @@ | ||
| # Getting Started with EDDI Chat UI | ||
|
|
||
| This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
|
|
||
| ## Available Scripts | ||
|
|
||
| In the project directory, you can run: | ||
|
|
||
| ### `npm start` | ||
|
|
||
| Runs the app in the development mode.\ | ||
| Open `http://localhost:3000/chat/managedbots/:intent/:userId` or `http://localhost:3000/chat/:environment/:botId?userId=:userId` to view it in your browser. | ||
|
|
||
| The page will reload when you make changes.\ | ||
| You may also see any lint errors in the console. | ||
|
|
||
| ### `npm test` | ||
|
|
||
| Launches the test runner in the interactive watch mode.\ | ||
| See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
|
|
||
| ### `npm run build` | ||
|
|
||
| Builds the app for production to the `build` folder.\ | ||
| It correctly bundles React in production mode and optimizes the build for the best performance. | ||
|
|
||
| The build is minified and the filenames include the hashes.\ | ||
| Your app is ready to be deployed! | ||
|
|
||
| See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
|
|
||
| ### `npm run eject` | ||
|
|
||
| **Note: this is a one-way operation. Once you `eject`, you can't go back!** | ||
|
|
||
| If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | ||
|
|
||
| Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. | ||
|
|
||
| You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. | ||
|
|
||
| ## Learn More | ||
|
|
||
| You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | ||
|
|
||
| To learn React, check out the [React documentation](https://reactjs.org/). | ||
|
|
||
| ### Code Splitting | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) | ||
|
|
||
| ### Analyzing the Bundle Size | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) | ||
|
|
||
| ### Making a Progressive Web App | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) | ||
|
|
||
| ### Advanced Configuration | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) | ||
|
|
||
| ### Deployment | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) | ||
|
|
||
| ### `npm run build` fails to minify | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) | ||
| # EDDI Chat UI | ||
|
|
||
| A standalone, configurable chat widget for [EDDI](https://github.com/labsai/EDDI) conversational AI agents. Built with React 19, TypeScript, and Vite. | ||
|
|
||
| ## Features | ||
|
|
||
| - π¬ **Rich markdown** β Tables, code blocks, bold/italic, links, lists | ||
| - π **SSE streaming** β Real-time token-by-token agent responses with thinking indicator | ||
| - π¨ **Dark/Light themes** β Toggle via UI or query parameters | ||
| - β‘ **Quick replies** β Pill buttons for suggested responses | ||
| - β©βͺ **Undo/Redo** β Step through conversation history | ||
| - π§ **Configurable** β All features togglable via URL query parameters | ||
| - π± **Responsive** β Mobile-first design with adaptive breakpoints | ||
| - π **Demo mode** β Full showcase without a running backend | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm run dev # http://localhost:5174 | ||
| ``` | ||
|
|
||
| ### URL Patterns | ||
|
|
||
| | URL | Description | | ||
| | ------------------------------------- | --------------------------- | | ||
| | `/chat/:environment/:agentId` | Connect to a specific agent | | ||
| | `/chat/demo/showcase` | Demo mode with mock data | | ||
| | `/chat/managedagents/:intent/:userId` | Managed agent mode | | ||
|
|
||
| ### Query Parameters | ||
|
|
||
| | Parameter | Example | Effect | | ||
| | --------------------- | --------------------------- | ---------------------------------- | | ||
| | `hideUndo` | `?hideUndo=true` | Hide undo button | | ||
| | `hideRedo` | `?hideRedo=true` | Hide redo button | | ||
| | `hideNewConversation` | `?hideNewConversation=true` | Hide restart button | | ||
| | `hideLogo` | `?hideLogo=true` | Show text title instead of logo | | ||
| | `hideQuickReplies` | `?hideQuickReplies=true` | Hide quick reply buttons | | ||
| | `theme` | `?theme=light` | Set initial theme (`dark`/`light`) | | ||
| | `title` | `?title=My%20Agent` | Override header title | | ||
|
|
||
| ## Development | ||
|
|
||
| ```bash | ||
| npm run dev # Dev server (port 5174) with proxy to EDDI backend | ||
| npm run build # Production build | ||
| npx vitest run # Run tests (42 tests) | ||
| npx tsc --noEmit # Type check | ||
| ``` | ||
|
|
||
| ### Project Structure | ||
|
|
||
| ``` | ||
| src/ | ||
| βββ api/ # API layer (fetch + SSE streaming) | ||
| β βββ chat-api.ts # Real EDDI backend API | ||
| β βββ demo-api.ts # Mock API for demo mode | ||
| βββ components/ # React components | ||
| β βββ ChatWidget.tsx # Main orchestrator | ||
| β βββ ChatHeader.tsx # Logo, actions, theme toggle | ||
| β βββ MessageBubble.tsx # Message rendering with Markdown | ||
| β βββ ChatInput.tsx # Auto-grow textarea + send | ||
| β βββ QuickReplies.tsx # Suggested reply pills | ||
| β βββ Indicators.tsx # Typing + Thinking indicators | ||
| β βββ ScrollToAgenttom.tsx | ||
| βββ hooks/ | ||
| β βββ useTheme.ts # Theme management | ||
| βββ store/ | ||
| β βββ chat-store.tsx # Context + useReducer | ||
| βββ styles/ | ||
| β βββ variables.css # CSS custom properties (design tokens) | ||
| β βββ chat.css # Component styles (BEM naming) | ||
| βββ types.ts # Shared types | ||
| ``` | ||
|
|
||
| ## Embedding | ||
|
|
||
| The chat UI can be embedded in any HTML page via iframe: | ||
|
|
||
| ```html | ||
| <iframe | ||
| src="https://your-eddi-server/chat/production/your-agent-id?hideNewConversation=true&theme=dark" | ||
| style="width: 400px; height: 600px; border: none; border-radius: 12px;" | ||
| ></iframe> | ||
| ``` | ||
|
|
||
| ## Backend Integration | ||
|
|
||
| The production build is deployed into the EDDI Quarkus backend at: | ||
|
|
||
| ``` | ||
| EDDI/src/main/resources/META-INF/resources/ | ||
| ``` | ||
|
|
||
| This makes the chat UI available at `http://your-eddi-server/chat.html`. | ||
|
|
||
| ## License | ||
|
|
||
| Part of the EDDI project β see [EDDI License](https://github.com/labsai/EDDI/blob/master/LICENSE). |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | ||
| <meta name="theme-color" content="#1a1a1a" /> | ||
| <link rel="icon" href="/img/favicon.ico" /> | ||
| <title>EDDI Chat</title> | ||
| <meta name="description" content="EDDI β Open Source Conversational AI" /> | ||
| <meta property="og:title" content="EDDI Chat" /> | ||
| <meta property="og:description" content="Open Source Conversational AI" /> | ||
| <meta property="og:image" content="/img/logo_eddi.png" /> | ||
| <style> | ||
| @font-face { | ||
| font-display: swap; | ||
| font-family: 'Noto Sans'; | ||
| font-style: normal; | ||
| font-weight: 200; | ||
| src: url('/fonts/noto-sans-v36-cyrillic_cyrillic-ext_devanagari_greek_greek-ext_latin_latin-ext_vietnamese-200.woff2') format('woff2'), | ||
| url('/fonts/noto-sans-v36-cyrillic_cyrillic-ext_devanagari_greek_greek-ext_latin_latin-ext_vietnamese-200.ttf') format('truetype'); | ||
| } | ||
| @font-face { | ||
| font-display: swap; | ||
| font-family: 'Noto Sans'; | ||
| font-style: normal; | ||
| font-weight: 400; | ||
| src: url('/fonts/noto-sans-v36-cyrillic_cyrillic-ext_devanagari_greek_greek-ext_latin_latin-ext_vietnamese-regular.woff2') format('woff2'), | ||
| url('/fonts/noto-sans-v36-cyrillic_cyrillic-ext_devanagari_greek_greek-ext_latin_latin-ext_vietnamese-regular.ttf') format('truetype'); | ||
| } | ||
| @font-face { | ||
| font-display: swap; | ||
| font-family: 'Noto Sans'; | ||
| font-style: normal; | ||
| font-weight: 500; | ||
| src: url('/fonts/noto-sans-v36-cyrillic_cyrillic-ext_devanagari_greek_greek-ext_latin_latin-ext_vietnamese-500.woff2') format('woff2'), | ||
| url('/fonts/noto-sans-v36-cyrillic_cyrillic-ext_devanagari_greek_greek-ext_latin_latin-ext_vietnamese-500.ttf') format('truetype'); | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove zoom-blocking viewport restrictions.
On Line 5,
maximum-scale=1.0anduser-scalable=noprevent zooming, which is an accessibility blocker on mobile.βΏ Suggested fix
π Committable suggestion
π€ Prompt for AI Agents