GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(chat): stop the streaming transcript floor inventing scroll space by waleedlatif1 · Pull Request #6527 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The transcript sizer floor was computed as the viewport's bottom edge (scrollTop + clientHeight), which exceeds the content height whenever the transcript is shorter than the viewport — early in a turn, or in any short chat. That invents scrollable space no content occupies.
  • It stays invisible until the scroll container shrinks mid-turn (composer growing, queued-message banner appearing, window or panel resize). Then the bottom-pin scrolls into the invented space and the transcript is displaced upward until the floor drains at the end of the turn.
  • Clamps the floor to the space content has actually held this turn — the max of the virtualizer's total size and the still-applied floor. Extracted to nextSizerFloor with unit tests.
  • The applied-floor term is load-bearing on its own: without it, a queued message re-engaging the floor mid-drain dumps the undrained debt in a single frame, which is the jump the eased drain exists to prevent.

Type of Change

  • Bug fix

Testing

Measured in Chromium against a harness rendering the real virtualizer, useAutoScroll, and the floor effect:

scenario before after
short transcript, composer grows mid-stream 72px upward displacement, reverts at end of turn 0px
short transcript, queued-message banner mid-stream same displacement 0px
tall transcript no phantom space identical
mid-stream row shrink floor holds, drains identical
drain interrupted by a new turn 3px eased release identical

509 home tests pass; typecheck and lint clean.

Note: verified in a harness that reconstructs the transcript with the real modules, not in the running app — worth a live spot-check on a short first reply.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@vercel

vercel Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 11, 2026 3:41am

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches scroll pinning and virtualized transcript layout during streaming—user-visible and timing-sensitive—but logic is isolated with unit tests and preserves tall-transcript behavior.

Overview
Fixes phantom scroll space during streaming when the transcript is shorter than the viewport. The sizer min-height floor was tied to the viewport bottom (scrollTop + clientHeight), which can sit below real content height—so the floor invented empty scrollable area that only shows up when the scroll container shrinks mid-turn (composer growth, queued-message banner, resize), pulling the pinned transcript upward until end-of-turn drain.

nextSizerFloor centralizes the floor: a per-turn high-water mark (max of prior high water, virtualizer total size, and applied floor) caps the floor so it never exceeds space content has actually held. Mid-turn shrinks still hold via high water; undrained floor debt still carries when the floor re-engages mid-drain.

mothership-chat wires that helper, tracks high water in a ref, and resets floor state on chat switch (not when a pending chat gets its id) so a short chat doesn’t inherit another chat’s floor.

Reviewed by Cursor Bugbot for commit 0369620. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR prevents short streaming transcripts from creating phantom scroll space and adds explicit floor-state cleanup when switching chats.

  • Clamps the active sizer floor to the transcript’s retained high-water mark.
  • Preserves undrained floor debt when a new turn interrupts the drain.
  • Clears transcript-specific floor state on chat changes.
  • Adds focused unit coverage for floor bounds, shrinking content, fractional offsets, and interrupted drains.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx Integrates bounded floor computation, resets transcript-specific floor state on chat changes, and uses the required absolute import.
apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/sizer-floor.ts Encapsulates the floor and high-water calculation that prevents viewport extent from inventing content space.
apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/sizer-floor.test.ts Covers short transcripts, fractional and negative extents, content shrinkage, growth, and interrupted floor drains.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Transcript layout commit] --> B{Chat changed?}
  B -->|Yes, distinct chat| C[Cancel drain and clear floor state]
  B -->|No or pending chat persisted| D{Floor active?}
  C --> D
  D -->|Yes| E[Compute content high-water mark]
  E --> F[Clamp viewport extent to high-water mark]
  F --> G[Apply bounded min-height]
  D -->|No| H[Drain or clear applied floor]
Loading

Reviews (3): Last reviewed commit: "fix(chat): release the transcript floor ..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR extracts the transcript floor calculation and clamps it to content held during the active turn, with focused unit coverage.

  • Adds nextSizerFloor and tests for short transcripts, fractional extents, row shrinkage, growth, and interrupted drains.
  • Integrates a turn-level high-water mark into the streaming transcript floor and preserves undrained floor debt.
  • The high-water state currently lacks a reset at chat-identity boundaries.

Confidence Score: 4/5

The PR should not merge until the floor’s high-water state is reset when the active chat changes; the import-convention issue is non-blocking.

A retained component can apply the previous tall chat’s high-water mark to a newly selected short chat for at least one layout pass, recreating artificial scroll space that then drains visibly.

Files Needing Attention: apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx; apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/sizer-floor.test.ts

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx Integrates content-clamped floor tracking, but the new high-water ref can cross chat boundaries and recreate phantom space.
apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/sizer-floor.ts Provides a clear pure calculation that clamps viewport extent to content and applied-floor high-water state.
apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/sizer-floor.test.ts Covers the pure floor arithmetic well, but does not exercise the component-level transcript reset boundary.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Tall chat is streaming] --> B[heldHighWater records tall content]
  B --> C[User switches to cached short chat]
  C --> D[MothershipChat instance and refs persist]
  D --> E[Layout effect runs while lastRowAnimating is still true]
  E --> F[nextSizerFloor retains old high-water]
  F --> G[Short chat receives artificial min-height]
  G --> H[Floor drains over subsequent frames]
Loading

Reviews (1): Last reviewed commit: "fix(chat): stop the streaming transcript..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Aug 11, 2026
View reviewed changes
Comment thread apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

waleedlatif1 added 2 commits August 10, 2026 20:40
@waleedlatif1
fix(chat): stop the streaming transcript floor inventing scroll space
7ab9c51
The sizer floor was the viewport's bottom edge (scrollTop + clientHeight),
which exceeds the content height whenever the transcript is shorter than the
viewport. That invents scrollable space no content occupies, and a mid-turn
container shrink turns it into real scroll room the bottom-pin scrolls into.

Clamp the floor to the space content has actually held this turn: the max of
the virtualizer's total size and the still-applied floor. The applied-floor
term keeps undrained debt across a turn boundary that interrupts the drain.
@waleedlatif1
fix(chat): release the transcript floor when the chat changes
0369620
The high-water mark and applied floor are per-turn refs on a component that
survives a chat switch, so a tall chat's mark could size a newly opened short
one for as long as the outgoing turn kept the floor engaged. Release both
outright on a chat change — the switch re-lands the viewport, so there is no
eased settle to preserve — while treating a pending chat adopting its id as
the same conversation.

Also switch the sizer-floor import to the absolute path convention.
@waleedlatif1
waleedlatif1 force-pushed the review/chat-composer-autosize branch from 3c8ad63 to 0369620 Compare August 11, 2026 03:41
@vercel
vercel Bot temporarily deployed to Preview August 11, 2026 03:41 Inactive
@waleedlatif1

waleedlatif1 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 11, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 0369620. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waleedlatif1
waleedlatif1 merged commit 1a39e29 into staging Aug 11, 2026
30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the review/chat-composer-autosize branch August 11, 2026 05:00
@waleedlatif1 waleedlatif1 mentioned this pull request Aug 11, 2026
v0.8.0: new workflow UI, v2 API, salesforce JWT, provenance improvements, incidentio tools, block retries #6533
Closed
@waleedlatif1

waleedlatif1 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1 waleedlatif1 mentioned this pull request Aug 12, 2026
v0.8.0: desktop app, workflow UI, v2 endpoints #6606
Merged

This branch was previously deployed

1 inactive deployment
Preview — 0369620e Deployed Aug 11, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@waleedlatif1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.