Skip to content

Add target-app selection and routing support - #128

Merged
L1M80 merged 2 commits into
L1M80:developfrom
Fayiz1:develop
Aug 17, 2026
Merged

Add target-app selection and routing support#128
L1M80 merged 2 commits into
L1M80:developfrom
Fayiz1:develop

Conversation

@Fayiz1

@Fayiz1 Fayiz1 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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.

Fayiz1 and others added 2 commits August 13, 2026 11:23
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 L1M80 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@L1M80
L1M80 merged commit 0a0ea5f into L1M80:develop Aug 17, 2026
5 of 6 checks passed
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