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

Add suggestion panel #579

Merged
merged 4 commits into from
Dec 2, 2024
Merged

Add suggestion panel #579

merged 4 commits into from
Dec 2, 2024

Conversation

trungleduc
Copy link
Member

@trungleduc trungleduc commented Nov 12, 2024

User-facing changes

  • New suggestion section in the right panel
  • Split view mode in the 3D view to compare the original model with the suggested one.
suggestion.mp4

@trungleduc
Copy link
Member Author

This PR can be tested at https://huggingface.co/spaces/trungleduc/jupytercad-dev. It's ready for reviewing but still need the release of the backend part in jupyter-collaboration (https://github.com/jupyterlab/jupyter-collaboration/tree/suggestions)

@trungleduc trungleduc marked this pull request as ready for review November 18, 2024 12:20
Copy link
Contributor

github-actions bot commented Nov 29, 2024

Integration tests report: appsharing.space

Copy link
Contributor

github-actions bot commented Nov 29, 2024

Preview PR at appsharing.space

@trungleduc
Copy link
Member Author

please update snapshots

@trungleduc trungleduc closed this Nov 30, 2024
@trungleduc trungleduc reopened this Nov 30, 2024
@SylvainCorlay
Copy link
Member

🎉

Copy link
Member

@arjxn-py arjxn-py left a comment

Choose a reason for hiding this comment

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

This is so awesome 🎉 🚀

@trungleduc
Copy link
Member Author

This PR is ready, this suggestion panel is hidden if the fork feature is unavailable. I will add UI tests later once jupyter-collaboration 3.1 is released

}

.jpcad-control-panel-suggestion.selected {
background-color: rgba(0, 122, 255, 0.23);
Copy link
Member

Choose a reason for hiding this comment

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

We should use more CSS variables in this file. The CSS will look off for custom themes.

this._sceneL.add(new THREE.AmbientLight(0xffffff, 0.5)); // soft white light
const light = new THREE.HemisphereLight(0xffffff, 0x444444, 0.5);
this._sceneL.add(light);
this._sceneL.add(this._meshGroup.clone(true));
Copy link
Member

Choose a reason for hiding this comment

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

So you start from a clone of meshGroup here. But can you explain how it works when the user e.g. creates a new box in the suggestion? I understand the two scenes share the same OCC worker?

What I'm confused about is I don't see where the magic split happens on the creation of the new meshGroup for suggestions.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, the scene on the left has nothing to do with the OCC worker, it is just a snapshot of the current mesh at the time of checking out. The scene on the right is connected to the forked y-document and it works just like a normal 3D view.

This is why it isn't very easy to get back to the original document from a forked one since the forked y-doc in the frontend will propagate changes back to the original doc in the backend.

Copy link
Member

Choose a reason for hiding this comment

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

Ok got it.

So the sceneL is not connected to the original document anymore, meaning if another collaborator changes the base document without making a suggestion, it is not reflected in sceneL unless they refresh the page. We may consider this as a bug? Happy to merge the PR as is anyway and we can iterate upon.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updating the left scene in real-time necessitates connecting to the 2 documents at the same time, I might think about it after the notebook suggestion adventure.

@martinRenou martinRenou self-requested a review December 2, 2024 09:16
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.

I did not mean to approve the PR, actually suggesting changes

Co-authored-by: martinRenou <martin.renou@gmail.com>
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.

Amazing work! Thanks!

@martinRenou martinRenou merged commit 2a95faa into jupytercad:main Dec 2, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New Feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants