Skip to content

Conversation

mfisher87
Copy link
Member

@mfisher87 mfisher87 commented Jul 11, 2025

Description

Arjun and I paired on this a bit this morning!

Resolves #811

The idea is that we'd pass in a custom icon renderer function to the UsersItem component which would handle click-to-follow behavior. Our custom function is based on the old code prior to PR #723.

I really don't know what I'm doing here 🙃 ToolbarWidget isn't a react component, so I don't know how to manage state! Perhaps we don't need to keep track of state at all, we just need to update the model and let the model keep track of it. But then, how do we display the red outline around the selected user?

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--812.org.readthedocs.build/en/812/
💡 JupyterLite preview: https://jupytergis--812.org.readthedocs.build/en/812/lite

The idea is that we'd pass in a custom icon renderer function to the
UsersItem component. Our custom function is based on the old code prior
to [PR geojupyter#723](geojupyter#723).

I really don't know what I'm doing here. ToolbarWidget isn't a react
component, so I don't know how to manage state! Perhaps we don't need to
keep track of state at all, we just need to update the model and let the
model keep track of it.

Co-authored-by: Arjun Verma <[email protected]>
Copy link
Contributor

Binder 👈 Launch a Binder on branch mfisher87/jupytergis/fix-follow

@mfisher87 mfisher87 marked this pull request as draft July 11, 2025 17:08
@mfisher87
Copy link
Member Author

cc @brichet any thoughts on how to manage state when passing in a custom icon renderer, as this class is not a react component? I'm confused :)

@mfisher87 mfisher87 added the bug Something isn't working label Jul 11, 2025
@arjxn-py
Copy link
Member

I shall be going to push a couple of commits on this branch maybe tomorrow to fix it, I hope you don't mind @mfisher87 :)

@mfisher87
Copy link
Member Author

Absolutely don't mind at all! Thanks, Arjun :) Did you figure out how to handle the state management?

@arjxn-py
Copy link
Member

Absolutely don't mind at all! Thanks, Arjun :) Did you figure out how to handle the state management?

Thanks. Yes, I moved the state management out of the component state to the custom iconRenderer. Just like i did in jupytercad - https://github.com/jupytercad/JupyterCAD/pull/766/files#diff-20d2e4da4c531d5c6a21078c739d0faef6f1d2e146c626748d362db9f19a9fd1R32

@mfisher87
Copy link
Member Author

That makes sense! Great call :D

Copy link
Contributor

github-actions bot commented Jul 15, 2025

Integration tests report: appsharing.space

@arjxn-py arjxn-py marked this pull request as ready for review July 15, 2025 10:29
@arjxn-py arjxn-py changed the title [WIP] Fix follow behavior Restore follow mode Jul 15, 2025
Copy link
Member

@martinRenou martinRenou 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 martinRenou merged commit df2751d into geojupyter:main Jul 15, 2025
14 checks passed
@mfisher87 mfisher87 deleted the fix-follow branch July 22, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RTC "follow" mode doesn't work
3 participants