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

Users item toolbar #379

Merged
merged 8 commits into from
Dec 10, 2024
Merged

Conversation

brichet
Copy link
Contributor

@brichet brichet commented Oct 21, 2024

Copy of #378, to try to fix the check_release workflow.

This PR provides a widget that can be used in a collaborative document to display current users.

This widget is a refactoring of a widget initially created in jupyterCAD.
Porting it to jupyter_collaboration has been initially discussed in jupytercad/JupyterCAD#496.

EDIT:

If the widget is integrated to a notebook for example, it looks like:
image

Code for the notebook widget (in Jupyterlab)

The Notebook is a special case because the document model can be null when first displayed. We need to handle the modelChange event.

  • packages/notebook-extension/src/index.ts

      toolbarRegistry.addFactory<NotebookPanel>(FACTORY, 'usersItem', panel => {
        const container = new Panel();
        const onModelChanged = () => {
          container.widgets.forEach(w => container.layout?.removeWidget(w));
          container.addWidget(UsersItem.createWidget({ model: panel.model }));
        }
        onModelChanged();
        panel.content.modelChanged.connect(onModelChanged);
        return container;
      });
  • packages/notebook-extension/schema/panel.json

     {
       "name": "usersItem",
       "rank": 1005
     }

Copy link
Contributor

Binder 👈 Launch a Binder on branch brichet/jupyter_collaboration/users_item_toolbar

@brichet brichet added the enhancement New feature or request label Oct 21, 2024
@@ -0,0 +1,192 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

Is docprovider the right place for this, or should be in the collaboration package?

Copy link
Contributor Author

@brichet brichet Oct 21, 2024

Choose a reason for hiding this comment

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

I asked myself the same question, and I put it here because it is really a document related widget, it supposed to handle the document current collaborators.
But I don't have a strong opinion on it, and can move it to collaboration.

Copy link
Member

Choose a reason for hiding this comment

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

Ok! I wouldn't know. Maybe @davidbrochart has an opinion on it.

Copy link
Member

@krassowski krassowski Oct 21, 2024

Choose a reason for hiding this comment

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

I would say that we should think about docprovider as enabling to use ydoc without collaboration, so anything which is collaboration-specific should go to collaboration unless it is impractical.

@jtpio
Copy link
Member

jtpio commented Oct 21, 2024

Should this be merged now while jupyter-collaboration is currently in RC, with 3.0.0 final to be released in the coming days?

Or should this be part of a 3.1.0 release, since it's more of a new feature?

@brichet
Copy link
Contributor Author

brichet commented Oct 21, 2024

Should this be merged now while jupyter-collaboration is currently in RC, with 3.0.0 final to be released in the coming days?

Or should this be part of a 3.1.0 release, since it's more of a new feature?

Right, we should probably wait for the next release.

@jtpio
Copy link
Member

jtpio commented Oct 22, 2024

Looks like this repo does not make active use of GitHub milestones, but it could be useful to start using them to track such issues and improvements.

I just created the following two milestones:

Feel free to move it back to the 3.0.x if you think this should be released sooner.

@jtpio jtpio added this to the 3.1.0 milestone Oct 22, 2024
@jtpio
Copy link
Member

jtpio commented Oct 22, 2024

btw @brichet if you have a screenshot / screencast around that could be posted in the description that would be really useful, thanks! (and we could also add it to the changelog when releasing this)

@brichet
Copy link
Contributor Author

brichet commented Oct 22, 2024

btw @brichet if you have a screenshot / screencast around that could be posted in the description that would be really useful, thanks! (and we could also add it to the changelog when releasing this)

Thanks, that helped me to finish this PR, I had only tested it with jupyter-collaboration v2 and forgot to copy the styles in there.

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!

@brichet brichet force-pushed the users_item_toolbar branch from 14f42cb to e1c28ad Compare December 9, 2024 16:29
@brichet
Copy link
Contributor Author

brichet commented Dec 9, 2024

