Repository navigation
fix(ios): ignore marker long presses on Apple Maps #201
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
Open
Aaqibhafeezkhan
wants to merge
1
commit into
gmi-software:main
Choose a base branch
from
Aaqibhafeezkhan:fix/apple-marker-long-press
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import MapKit | ||
| import UIKit | ||
| import XCTest | ||
|
|
||
| @testable import NitroMaps | ||
|
|
||
| final class HybridMapViewDelegateTests: XCTestCase { | ||
| func testRejectsLongPressWhenTouchHitsAnAnnotationView() { | ||
| let annotationView = MKAnnotationView(annotation: nil, reuseIdentifier: nil) | ||
| let delegate = HybridMapViewDelegate(hitTest: { _, _ in annotationView }) | ||
|
|
||
| XCTAssertFalse(delegate.shouldReceiveLongPress(at: .zero, in: UIView())) | ||
| } | ||
|
|
||
| func testRejectsLongPressWhenTouchHitsSubviewInsideAnnotationView() { | ||
| let annotationView = MKAnnotationView(annotation: nil, reuseIdentifier: nil) | ||
| let nestedView = UIView() | ||
| annotationView.addSubview(nestedView) | ||
| let delegate = HybridMapViewDelegate(hitTest: { _, _ in nestedView }) | ||
|
|
||
| XCTAssertFalse(delegate.shouldReceiveLongPress(at: .zero, in: UIView())) | ||
| } | ||
|
|
||
| func testAllowsLongPressWhenTouchHitsOrdinaryView() { | ||
| let backgroundView = UIView() | ||
| let delegate = HybridMapViewDelegate(hitTest: { _, _ in backgroundView }) | ||
|
|
||
| XCTAssertTrue(delegate.shouldReceiveLongPress(at: .zero, in: UIView())) | ||
| } | ||
|
|
||
| func testAllowsLongPressWhenHitTestReturnsNoView() { | ||
| let delegate = HybridMapViewDelegate(hitTest: { _, _ in nil }) | ||
|
|
||
| XCTAssertTrue(delegate.shouldReceiveLongPress(at: .zero, in: UIView())) | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: gmi-software/react-native-better-maps
Length of output: 12125
🏁 Script executed:
Repository: gmi-software/react-native-better-maps
Length of output: 32015
🏁 Script executed:
Repository: gmi-software/react-native-better-maps
Length of output: 9200
Add real simulator coverage for pin and image marker drags.
HybridMapViewDelegateTestsonly tests injected hit-test classifications. It does not exerciseMKMapView, the installed recognizers, either marker view,onMarkerDragEnd, oronLongPress. Add an iOS simulator integration/UI test that drags both a draggable pin and image marker, then asserts that each drag-end callback fires andonLongPressdoes not. Run this verification before closing Issue#132.🤖 Prompt for AI Agents
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.
Added
MarkerDragUITests.testDraggingPinAndImageMarkersOnlyFiresDragEnd, which launches the example on Apple MapKit, drags both the default pin and a bundled-image annotation, and checks each drag-end counter increments while the map long-press counter stays at zero. The test is wired into the Apple-provider Native workflow and has a local runner documented inexample/ios-ui-tests/README.md.GitHub created the CI/Native workflow runs for this commit, but they currently report
action_required, so the simulator test has not executed yet. I have not closed Issue #132; the simulator result still needs to be verified once the workflow is approved and runs.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.
@AaqibhafeezkhanThanks for adding the UI test and workflow integration. The reported coverage addresses the missing pin and image marker drag checks.Simulator verification is still pending. After the workflow is approved, confirm that
MarkerDragUITests.testDraggingPinAndImageMarkersOnlyFiresDragEndpasses. Keep this finding and Issue#132open until that result is verified.You are interacting with an AI system.