fix: replace anchor system with simple screen-bottom growth detection#74
Merged
quiet-node merged 7 commits intomainfrom Apr 10, 2026
Merged
fix: replace anchor system with simple screen-bottom growth detection#74quiet-node merged 7 commits intomainfrom
quiet-node merged 7 commits intomainfrom
Conversation
…ction Remove the complex WindowAnchor coordinate system (precalculated bottom pin, max-height clamping, pre-expansion on generate, isPreExpandedRef locking, outerContainerRef minHeight CSS hacks) and replace with a single check: if windowY + MAX_CHAT_WINDOW_HEIGHT > screenBottomY, grow upward; otherwise grow downward. The Rust backend now sends window_x, window_y, and screen_bottom_y in the visibility payload instead of a WindowAnchor struct. The frontend decides growth direction at show time and pins the window bottom for upward sessions. Net deletion of ~240 lines. Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
During streaming with upward growth, the ResizeObserver was calling set_window_frame on every content height change, causing the window to visually bounce as the Y position oscillated with each token. Replace the per-event native resize with a buffered commit strategy: when streaming, grow the native window in coarse steps (targetHeight + 80px buffer). The extra space lands in the transparent region above the morphing container where it is invisible to the user. Content then fills smoothly via justify-end with zero native resize calls until it catches up to the committed height. When not streaming, exact height is committed as before. Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
7fcce48 to
e628248
Compare
- Add Math.max(0, ...) clamp to prevent the window from going above the screen top during upward growth on small displays - Add missing setGrowsUpward(false) in requestHideOverlay so the React state stays in sync with the ref during exit animations - Remove hasMorphedUpwardRef (declared and written but never read) - Fix window_x doc comment to reflect its use as a positional anchor Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node
added a commit
that referenced
this pull request
Apr 10, 2026
…#74) * refactor: replace anchor system with simple screen-bottom growth detection Remove the complex WindowAnchor coordinate system (precalculated bottom pin, max-height clamping, pre-expansion on generate, isPreExpandedRef locking, outerContainerRef minHeight CSS hacks) and replace with a single check: if windowY + MAX_CHAT_WINDOW_HEIGHT > screenBottomY, grow upward; otherwise grow downward. The Rust backend now sends window_x, window_y, and screen_bottom_y in the visibility payload instead of a WindowAnchor struct. The frontend decides growth direction at show time and pins the window bottom for upward sessions. Net deletion of ~240 lines. Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: eliminate upward-growth jitter with buffered window commits During streaming with upward growth, the ResizeObserver was calling set_window_frame on every content height change, causing the window to visually bounce as the Y position oscillated with each token. Replace the per-event native resize with a buffered commit strategy: when streaming, grow the native window in coarse steps (targetHeight + 80px buffer). The extra space lands in the transparent region above the morphing container where it is invisible to the user. Content then fills smoothly via justify-end with zero native resize calls until it catches up to the committed height. When not streaming, exact height is committed as before. Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: App window height morph smoothly in both directions Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: Always morph upward and lock height state via React * fix: refine upward growth buffering and test coverage Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * chore: remove stray debug scripts from worktree Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: clamp upward growth Y, sync growsUpward state, remove dead ref - Add Math.max(0, ...) clamp to prevent the window from going above the screen top during upward growth on small displays - Add missing setGrowsUpward(false) in requestHideOverlay so the React state stays in sync with the ref during exit animations - Remove hasMorphedUpwardRef (declared and written but never read) - Fix window_x doc comment to reflect its use as a positional anchor Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> --------- Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node
added a commit
that referenced
this pull request
Apr 10, 2026
…#74) * refactor: replace anchor system with simple screen-bottom growth detection Remove the complex WindowAnchor coordinate system (precalculated bottom pin, max-height clamping, pre-expansion on generate, isPreExpandedRef locking, outerContainerRef minHeight CSS hacks) and replace with a single check: if windowY + MAX_CHAT_WINDOW_HEIGHT > screenBottomY, grow upward; otherwise grow downward. The Rust backend now sends window_x, window_y, and screen_bottom_y in the visibility payload instead of a WindowAnchor struct. The frontend decides growth direction at show time and pins the window bottom for upward sessions. Net deletion of ~240 lines. Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: eliminate upward-growth jitter with buffered window commits During streaming with upward growth, the ResizeObserver was calling set_window_frame on every content height change, causing the window to visually bounce as the Y position oscillated with each token. Replace the per-event native resize with a buffered commit strategy: when streaming, grow the native window in coarse steps (targetHeight + 80px buffer). The extra space lands in the transparent region above the morphing container where it is invisible to the user. Content then fills smoothly via justify-end with zero native resize calls until it catches up to the committed height. When not streaming, exact height is committed as before. Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: App window height morph smoothly in both directions Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: Always morph upward and lock height state via React * fix: refine upward growth buffering and test coverage Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * chore: remove stray debug scripts from worktree Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: clamp upward growth Y, sync growsUpward state, remove dead ref - Add Math.max(0, ...) clamp to prevent the window from going above the screen top during upward growth on small displays - Add missing setGrowsUpward(false) in requestHideOverlay so the React state stays in sync with the ref during exit animations - Remove hasMorphedUpwardRef (declared and written but never read) - Fix window_x doc comment to reflect its use as a positional anchor Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> --------- Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node
added a commit
that referenced
this pull request
Apr 11, 2026
…#74) * refactor: replace anchor system with simple screen-bottom growth detection Remove the complex WindowAnchor coordinate system (precalculated bottom pin, max-height clamping, pre-expansion on generate, isPreExpandedRef locking, outerContainerRef minHeight CSS hacks) and replace with a single check: if windowY + MAX_CHAT_WINDOW_HEIGHT > screenBottomY, grow upward; otherwise grow downward. The Rust backend now sends window_x, window_y, and screen_bottom_y in the visibility payload instead of a WindowAnchor struct. The frontend decides growth direction at show time and pins the window bottom for upward sessions. Net deletion of ~240 lines. Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: eliminate upward-growth jitter with buffered window commits During streaming with upward growth, the ResizeObserver was calling set_window_frame on every content height change, causing the window to visually bounce as the Y position oscillated with each token. Replace the per-event native resize with a buffered commit strategy: when streaming, grow the native window in coarse steps (targetHeight + 80px buffer). The extra space lands in the transparent region above the morphing container where it is invisible to the user. Content then fills smoothly via justify-end with zero native resize calls until it catches up to the committed height. When not streaming, exact height is committed as before. Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: App window height morph smoothly in both directions Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: Always morph upward and lock height state via React * fix: refine upward growth buffering and test coverage Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * chore: remove stray debug scripts from worktree Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: clamp upward growth Y, sync growsUpward state, remove dead ref - Add Math.max(0, ...) clamp to prevent the window from going above the screen top during upward growth on small displays - Add missing setGrowsUpward(false) in requestHideOverlay so the React state stays in sync with the ref during exit animations - Remove hasMorphedUpwardRef (declared and written but never read) - Fix window_x doc comment to reflect its use as a positional anchor Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> --------- Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
This was referenced Apr 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
WindowAnchorcoordinate system (precalculated bottom pin, max-height clamping,isPreExpandedReflocking,outerContainerRefminHeight CSS hacks) and replace with a single check: ifwindowY + MAX_CHAT_WINDOW_HEIGHT > screenBottomY, grow upward; otherwise grow downwardwindow_x,window_y, andscreen_bottom_yin the visibility payload instead of aWindowAnchorstructjustify-endwith fewer native resize callsTest plan
bun run test:coverageshows 100% coveragebun run validate-buildpasses with zero warnings🤖 Generated with Claude Code