Should we merge this PR, since we are currently in a RC release ?
It was supposed to be in 3.1.0: https://github.com/jupyterlab/jupyter-collaboration/milestone/3

@davidbrochart
Copy link
Collaborator

We can release v3.1.0 and then merge this PR, what do you think?

@brichet
Copy link
Contributor Author

brichet commented Dec 10, 2024

We can release v3.1.0 and then merge this PR, what do you think?

Make sense, then we can probably release a 3.1.1, since this PR simply provide a new widget.

@martinRenou
Copy link
Member

If we're strictly following semver, that should be a 3.2.0

@davidbrochart
Copy link
Collaborator

I don't mind having this PR in v3.2.0, but I think the release cycle is a bit overkill here (releasing alphas, betas, RCs...).
@krassowski what do you think about changing the releaser so that we can directly bump a minor version, without going through the full release cycle?

@martinRenou
Copy link
Member

You should be able to run prep-release with 3.1.0 instead of next if you want to directly release 3.1.0?

@davidbrochart
Copy link
Collaborator

No, see the scheme to bump the version:

def increment_version(current, spec):
curr = parse_version(current)
if spec == "major":
spec = f"{curr.major + 1}.0.0.a0"
elif spec == "minor":
spec = f"{curr.major}.{curr.minor + 1}.0.a0"
elif spec == "release":
p, x = curr.pre
if p == "a":
p = "b"
elif p == "b":
p = "rc"
elif p == "rc":
p = None
suffix = f"{p}0" if p else ""
spec = f"{curr.major}.{curr.minor}.{curr.micro}{suffix}"
elif spec == "next":
spec = f"{curr.major}.{curr.minor}."
if curr.pre:
p, x = curr.pre
spec += f"{curr.micro}{p}{x + 1}"
else:
spec += f"{curr.micro + 1}"
elif spec == "patch":
spec = f"{curr.major}.{curr.minor}."
if curr.pre:
spec += f"{curr.micro}"
else:
spec += f"{curr.micro + 1}"
else:
raise ValueError("Unknown version spec")
return spec

@martinRenou
Copy link
Member

Ok, it seems I'm used to releasing jupytercad which does what I said: https://github.com/jupytercad/JupyterCAD/blob/main/python/jupytercad/scripts/bump-version.py#L49

@krassowski
Copy link
Member

If there is a self-contained addition which warrants minor bump but not much else I am in favour of skipping some of the pre-release stages and e.g. going straight to RC (while bumping the minor) over just bumping the patch version.

@davidbrochart
Copy link
Collaborator

In the meantime, I think we can release v3.1.0, if everybody agrees.

@davidbrochart
Copy link
Collaborator

Sorry @brichet, but could you rebase one more time?

@davidbrochart
Copy link
Collaborator

Tests on Ubuntu all fail in main too 👀

@davidbrochart
Copy link
Collaborator

I cannot reproduce locally on my Debian.

@brichet
Copy link
Contributor Author

brichet commented Dec 10, 2024

Me neither on Ubuntu

Copy link
Collaborator

@davidbrochart davidbrochart left a comment

Choose a reason for hiding this comment

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

Let's merge and address the CI issue on Ubuntu separately.
Thanks @brichet.

@davidbrochart davidbrochart merged commit 22a505b into jupyterlab:main Dec 10, 2024
22 of 27 checks passed
@martinRenou martinRenou deleted the users_item_toolbar branch December 10, 2024 14:53
@jtpio
Copy link
Member

jtpio commented Dec 11, 2024

In the meantime, I think we can release v3.1.0, if everybody agrees.

FYI @davidbrochart next time when making a final release, you can check the following box when triggering the workflow

image

Otherwise the release does not show any merged PR, which is misleading: https://github.com/jupyterlab/jupyter-collaboration/releases/tag/v3.1.0

image

@davidbrochart
Copy link
Collaborator

davidbrochart commented Dec 12, 2024

Right, I forgot about that. I'm wondering if it should not be checked by default.

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.

5 participants