Skip to content

Fix short iOS sheets opening half-height since #1031 - #1032

Merged
ivanfenenko merged 1 commit into
mainfrom
fix/bottom-sheet-measure-width
Nov 11, 2026
Merged

ivanfenenko merged 1 commit into
mainfrom
fix/bottom-sheet-measure-width

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1031. main currently 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:

  • Removes Scroll a long iOS Worktree sheet instead of overflowing the screen #1031's replay (including the one after a height policy change) and the gallery's 40-item option.
  • Keeps the rule that ignores measures taken before the overlay has a size.
  • Reports the body's size instead of its height (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

  • Full iOS unit suite: 3,494 Swift Testing tests and 122 XCTest tests passed. BottomSheetUITests: 5 passed. These ran on the PR's first version; after the final change, OpenCodeBottomSheetHeightTests (39) and BottomSheetUITests (5) were rerun and passed.
  • Real app against the scenario harness (opencode v2, iPhone 17 simulator, iOS 27.2), compared with the build from before Scroll a long iOS Worktree sheet instead of overflowing the screen #1031 and with current main:
    • Settings → Recent Window, Timeline Style: wrap their content as before Scroll a long iOS Worktree sheet instead of overflowing the screen #1031. main shows the half-height regression.
    • Follow-up send, Commands, New shell, model and agent pickers, message actions, Select text, /btw: wrap their content.
    • New session → Worktree with 40 worktrees: rests below the status bar and scrolls to the last worktree.
    • Half-height sheets (Filter by project, steps, subagents, shell output) are unchanged.
  • Screenshots are in the comments below.

Risks / Follow-ups

🤖 Generated with Claude Code

#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]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

iOS against a throwaway opencode v2 server (sample data, 40 worktrees).

Worktree, 40 worktrees Commands Commands → MCP servers Select text
Worktree sheet resting below the status bar and scrolling Commands sheet wrapped to its content MCP servers page shrinks to its content Select text sheet wrapped tightly around wrapping text

@ivanfenenko
ivanfenenko merged commit 7c64db9 into main Nov 11, 2026
@ivanfenenko
ivanfenenko deleted the fix/bottom-sheet-measure-width branch November 11, 2026 23:25

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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:754 high: 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

@ivanfenenko ivanfenenko changed the title Measure bottom sheet bodies by size so a no-width pass never sticks Fix short iOS sheets opening half-height since #1031 Nov 11, 2026
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Final version (d934108), iOS against the scenario harness (sample data).

Settings sheets. Each group of three: before #1031 · current main (#1031) · this PR. main opens Recent Window and Timeline Style at half height with an empty band; this PR matches the layout from before #1031.

Recent Window and Timeline Style before #1031, on main, and with this PR

Worktree sheet with 40 worktrees: rests below the status bar and scrolls to the last worktree.

Top End
Worktree sheet with header visible Worktree sheet scrolled to sample-40

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