Add floatingCardToolBarItems: card-attached floating views with alignment#29
Merged
Conversation
`topMapToolBarItems` / `bottomMapToolBarItems` overlay the *map*. There was no way to float a control that stays attached to the *card* and remains visible regardless of the card's drag position. `floatingCardToolBarItems` fills that gap: items are hosted in a stack added to the controller's view, pinned to the bottom of the card's visible area at `.defaultHigh` priority but clamped to the safe area as a required constraint. So they prefer to sit at the card's bottom edge, yet never drop below the screen when the card is collapsed or peeking and its content extends past the bottom. `floatingCardToolBarAlignment` controls horizontal placement — `.center` (default, e.g. a status pill), `.leading` / `.trailing` (e.g. a FAB-style primary action), or `.fill` (a full-width button). The leading/trailing inequality clamps stay active for every alignment, so a wide row never overflows the card. The card-attached items are also (re)populated right after `didBuild`, not just during the push/pop floating-view refresh. Cards commonly configure their toolbar items in `didBuild`, which runs *after* that refresh, so items set there would otherwise be silently dropped. Refresh is idempotent (`populateFloatingView` cleans up first), so the persistent view survives. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
|
Suggested squash-merge commit message: After merge: tag a new version in |
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.
What
Adds a card-attached floating-views affordance to
TGCardViewController.TGCard.floatingCardToolBarItems: [UIView]?— views floated at the bottom of the card itself (not over the map, unliketop/bottomMapToolBarItems). They're hosted in a stack added to the controller's view, pinned to the bottom of the card's visible area at.defaultHighpriority but clamped to the safe area as a required constraint — so they prefer the card's bottom edge yet never drop below the screen when the card is collapsed/peeking and its content extends past the bottom.TGCard.floatingCardToolBarAlignment(.leading/.center/.trailing/.fill, default.center) — horizontal placement within the card..centersuits a status pill;.leading/.trailinga FAB-style primary action;.filla full-width button. The leading/trailing inequality clamps stay active for every alignment, so a wide row never overflows the card.Why
There was no way to float a control that stays attached to the card and remains visible regardless of the card's drag position —
top/bottomMapToolBarItemsoverlay the map. The immediate consumer is TripGo's agenda "recalculating…" status pill, which needs to stay visible at any card position; the alignment option also opens the door to a trailing FAB-style primary action.Notes for reviewers
didBuildtiming: card-attached items are also (re)populated right afterdidBuild, not only during the push/pop floating-view refresh. Cards commonly configure their toolbar items indidBuild, which runs after that refresh, so items set there would otherwise be silently dropped. Population is idempotent (populateFloatingViewcleans up first), and the items are persistent views owned by the card, so they survive a re-populate.top/bottomMapToolBarItems. Covered presentation paths: initial/root present, push, pop.TGPageCardchildren setting these indidBuildaren't forwarded (separate flow) — out of scope.🤖 Generated with Claude Code