Add target-app selection and routing support - #128
Conversation
feat(web): Support dual Antigravity engines and add chat auto-scroll ResizeObserver Detailed Changes: 1. **Chat Auto-Scroll Stabilization (ResizeObserver)**: - Resolved a critical bug where long chats would jump/stay scrolled to the top on load. - Introduced a `ResizeObserver` on the inner messages container to detect asynchronous height increases (e.g. text expanding, Markdown compiling, images loading) and snap the scroll position to the bottom if the user was already near the bottom. - Restructured layout references (`innerRef` and `scrollRef`) in `ChatPanel.tsx` to handle the resize events. 2. **Dual-Target Engine Support (Antigravity & Antigravity IDE)**: - Enabled target routing selection in the UI, allowing the Porta web app to switch between both the standard `antigravity` Language Server and the Desktop `antigravity-ide` Language Server. - Ensured headers (`x-porta-target-app`) and WebSocket parameters are correctly passed so that step updates and message submissions route to the correct LS process. 3. **Background Mobile Load & Caching Optimization**: - Implemented sessionStorage caching for conversation trajectories in `useStepsStream.ts` to instantly restore message histories. - Eliminated the jarring blank "loading skeleton" flash when users perform a pull-to-refresh on mobile devices or reload on unstable network connections. - Set up silent background polling to merge and sync new steps seamlessly.
L1M80
left a comment
There was a problem hiding this comment.
Thank you for the target-engine work and the thoughtful mobile/chat improvements. During review I found a few concrete routing regressions: a missing selected engine could fall through to another engine when starting a chat, changing the selector could leave the old WebSocket and cache active, the cache was cleared again on mount, the 0-to-1000 fetch could show the wrong page when WebSocket recovery was unavailable, and vite --host widened the default LAN exposure. I fixed these in 98e9e61 by failing the unavailable target with 503, remounting and explicitly routing the stream per target, storing target-specific cached pages with offsets while refreshing in the background, restoring tail pagination, refreshing target-aware health, and keeping the dev server loopback-only by default. I also fixed the lint failures and added regression coverage. Verified in a real browser against the running AG instance, including a 60-step conversation and WebSocket readiness, plus all 343 tests, build, and lint. Everything now looks good to me. Thank you again!
feat(web): Support dual Antigravity engines and add chat auto-scroll ResizeObserver
Detailed Changes:
Chat Auto-Scroll Stabilization (ResizeObserver):
ResizeObserveron the inner messages container to detect asynchronous height increases (e.g. text expanding, Markdown compiling, images loading) and snap the scroll position to the bottom if the user was already near the bottom.innerRefandscrollRef) inChatPanel.tsxto handle the resize events.Dual-Target Engine Support (Antigravity & Antigravity IDE):
antigravityLanguage Server and the Desktopantigravity-ideLanguage Server.x-porta-target-app) and WebSocket parameters are correctly passed so that step updates and message submissions route to the correct LS process.Background Mobile Load & Caching Optimization:
useStepsStream.tsto instantly restore message histories.