Skip to content

GeometryEditorToolbar - Add snap settings button#1457

Merged
yo1995 merged 14 commits into
FeatureEditorfrom
Caleb/GeometryEditorToolbar-SnapSettings
Jun 9, 2026
Merged

GeometryEditorToolbar - Add snap settings button#1457
yo1995 merged 14 commits into
FeatureEditorfrom
Caleb/GeometryEditorToolbar-SnapSettings

Conversation

@CalebRas

@CalebRas CalebRas commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds a button that presents a sheet for configuring snap settings to the GeometryEditorToolbar.

Closes swift/issues/8165.

Behavior

  • The toolbar button is hidden when snapSettings.sourceSettings is empty.
  • The "Snap to Geometry Guides", and "Snap to Features" toggles are hidden when "Enable Snapping" is off.

Snap Source Toggles

  • Are disabled if their parent toggle is off.
  • Are disabled if their ruleBehavior is rulesPreventSnapping.
  • Display a subtitle for non-nil ruleBehavior.

How To Test

  • Open the "Geometry Editor Toolbar Snapping" example in the Caleb/TestSnapSettings branch.
  • Tap a feature on the map to start the geometry editor.
  • Tap the gear button in the toolbar to open the settings sheet
  • Use the controls to configure snap settings.

Note: The data in the test example doesn't have any snap rules, so the view will look different than the screenshots.

Screenshots

Before After
Simulator Screenshot - iPhone 17 Pro - 2026-06-02 at 12 20 04 Simulator Screenshot - iPhone 17 Pro - 2026-06-02 at 12 20 40

Platforms

iPhone Simulator Screenshot - iPhone 17 Pro - 2026-06-02 at 15 01 10
iPad Simulator Screenshot - iPad (A16) - 2026-06-02 at 15 04 57
Mac Catalyst Screenshot 2026-06-02 at 3 05 53 PM
Mac Catalyst Screenshot 2026-06-02 at 3 07 00 PM

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a snapping settings entry point to GeometryEditorToolbar by introducing a new toolbar button that presents a sheet (SnapSettingsView) for configuring SnapSettings (enable/disable snapping, haptics, geometry guides, feature snapping, and per-source toggles).

Changes:

  • Added SnapSettingsView (form-based UI) for configuring SnapSettings and SnapSourceSettings.
  • Added a new toolbar control (SnapSettingsButton) that conditionally appears and presents the snap settings sheet.
  • Minor layout tweak to use the existing stackSpacing constant for the horizontal stack.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Sources/ArcGISToolkit/Components/GeometryEditorToolbar/SnapSettingsView.swift New settings UI for snapping, including per-source toggles and rule-behavior messaging.
Sources/ArcGISToolkit/Components/GeometryEditorToolbar/GeometryEditorToolbar.swift Adds the settings button + sheet presentation and updates docs/layout accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CalebRas and others added 2 commits June 2, 2026 16:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@CalebRas CalebRas requested review from rolson and yo1995 June 2, 2026 23:48
Comment thread Sources/ArcGISToolkit/Components/GeometryEditorToolbar/SnapSettingsView.swift Outdated
Comment thread Sources/ArcGISToolkit/Components/GeometryEditorToolbar/SnapSettingsView.swift Outdated
@CalebRas CalebRas requested a review from rolson June 3, 2026 20:14

@rolson rolson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall enable snapping button isn't needed:

Image

@yo1995

yo1995 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

I'll make some changes based on today's feedback

@rolson

rolson commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

I'll make some changes based on today's feedback

Can you be specific with what other changes? I don't think anything needs to be done with persistence yet. I think that will be at the feature editor or app level.

Comment thread Sources/ArcGISToolkit/Components/GeometryEditorToolbar/SnapSettingsView.swift Outdated
@yo1995 yo1995 requested a review from Copilot June 8, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

@yo1995 yo1995 requested a review from rolson June 8, 2026 16:10
@yo1995 yo1995 merged commit fc53ef6 into FeatureEditor Jun 9, 2026
1 check passed
@yo1995 yo1995 deleted the Caleb/GeometryEditorToolbar-SnapSettings branch June 9, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants