Skip to content
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

Shatter tool #142

Merged
merged 12 commits into from
Oct 25, 2024
Merged

Shatter tool #142

merged 12 commits into from
Oct 25, 2024

Conversation

raphaellaude
Copy link
Collaborator

@raphaellaude raphaellaude commented Oct 22, 2024

Description

Reviewers

Checklist

  • Added/Updated related documentation (if applicable).
  • Added/Updated related unit tests (if applicable).

Screenshots (if applicable):

Copy link
Collaborator

@nofurtherinformation nofurtherinformation left a comment

Choose a reason for hiding this comment

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

Two small suggestions here but otherwise looks good!

I think having the cursor properties be in the component makes more sense than in the subscriptions, since modifying CSS is a bit less tricky than the maplibre rendering operations.

Also, if we can add a hover state while using the shatter tool on mouse move that would be ideal!

@@ -91,10 +95,38 @@ export const getRenderSubscriptions = (useMapStore: typeof _useMapStore) => {
{ equalityFn: shallowCompareArray },
);

const _updateMapCursor = useMapStore.subscribe<MapStore["activeTool"]>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

PP: This could also be in the map component and use tailwind cursor-x properties

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like this suggestions but I'm sort of in a hurry so created new issue #145 so we can do this later

@@ -57,6 +58,12 @@ export const handleMapClick = (
SelectZoneAssignmentFeatures(mapStore);
});
}
} else if (activeTool === "shatter") {
const documentId = mapStore.mapDocument?.document_id;
const featureId = e.features?.[0].id?.toString();
Copy link
Collaborator

Choose a reason for hiding this comment

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

PP: Highlight on mouse move? Eg. Select features, mapStore.setHoveredFeatures(features[0])

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

Copy link
Collaborator

@nofurtherinformation nofurtherinformation left a comment

Choose a reason for hiding this comment

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

Looks good to me. @mariogiampieri ?

mariogiampieri
mariogiampieri previously approved these changes Oct 25, 2024
Copy link
Collaborator

@mariogiampieri mariogiampieri left a comment

Choose a reason for hiding this comment

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

looks great

@raphaellaude raphaellaude dismissed mariogiampieri’s stale review October 25, 2024 04:15

The merge-base changed after approval.

@raphaellaude raphaellaude merged commit 2c0a75d into main Oct 25, 2024
2 checks passed
@raphaellaude raphaellaude deleted the shatter-tool branch October 25, 2024 04:43
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.

Add shatter tool
3 participants