Repository navigation
Fix split action lane clipping before empty tab space #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -422,6 +422,24 @@ final class BonsplitTests: XCTestCase { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| XCTAssertTrue(layout.splitButtonLaneOverflowsViewport) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func testTabBarLayoutUsesTrailingWhitespaceBeforeClippingSplitButtons() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let measuredWidth = TabBarStyling.splitButtonsBackdropWidth(buttonCount: 10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let layout = TabBarLayout( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tabBarHeight: 28, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| availableWidth: 930, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tabContentWidthExcludingSplitButtonLane: 300, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| splitButtonCount: 10, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| splitButtonLaneVisible: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reservesSplitButtonLane: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| measuredSplitButtonLaneWidth: measuredWidth | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| XCTAssertEqual(layout.maximumSplitButtonLaneWidth, 630) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+425
to
+437
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| XCTAssertEqual(layout.visibleSplitButtonLaneWidth, measuredWidth) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| XCTAssertEqual(layout.trailingTabContentInset, measuredWidth) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| XCTAssertFalse(layout.splitButtonLaneOverflowsViewport) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+425
to
+441
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update companion rendering assertions for the new lane-width contract. This new contract allows the action lane to exceed the quarter cap when trailing whitespace exists, but 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func testTabBarLayoutKeepsMeasuredLaneWhenItFitsQuarterOfAvailableWidth() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let layout = TabBarLayout( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tabBarHeight: 28, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
tabBarLayout.trailingTabContentInsethere is not immediately obvious:tabBarLayoutis recomputed from the current (pre-update)tabContentWidthExcludingSplitButtonLane, which matches the inset already baked intoframe.widthat render time, so the subtraction always yields the bare tab content width and the loop converges. A short comment prevents future maintainers from misreading this as accidental circular state.