Skip to content

perf: mobile + hub performance — incremental reload, gzip, lazy highlight, session cache, Enter/Ctrl+Enter - #131

Open
vinicius-symetrix wants to merge 6 commits into
ygncode:mainfrom
vinicius-symetrix:perf/mobile-and-hub
Open

vinicius-symetrix wants to merge 6 commits into
ygncode:mainfrom
vinicius-symetrix:perf/mobile-and-hub

Conversation

@vinicius-symetrix

Copy link
Copy Markdown

Summary

The whole team uses the hub from phones and laptops over the tailnet; the first paint and every stream event re-downloaded and re-rendered the whole session. This makes the hub fast on weak devices and keeps the server cool under research load.

Server (Go):

  • gzip middleware — content-type aware, skips SSE and pre-compressed /static/ assets, never double-compresses; WriteHeader override so the auth 401 stays plain (fixed the black screen)
  • session result cache — full scans memoized 1.5s (800 NFS project dirs were re-walked on every poll: ~0.8s → 2.6ms)
  • byte-budgeted session window (WindowEntries) — byte-heavy sessions embed a tail that fits the budget instead of megabytes of HTML

Frontend:

  • incremental live reload — fetch only the missing tail (?from=N) instead of the whole session on every stream event → fixes the iPhone typing lag while the model generates
  • highlight.js no longer in the entry static graph (~900KB off first paint)
  • load-earlier respects the byte budget via the shared WindowEntries
  • Enter sends everywhere; Ctrl/Cmd+Enter inserts a newline (mobile had no send-on-Enter)
  • /api/suggested-path + /?new=1&path= deep link pre-fills the caller shared folder in the new-session modal

Test plan

  • 782 frontend tests pass (incl. 2 new incremental-reload tests)
  • all Go packages pass (incl. gzip + WindowEntries suites)
  • nightly patch applies clean on v0.0.1-beta.38
  • validated end-to-end in a headless browser: login → session list → Henrique's 15 sessions → deep-link modal → composer Enter/Ctrl+Enter

Symetrix Agent added 6 commits November 15, 2026 06:40
…ight, session cache, Enter/Ctrl+Enter

The whole team uses the hub from phones and laptops over the tailnet; the
first paint and every stream event re-downloaded and re-rendered the whole
session. This makes the hub fast on weak devices and keeps the server cool
under research load.

Server (Go):
- gzip middleware (content-type aware, skips SSE + /static pre-compressed,
  never double-compresses; WriteHeader override so the auth 401 stays plain)
- session result cache: full scans memoized 1.5s (800 NFS project dirs were
  re-walked on every poll, ~0.8s -> 2.6ms)
- byte-budgeted session window (WindowEntries): byte-heavy sessions embed a
  tail that fits the budget instead of megabytes of HTML

Frontend:
- incremental live reload: fetch only the missing tail (?from=N) instead of
  the whole session on every stream event — the iPhone typing lag
- highlight.js no longer in the entry static graph (~900KB off first paint)
- load-earlier respects the byte budget via the shared WindowEntries
- Enter sends everywhere; Ctrl/Cmd+Enter inserts a newline (mobile had no
  send-on-Enter)
- /api/suggested-path + /?new=1&path= deep link pre-fills the caller shared
  folder in the new-session modal

Tests: 782 frontend + all Go packages pass; the nightly patch applies clean
on v0.0.1-beta.38.
…nged payloads cost a header round trip, not megabytes
…ssion cost a header round trip instead of re-downloading the shell (and embedded session payload)

This branch has not been deployed

No deployments
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.

1 participant