refactor: new API & universal load functions (pt. 2)#1847
Merged
Conversation
so we dont use context outside of component lifecycles
maksym-work
pushed a commit
to siilats/chat-ui
that referenced
this pull request
Jul 2, 2025
* feat(API): refactor API with Elysia * feat: initial elysia setup * feat: replace conv/[id] load function with universal * fix: delete v1 catchall * wip * fix: response type * fix: add cors * feat: more routes in tools & assistants * refacto: use normal svelte fetch in `/assistant/[assistantId]` * refacto: use normal svelte fetch in `conversation/[id]` * feat: use universal load function for `tools/[toolId]` * wip: removing more server load function stuff * feat: more routes to universal load functions * feat: more routes to universal * refactor: move tools loading to API endpoint * refactor(api): implement tools search API endpoint and move load function * fix: types on tool search * refactor: update assistant route and remove redundant page load function * refactor(api): move assistants page load function to api call * refactor(settings): remove waterfall loading * refactor: main load function * fix: types * feat: improve fetchJSON to handle empty responses * fix: issues with page loading & assistant avatars * refactor(api): remove unused Eden fetch utility * refactor(routes): improve conversation page loading and error handling * feat(api): migrate login and logout to API routes (huggingface#1703) * feat(auth): migrate login and logout to API routes - Replaced form-based login/logout with fetch-based API routes - Updated hooks and components to use new `/api/login` and `/api/logout` endpoints * fix: invalidate on logout * refactor: move `/api/login` routes back to `/login` and `/api/logout` to `/logout` remove breaing change to connected apps * refactor(api): update import aliases and configuration for API routes * refactor: update conversation handling to use generic tree structure - Changed `addChildren` and `addSibling` functions to utilize a generic `Tree` type for better flexibility. - Updated `buildSubtree` to return a tree node structure. - Modified conversation response types to use `Serialize<Conversation>` for improved serialization. - Adjusted related tests to align with the new tree structure and types. * fix: specify message type in ChatWindow component - Updated the `messages` prop in the ChatWindow component to explicitly cast `messagesPath` as `Message[]` for improved type safety and clarity. * feat: make login simpler with GET's * fix: debug logs * fix: isAdmin flag * refactor: remove debug route * fix: use config manager in api routes * chores: use latest elysia * wip * feat: working with different origin * refactor: update API routes to throw errors for unimplemented features * fix: use hook for public config so we dont use context outside of component lifecycles * refactor: use api client for user reports in settings load function * fix: deps * feat: get rid of last fetchJSON call in load function * cors setup * feat: use api client side * feat: use api for assistant loading * feat: use api client for assistant search * fix: lint * feat: use api client for tool * feat: rename client hook and use for deleting all convs * fix: let non-authed user set their model * feat: bump minor for elysia API * feat: remove unused serverPublicConfig * feat: add handleFetch to manage cookie forwarding for localhost SSR requests
Matsenas
pushed a commit
to Matsenas/chat-ui
that referenced
this pull request
Jul 4, 2025
* feat(API): refactor API with Elysia * feat: initial elysia setup * feat: replace conv/[id] load function with universal * fix: delete v1 catchall * wip * fix: response type * fix: add cors * feat: more routes in tools & assistants * refacto: use normal svelte fetch in `/assistant/[assistantId]` * refacto: use normal svelte fetch in `conversation/[id]` * feat: use universal load function for `tools/[toolId]` * wip: removing more server load function stuff * feat: more routes to universal load functions * feat: more routes to universal * refactor: move tools loading to API endpoint * refactor(api): implement tools search API endpoint and move load function * fix: types on tool search * refactor: update assistant route and remove redundant page load function * refactor(api): move assistants page load function to api call * refactor(settings): remove waterfall loading * refactor: main load function * fix: types * feat: improve fetchJSON to handle empty responses * fix: issues with page loading & assistant avatars * refactor(api): remove unused Eden fetch utility * refactor(routes): improve conversation page loading and error handling * feat(api): migrate login and logout to API routes (huggingface#1703) * feat(auth): migrate login and logout to API routes - Replaced form-based login/logout with fetch-based API routes - Updated hooks and components to use new `/api/login` and `/api/logout` endpoints * fix: invalidate on logout * refactor: move `/api/login` routes back to `/login` and `/api/logout` to `/logout` remove breaing change to connected apps * refactor(api): update import aliases and configuration for API routes * refactor: update conversation handling to use generic tree structure - Changed `addChildren` and `addSibling` functions to utilize a generic `Tree` type for better flexibility. - Updated `buildSubtree` to return a tree node structure. - Modified conversation response types to use `Serialize<Conversation>` for improved serialization. - Adjusted related tests to align with the new tree structure and types. * fix: specify message type in ChatWindow component - Updated the `messages` prop in the ChatWindow component to explicitly cast `messagesPath` as `Message[]` for improved type safety and clarity. * feat: make login simpler with GET's * fix: debug logs * fix: isAdmin flag * refactor: remove debug route * fix: use config manager in api routes * chores: use latest elysia * wip * feat: working with different origin * refactor: update API routes to throw errors for unimplemented features * fix: use hook for public config so we dont use context outside of component lifecycles * refactor: use api client for user reports in settings load function * fix: deps * feat: get rid of last fetchJSON call in load function * cors setup * feat: use api client side * feat: use api for assistant loading * feat: use api client for assistant search * fix: lint * feat: use api client for tool * feat: rename client hook and use for deleting all convs * fix: let non-authed user set their model * feat: bump minor for elysia API * feat: remove unused serverPublicConfig * feat: add handleFetch to manage cookie forwarding for localhost SSR requests
Matsenas
pushed a commit
to Matsenas/chat-ui
that referenced
this pull request
Jul 4, 2025
* feat(API): refactor API with Elysia * feat: initial elysia setup * feat: replace conv/[id] load function with universal * fix: delete v1 catchall * wip * fix: response type * fix: add cors * feat: more routes in tools & assistants * refacto: use normal svelte fetch in `/assistant/[assistantId]` * refacto: use normal svelte fetch in `conversation/[id]` * feat: use universal load function for `tools/[toolId]` * wip: removing more server load function stuff * feat: more routes to universal load functions * feat: more routes to universal * refactor: move tools loading to API endpoint * refactor(api): implement tools search API endpoint and move load function * fix: types on tool search * refactor: update assistant route and remove redundant page load function * refactor(api): move assistants page load function to api call * refactor(settings): remove waterfall loading * refactor: main load function * fix: types * feat: improve fetchJSON to handle empty responses * fix: issues with page loading & assistant avatars * refactor(api): remove unused Eden fetch utility * refactor(routes): improve conversation page loading and error handling * feat(api): migrate login and logout to API routes (huggingface#1703) * feat(auth): migrate login and logout to API routes - Replaced form-based login/logout with fetch-based API routes - Updated hooks and components to use new `/api/login` and `/api/logout` endpoints * fix: invalidate on logout * refactor: move `/api/login` routes back to `/login` and `/api/logout` to `/logout` remove breaing change to connected apps * refactor(api): update import aliases and configuration for API routes * refactor: update conversation handling to use generic tree structure - Changed `addChildren` and `addSibling` functions to utilize a generic `Tree` type for better flexibility. - Updated `buildSubtree` to return a tree node structure. - Modified conversation response types to use `Serialize<Conversation>` for improved serialization. - Adjusted related tests to align with the new tree structure and types. * fix: specify message type in ChatWindow component - Updated the `messages` prop in the ChatWindow component to explicitly cast `messagesPath` as `Message[]` for improved type safety and clarity. * feat: make login simpler with GET's * fix: debug logs * fix: isAdmin flag * refactor: remove debug route * fix: use config manager in api routes * chores: use latest elysia * wip * feat: working with different origin * refactor: update API routes to throw errors for unimplemented features * fix: use hook for public config so we dont use context outside of component lifecycles * refactor: use api client for user reports in settings load function * fix: deps * feat: get rid of last fetchJSON call in load function * cors setup * feat: use api client side * feat: use api for assistant loading * feat: use api client for assistant search * fix: lint * feat: use api client for tool * feat: rename client hook and use for deleting all convs * fix: let non-authed user set their model * feat: bump minor for elysia API * feat: remove unused serverPublicConfig * feat: add handleFetch to manage cookie forwarding for localhost SSR requests
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
follow up to #1743 with proper fixes