diff --git a/eslint.config.js b/eslint.config.js index 49cacc2..4c409fa 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,6 +2,7 @@ import js from '@eslint/js'; import svelte from 'eslint-plugin-svelte'; import prettier from 'eslint-config-prettier'; import ts from 'typescript-eslint'; +import globals from 'globals'; export default ts.config( js.configs.recommended, @@ -12,6 +13,9 @@ export default ts.config( { files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], languageOptions: { + globals: { + ...globals.browser + }, parserOptions: { parser: ts.parser } diff --git a/implementation-plans/_index.md b/implementation-plans/_index.md index d905abc..0e7cf00 100644 --- a/implementation-plans/_index.md +++ b/implementation-plans/_index.md @@ -6,3 +6,4 @@ | #2 | Proto codegen pipeline for TypeScript gRPC-Web stubs | COMPLETED | [issue-002.md](issue-002.md) | | #3 | Configure Caddy for gRPC-Web support | COMPLETED | [issue-003.md](issue-003.md) | | #4 | gRPC-Web client service layer | COMPLETED | [issue-004.md](issue-004.md) | +| #5 | Chat page layout and message list component | COMPLETED | [issue-005.md](issue-005.md) | diff --git a/implementation-plans/issue-005.md b/implementation-plans/issue-005.md new file mode 100644 index 0000000..d82283c --- /dev/null +++ b/implementation-plans/issue-005.md @@ -0,0 +1,25 @@ +--- +--- + +# Issue #5: Chat page layout and message list component + +**Status:** COMPLETED +**Issue:** https://git.shahondin1624.de/llm-multiverse/llm-multiverse-ui/issues/5 +**Branch:** `feature/issue-5-chat-layout` + +## Summary + +Build the `/chat` route with scrollable message list, user/assistant message bubbles, auto-scroll, and empty state. Uses Svelte 5 runes. + +## Acceptance Criteria + +- [x] `/chat` route created +- [x] Scrollable message list component +- [x] Distinct user and assistant message bubble styles +- [x] Auto-scroll to bottom on new messages +- [x] Svelte 5 runes used for reactive message state (`$state`, `$derived`) +- [x] Empty state shown when no messages + +## Deviations + +- Added `globals` package to ESLint config for browser globals in Svelte files (fixes `Element`/`HTMLDivElement` not defined errors). diff --git a/package-lock.json b/package-lock.json index b737c94..4785726 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", "eslint-plugin-svelte": "^3.0.0", + "globals": "^17.4.0", "prettier": "^3.0.0", "prettier-plugin-svelte": "^3.0.0", "svelte": "^5.51.0", @@ -803,6 +804,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@eslint/js": { "version": "9.39.4", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", @@ -2695,9 +2709,9 @@ } }, "node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.4.0.tgz", + "integrity": "sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index f8aa47e..590aada 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", "eslint-plugin-svelte": "^3.0.0", + "globals": "^17.4.0", "prettier": "^3.0.0", "prettier-plugin-svelte": "^3.0.0", "svelte": "^5.51.0", diff --git a/src/lib/components/.gitkeep b/src/lib/components/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib/components/MessageBubble.svelte b/src/lib/components/MessageBubble.svelte new file mode 100644 index 0000000..10ca0d2 --- /dev/null +++ b/src/lib/components/MessageBubble.svelte @@ -0,0 +1,20 @@ + + +
{message.content}
+ +No messages yet
+Send a message to start a conversation
+