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

Object properties panel #20

Merged
merged 8 commits into from
Jul 1, 2024
Merged

Conversation

martinRenou
Copy link
Member

@martinRenou martinRenou commented Jul 1, 2024

Screenshot from 2024-07-01 09-29-24

@martinRenou martinRenou added the enhancement New feature or request label Jul 1, 2024
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Binder 👈 Launch a Binder on branch martinRenou/jupytergis/objectprops

@martinRenou martinRenou requested a review from brichet July 1, 2024 14:09
@martinRenou martinRenou marked this pull request as ready for review July 1, 2024 14:09
Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

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

Thanks @martinRenou, LGTM

localState &&
localState.selected?.emitter &&
localState.selected.emitter !== this.state.id &&
localState.selected?.value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't the selected value be undefined if there is no selection ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it can, do you have a concern about this if condition?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I might be missing something, but my understanding is:
localState.selected?.value is undefined -> newState is not updated -> the setState is not triggered -> the panel is not updated
But we probably want to update it to an empty panel since there is no selection.

@@ -45,7 +45,13 @@ export interface IJGISSourceDocChange {
}>;
}

export interface ISelection {
type: 'layer' | 'source';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you think of use cases where we can select both layers and sources?

Copy link
Member Author

@martinRenou martinRenou Jul 1, 2024

Choose a reason for hiding this comment

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

You mean selecting both layers and sources at the same time?

Actually I think I'm not using the type entry anymore in my implementation, I can remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You mean selecting both layers and sources at the same time?

Yes, this is what I meant.
We will probably want to be able to select several sources or several layers (to delete them, or maybe update properties).
But I don't know if we want to select layers and sources at the same time, this is why I wonder if this type is need.

Copy link
Member Author

Choose a reason for hiding this comment

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

This entry was just some metadata information on the selection (we could add more metadata if we want in the future), but we can already infer from the id of the selected object if it's a layer or a source. So I should probably remove it.

So technically my code allows selecting both layers and sources at the same time. We'll see if we actually need this if we have use cases.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks for the clarification

@brichet brichet merged commit 1bd72af into geojupyter:main Jul 1, 2024
9 checks passed
@martinRenou martinRenou deleted the objectprops branch July 2, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants