Skip to content

Keep AI team hover responsive with large previews - #1794

Merged
santoshkumarradha merged 4 commits into
devfrom
fix/teams-hover-performance
Oct 8, 2026
Merged

santoshkumarradha merged 4 commits into
devfrom
fix/teams-hover-performance

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Moving the pointer across AI team cards could repeatedly parse every member’s long Markdown response, including cards below the screen. This blocked hover and keyboard input on the UI loop.

Unchanged fitted excerpts now reuse rendered rows in a 64-shape cache cleared on page close. Text, clipping/interruption state, geometry, ink and inline-code path facts invalidate reuse. Offscreen member cards retain keyboard stops and card positions without formatting their metadata, previews or borders; keyboard reveal and offset clamping paint newly visible cards in the same frame.

Validation:

  • make pr-ready passed, including the complete touched tui3 and untagged e2e suites, build, vet, manual gates and structural laws.
  • TestTeamsLargeOverviewPointerAndLivePreview passed against the built terminal: a live manager exchange, 120 saved members with long replies, 600 pointer motions, physical wheel scrolling, resize and opening the correct member. All five final call records used OpenRouter deepseek/deepseek-v4.1-flash, including auxiliary roles.
  • Regression tests cover unchanged-preview reuse, same-length and live-front edits, path/ink/size invalidation, cache retention, full-render viewport equivalence and keyboard reveal.

Warm BenchmarkTeamsHover results with approximately 48 KiB replies (median of three five-iteration samples):

Members Before After Allocated per redraw, before → after
12 52.9 ms 0.37 ms 39.8 MB → 0.18 MB
120 393.3 ms 0.71 ms 398.6 MB → 0.71 MB
1,000 — 6.2 ms — → 6.68 MB

Benchmark review: the recorded medians match this table. At 12 members, warm redraws are approximately 144× faster and allocate 99.55% fewer bytes; at 120 members, they are approximately 553× faster and allocate 99.82% fewer bytes. Across the three samples, the 120-member baseline ranged from 359–451 ms and the candidate from 0.62–0.73 ms. The 1,000-member candidate ranged from 4.51–6.54 ms; no matching baseline was recorded for that size.

Each sample averages five redraws after warming the excerpt cache, with three samples per size. These results measure selected-team body construction with long saved replies; they do not measure cold page opening, end-to-end input latency, streaming cache misses, or the All teams hierarchy. The separate live terminal test verifies input, scrolling and member navigation. Timings are diagnostic; regression gates assert reuse and geometry rather than time limits. The first visible excerpt still renders on a cache miss, and target bookkeeping remains linear in member count.

Actual terminal captures and model receipts are preserved locally. Direct PR attachment upload is unavailable; no evidence files are committed to the source repository.

@santoshkumarradha
santoshkumarradha merged commit b3d9d88 into dev Oct 8, 2026
7 checks passed
@santoshkumarradha
santoshkumarradha deleted the fix/teams-hover-performance branch October 8, 2026 01:31
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