refactor(ui): InsetHeaderScrollView, shared tab swipes#535
refactor(ui): InsetHeaderScrollView, shared tab swipes#535
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8e3162b57
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| /// Before the first header measurement, use full height so `minHeight` is non-negative. | ||
| private func contentMinHeight(in geo: GeometryProxy) -> CGFloat { | ||
| let insetTop = headerHeight > 0 ? headerHeight : geo.size.height |
There was a problem hiding this comment.
Bug: contentMinHeight fallback returns 0 instead of the full viewport height
The conditional is inverted. When headerHeight == 0 (before the first preference propagation), insetTop is set to geo.size.height, so the method returns max(0, geo.size.height - geo.size.height) = 0. This contradicts the doc comment — "use full height so minHeight is non-negative" — and causes scroll content to collapse to zero minimum height on first render, producing a visible layout flash. SupportScreen, which previously used geometry.size.height for frame(minHeight:) to pin footer content at the bottom, will regress.
Context:
bitkit-ios/Bitkit/Components/InsetHeaderScrollView.swift
Lines 59 to 63 in 09fe376
The fix is to swap the fallback: when headerHeight is not yet known, subtract 0 so the content gets the full geometry height as its minimum.
| let insetTop = headerHeight > 0 ? headerHeight : geo.size.height | |
| let insetTop = headerHeight > 0 ? headerHeight : 0 |
| import SwiftUI | ||
|
|
||
| /// Shared gradient tile used by suggestions widget and shop discover | ||
| struct Card: View { |
There was a problem hiding this comment.
CLAUDE.md: name Card violates the descriptive-names rule
CLAUDE.md states:
Use descriptive names (e.g.,
UserProfileCardnotCard)
Card is the exact anti-example cited in the rule. The doc comment already describes a specific semantic role ("Shared gradient tile used by suggestions widget and shop discover"), so a more descriptive name is straightforward — e.g. SuggestionTileCard or GradientTileCard.
Context:
bitkit-ios/Bitkit/Components/Card.swift
Lines 3 to 5 in 09fe376
Description
InsetHeaderScrollViewwith measured topsafeAreaInsetheader + scroll contentminHeightto fill the viewport below. To be used on scrollable screens with headers likeAllActivity,MainSettings,ShopDiscover.swipeSegmentedTabsforAllActivity,MainSettings, andShopDiscoversegmented controls (horizontal swipe to change tabs).CardviewsScreenshot / Video
Simulator.Screen.Recording.-.iPhone.17.-.2026-05-04.at.23.44.27.mov
QA Notes
Make sure changed screens look polished and suggestion/shop cards still work as expected.