Skip to content

fix(mobile): add opt-in four-connected path queries - #930

Open
Afloat16 wants to merge 2 commits into
petercorke:mainfrom
Afloat16:fix/manhattan-planner-neighbours
Open

Afloat16 wants to merge 2 commits into
petercorke:mainfrom
Afloat16:fix/manhattan-planner-neighbours

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The distance-transform metric and path connectivity are separate concerns. Restricting every Manhattan query to axial steps changes existing book-example paths. Callers need an explicit way to request four-connected paths while preserving the default behavior.

Change

  • Keep the default connectivity=8, including the existing diagonal query steps and book-example paths for both distance metrics.
  • Add connectivity=4 to restrict both the distance transform and path extraction to horizontal and vertical moves. These moves have the same cost for either metric.
  • Accept integer connectivity values of 4 or 8, reject invalid values, and expose the selected value through the connectivity property.
  • Document the default and the opt-in behavior.

Regression coverage

The tests cover axial steps and distance-map cost for connectivity=4, unchanged default diagonal paths, unreachable diagonal gaps, and invalid connectivity values. The existing book-path compatibility expectations are unchanged.

Validation

CI for current head d282e72c passes, including core tests, the Linux/macOS/Windows test matrix, mypy, coverage and the documentation build. The current head has 24 successful checks and 2 workflow-context skips.

The previously reported three path-compatibility failures occurred on 09519319, before the opt-in change. The current description and validation refer to d282e72cd7e7af645030068718ca25a8f3ffb127.

@Afloat16
Afloat16 marked this pull request as ready for review November 3, 2026 13:57
@codacy-production

codacy-production Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 6 complexity · 0 duplication

Metric Results
Complexity 6
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@Afloat16 Afloat16 changed the title fix(mobile): respect Manhattan connectivity in path queries fix(mobile): add opt-in four-connected path queries Nov 3, 2026
@Afloat16

Afloat16 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

The follow-up in d282e72c preserves the default eight-connected queries and the existing book-path expectations. Four-connected behavior is now explicit through connectivity=4, which applies to both the distance transform and path extraction.

Current-head CI passes, including the compatibility tests, platform matrix, mypy and documentation build. The title and description now reflect this opt-in behavior.

This branch has not been deployed

No deployments
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.

1 participant