Skip to content

Conversation

@aryadhruv
Copy link
Contributor

@aryadhruv aryadhruv commented Nov 20, 2025

Merge after #103

Chat components now accept and use the full thread object instead of just threadId, enabling loading of existing messages on mount. ChatMessages uses VirtualList for efficient rendering of large message lists. Updated client and page logic to pass and handle thread objects throughout.
Moved thread message conversion from Chat.svelte into new utility functions convertThreadMessage and convertThreadMessages in utils.ts. This improves code reuse and clarity when loading existing messages from a thread.
Ensures that final_answer_started is set to true if existing messages are loaded, indicating that the final answer has already started. This improves chat state consistency when restoring previous threads.
Added MAX_MESSAGES_TO_LOAD constant
Updated the onMount function (line 46) to use the MAX_MESSAGES_TO_LOAD constant instead of the hardcoded 100, making it easy to change the limit in one place.
  1. Instant scroll to bottom - No scroll animation
  2. Fade in the entire container - Content gradually appears over 400ms
  3. Smooth experience - All messages display with a nice ease-in effect
  1. Added ThreadValues interface to types.ts - Defines the structure of thread values with a messages property
  2. Updated client.ts - Changed return type of getOrCreateThread() from Thread<DefaultValues> to Thread<ThreadValues>
  and added type casts
  3. Updated Chat.svelte - Changed thread prop type from Thread<DefaultValues> to Thread<ThreadValues>
  4. Updated +page.svelte - Changed thread state type from Thread<DefaultValues> to Thread<ThreadValues> and imported
  the new type
- Moved chat page to /chat/[threadID]/+page.svelte (you already did this)
- Updated the page to extract threadId from route params: let threadId = $derived(page.params.threadID);
- Removed the getOrCreateThread() call from page initialization

 - Created new /chat/+page.svelte that:
 - Gets or creates a thread via getOrCreateThread()
 - Redirects to /chat/<threadId>/
 - Shows ChatLoader while processing
@aryadhruv aryadhruv marked this pull request as draft November 20, 2025 17:43
@github-actions
Copy link

github-actions bot commented Nov 20, 2025

Run report for 31cc9369 (1)

Total time: 47.7s | Comparison time: 1m 18s | Estimated savings: 31.2s (39.5% faster)

Action Time Status Info
⬛️ SetupProto(0.53.2) 0ms Skipped
🟩 SyncWorkspace 7.9ms Passed
🟩 SyncProject(frontend) 0.4ms Passed
⬛️ SetupToolchain(node:~24) 1.8s Skipped
🟩 InstallWorkspaceDeps(node:~24) 6.4s Passed
🟩 RunTask(frontend:test) 9.3s Passed
🟩 RunTask(frontend:build) 34.4s Passed
🟩 RunTask(frontend:install-playwright) 34.8s Passed
🟩 RunTask(frontend:test-e2e) 4.7s Passed
Environment

OS: Linux
Matrix:

index = 1
Touched files
apps/frontend/src/lib/langgraph/client.ts
apps/frontend/src/routes/chat/+page.svelte
apps/frontend/src/routes/chat/[threadID]/+page.svelte

@github-actions
Copy link

github-actions bot commented Nov 20, 2025

Run report for 31cc9369 (0)

Total time: 1m | Comparison time: 2m 2s | Estimated savings: 1m 2s (50.9% faster)

Action Time Status Info
⬛️ SetupProto(0.53.2) 0ms Skipped
🟩 SyncWorkspace 8.2ms Passed
🟩 SyncProject(frontend) 0.4ms Passed
⬛️ SetupToolchain(node:~24) 1.6s Skipped
🟩 InstallWorkspaceDeps(node:~24) 6.6s Passed
🟩 RunTask(frontend:test-cov) 12.6s Passed
🟩 RunTask(frontend:format) 3.9s Passed
🟩 RunTask(frontend:lint) 18.5s Passed
🟩 RunTask(frontend:build) 35.4s Passed
🟩 RunTask(frontend:install-playwright) 42.8s Passed
🟩 RunTask(frontend:test-e2e) 5s Passed
🟩 RunTask(frontend:check) 16.7s Passed
Environment

OS: Linux
Matrix:

index = 0
Touched files
apps/frontend/src/lib/langgraph/client.ts
apps/frontend/src/routes/chat/+page.svelte
apps/frontend/src/routes/chat/[threadID]/+page.svelte

@aryadhruv aryadhruv self-assigned this Nov 20, 2025
@aryadhruv aryadhruv marked this pull request as ready for review November 21, 2025 16:43
@aryadhruv aryadhruv enabled auto-merge (squash) November 21, 2025 16:43
@aryadhruv aryadhruv requested a review from dokterbob November 21, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants