Repository navigation
Fix short iOS sheets opening half-height since #1031 - #1032
Merged
Merged
Conversation
#1031 replayed the body measure taken before the overlay had a size. That measure wraps text at no width and reads far too tall, so replaying it could lock a short sheet to the scrollable detent; replaying after a height change could also apply the previous page's height. Report the body's size instead of its height. A body measured at no width reports again once it has a width, even when single-line rows keep the same height, so the long Worktree list still learns its real height without a replay. Only measures with a width count, and the presentation mode waits for a sized container. Also drops the gallery's 40-item option from #1031; it never reproduced the bug. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
There was a problem hiding this comment.
Automated review: no finding that 2+ of 3 passes agreed on.
1 finding(s) from a single pass, not posted
ios/OpenCode Mobile/OpenCode Mobile/Components/Chrome/OpenCodeBottomSheet.swift:754high: Height-policy change can leave contentHeight stuck at 0 (muse-spark-1.3-contributor)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.073 · 1 pass(es) stopped early
Collaborator
Author
|
Final version (d934108), iOS against the scenario harness (sample data). Settings sheets. Each group of three: before #1031 · current Worktree sheet with 40 worktrees: rests below the status bar and scrolls to the last worktree.
|
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
Follow-up to #1031.
maincurrently has a regression from #1031: short iOS sheets with wrapping text (Settings → Recent Window, Timeline Style) open at the half-height detent with an empty band instead of wrapping their content.Cause: a bottom sheet body first measures before the overlay has a size, at a narrow but non-zero width (92 pt on iPhone 17). Wrapping text reads far too tall there (506 pt instead of 279 pt). The sheet ignores that measure on purpose. #1031 replayed it once the overlay had a size, so the inflated height crossed the compact limit and locked the sheet into scrolling mode.
The original Worktree bug had a different cause: Worktree rows are single-line, so the body's height is the same at the narrow and the real width. The height-only preference therefore never fired again, and the sheet never learned its real height.
This PR:
BottomSheetContentSizeKey). When the overlay gets its size, the width changes, so the body always reports again at its real width, even when its height stays the same. Only a measure with a width counts.Checks
BottomSheetUITests: 5 passed. These ran on the PR's first version; after the final change,OpenCodeBottomSheetHeightTests(39) andBottomSheetUITests(5) were rerun and passed.main:mainshows the half-height regression./btw: wrap their content.Risks / Follow-ups
🤖 Generated with Claude Code