perf(UI): optimize app initialization by parallelizing API calls and lazy loading components#6276
perf(UI): optimize app initialization by parallelizing API calls and lazy loading components#6276balazs-szucs wants to merge 12 commits intoStirling-Tools:mainfrom
Conversation
…lazy loading components
There was a problem hiding this comment.
Pull request overview
This PR targets frontend perceived performance by reducing initial JS work via code-splitting on the Home page, smoothing theme-switch transitions, and shortening app bootstrap by fetching config alongside a status probe.
Changes:
- Lazy-loads several heavy HomePage components with
React.lazy+Suspenseand introduces a shared loading fallback. - Updates
AppConfigProviderto fetch app-config while also issuing a status request during initialization, and refactors “resolved” tracking to use a ref. - Narrows theme-switch CSS transitions (and makes Mantine button transitions more granular); updates AppConfigContext tests to account for the extra request.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/core/theme/mantineTheme.ts | Replaces transition: all with targeted button transitions. |
| frontend/src/core/styles/theme.css | Replaces global * transition rule with a Mantine-class-targeted selector. |
| frontend/src/core/pages/HomePage.tsx | Converts several major components to lazy-loaded modules behind a Suspense boundary. |
| frontend/src/core/contexts/AppConfigContext.tsx | Refactors resolved-config tracking to a ref and adds config+status fetching. |
| frontend/src/core/contexts/AppConfigContext.test.tsx | Updates mocks/assertions to reflect the new status call and refetch behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…pe safety, and refine transitions
…e unnecessary suspense boundaries and lazy imports
|
/deploypr |
🚀 PR Test DeploymentYour PR has been deployed for testing! 🔗 Test URL: http://54.175.155.236:6276 This deployment will be automatically cleaned up when the PR is closed. |
Screen.Recording.2026-05-01.at.15.16.10.movI appreciate this might be too nitpicky, but there's some funny loading behaviour in this PR with things moving about on reload. Tool list is the most obvious place that this appears. Can we do anything about this to make sure it's always the same size before and after the contents has actually loaded in? |
No, that is one of the main goals of the PRs, so it is not nitpicky. It does look a bit weird, i'll see what i can do about it. |
# Conflicts: # frontend/src/core/pages/HomePage.tsx
…g states and adjust layout for better responsiveness
|
/deploypr |
🚀 PR Test DeploymentYour PR has been deployed for testing! 🔗 Test URL: http://54.175.155.236:6276 This deployment will be automatically cleaned up when the PR is closed. |
|
/deploypr |
🚀 PR Test DeploymentYour PR has been deployed for testing! 🔗 Test URL: http://54.175.155.236:6276 This deployment will be automatically cleaned up when the PR is closed. |
…ort and adjust loading skeleton behavior
|
/deploypr |
🚀 PR Test DeploymentYour PR has been deployed for testing! 🔗 Test URL: http://54.175.155.236:6276 This deployment will be automatically cleaned up when the PR is closed. |
Description of Changes
This pull request improves frontend performance and user experience by optimizing component loading and UI transitions, as well as enhancing app initialization efficiency. The most significant changes are the introduction of React lazy loading and Suspense for heavy components on the home page, targeted CSS transitions for smoother theme switching, and parallelizing critical API calls during app startup.
Performance and Loading Optimization:
Switched to React
lazyandSuspensefor heavy components (ToolPanel,Workbench,QuickAccessBar,RightRail,FileManager,AppConfigModal) inHomePage.tsx, enabling code-splitting and faster initial load times. ALoadingFallbackcomponent is shown while these components load.Parallelized fetching of
/api/v1/config/app-configand/api/v1/info/statusinAppConfigProviderto reduce app initialization time and improve perceived performance.UI and Theming Improvements:
Replaced the global CSS
*transition rule with a more targeted[class*="mantine-"]selector for theme-related transitions, preventing unwanted transitions on non-theme elements.Updated
mantineThemebutton styles to use more granular transition properties, resulting in smoother and more consistent visual feedback for theme changes and interactions.Checklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyUI Changes (if applicable)
Testing (if applicable)
task checkto verify linters, typechecks, and tests pass