update map bottom inset with controls minimization#143
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates map layout behavior so the MKMapView’s bottom inset tracks the MapControls panel height and its minimization state, keeping map controls/attribution from being obscured. It also refines zoom calculation heuristics and refactors RootView ↔︎ MapViewModel wiring to use a dedicated view store.
Changes:
- Update MKMapView bottom layout margins based on MapControls size + minimization state (with animation).
- Adjust zoom level calculations to use the larger span/size dimension and update interpolation points accordingly.
- Refactor RootView to use a scoped
RootView.Map.Storefor map-related view state/actions and propagate controls size changes into the map model.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Rewind/Screens/Map/Zoom.swift | Updates zoom heuristics to use max span/size dimension and refreshes adjustment breakpoints. |
| Rewind/Screens/Map/RewindMap.swift | Adds bottom inset updating and disables safe-area-driven layout margin insets on the map view. |
| Rewind/Screens/Map/MapModel.swift | Extends controls state/actions to track controls view size and store it in state. |
| Rewind/Screens/Map/Controls/MapControls.swift | Centralizes controls animation, makes glimpse height configurable, and exposes minimized offset constant. |
| Rewind/Screens/Map/Controls/FloatingMenu.swift | Aligns FloatingMenu animation timing with MapControls animation. |
| Rewind/App/RootView.swift | Introduces a scoped RootView.Map store and reports controls size changes to the map model. |
| Rewind/App/RewindApp.swift | Updates RootView construction to pass the new scoped map store. |
| Rewind/App/AppGraph.swift | Wires controls minimization + size to map bottom inset updates; introduces a debug assert around map lazy-loading timing. |
| Rewind.xcodeproj/project.pbxproj | Bumps build and marketing versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
8
to
10
| import MapKit | ||
| import SwiftUI | ||
| import VGSL |
Comment on lines
+81
to
+86
| func updateBottomInset(_ inset: CGFloat) { | ||
| UIView.animate(mapControlsAnimation) { | ||
| map.layoutMargins.bottom = inset | ||
| map.layoutIfNeeded() | ||
| } | ||
| } |
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.
No description provided.