Skip to content

Add folder share via link - #141

Merged
MUFFANUJ merged 21 commits into
jupyterlab:mainfrom
MUFFANUJ:addFolderSharing
Apr 20, 2026
Merged

Add folder share via link#141
MUFFANUJ merged 21 commits into
jupyterlab:mainfrom
MUFFANUJ:addFolderSharing

Conversation

@MUFFANUJ

@MUFFANUJ MUFFANUJ commented Apr 3, 2026

Copy link
Copy Markdown
Member

closes #132

This update expands share-via-link so users can share both single files and entire folders directly from Plugin Playground. Sharing now works from the editor flow and from file browser right-click actions for both files and folders. Folder sharing includes a guided selection experience when content is too large, so users can choose which files to include and still generate a shareable link.

@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Preview environments for this pull request:

Preview Lab Notebook v7
Binder Binder Binder Notebook v7
JupyterLite JupyterLite JupyterLite Notebook v7

@MUFFANUJ MUFFANUJ added the enhancement New feature or request label Apr 3, 2026
@MUFFANUJ

MUFFANUJ commented Apr 3, 2026

Copy link
Copy Markdown
Member Author

I was thinking, should we have a show checkboxes dialog always when exporting the folder, or should there be a setting to ask that (show dialog on export something similar false by default), because maybe users might have some files they don't want to include, and in current mindset, they would still share it and dont have a way to exclude it

@krassowski

Copy link
Copy Markdown
Member

should we have a show checkboxes dialog always when exporting the folder

Always by default sounds good to me

should there be a setting to ask that (show dialog on export something similar false by default

Yes, it could be more complex, see below

because maybe users might have some files they don't want to include,

yes, or they may want to include some files that the heuristic would exclude (say .svg for icons, though maybe this should be included by default; maybe .png is more reasonable example, that should be excluded most of the time, but there are legitimate cases when extensions may want to include it)

My current thinking would be, let's add a setting "Show file selection dialog on export" with options:

  • Always
  • When any file would be auto-excluded or if the size limit is hit
  • When size limit is hit

Then, to make sure this is discoverable we could default to "Always" but in the dialog we could add checkbox like:

[ ] Do not ask me again if all files can be included

@MUFFANUJ
MUFFANUJ marked this pull request as draft April 7, 2026 23:01
@MUFFANUJ

MUFFANUJ commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

yes, or they may want to include some files that the heuristic would exclude (say .svg for icons, though maybe this should be included by default; maybe .png is more reasonable example, that should be excluded most of the time, but there are legitimate cases when extensions may want to include it)

For this, should we have a section in the dialog itself to show the auto-excluded files, and a person could include the file if they need to from there? ( across all three of setting )

@MUFFANUJ
MUFFANUJ marked this pull request as ready for review April 8, 2026 11:56
@MUFFANUJ
MUFFANUJ requested a review from krassowski April 8, 2026 11:56
@krassowski

Copy link
Copy Markdown
Member

For this, should we have a section in the dialog itself to show the auto-excluded files, and a person could include the file if they need to from there? ( across all three of setting )

Yes I think so.

@MUFFANUJ

MUFFANUJ commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

Yes I think so.

i have included them in the latest commit

@krassowski

Copy link
Copy Markdown
Member

UX wise I am concerned about discoverability of the share folder option. I wonder if we should make the share button a dropdown:

  • Share single file (default)
  • Share package (if package.json was found in the directory where the file is located or in its parent directory, otherwise it could be greyed out)

@MUFFANUJ

MUFFANUJ commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

UX wise I am concerned about discoverability of the share folder option. I wonder if we should make the share button a dropdown:

  • Share single file (default)
  • Share package (if package.json was found in the directory where the file is located or in its parent directory, otherwise it could be greyed out)

Should we keep this in addition to the current implementation, or just this? maybe having both could make sense

@krassowski

Copy link
Copy Markdown
Member

Having it in context menu too is fine

Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Expands “share via link” to support sharing entire folders (packages) in addition to single files, including a file-selection dialog when needed and UI entry points from both the editor toolbar and file browser context menu.

Changes:

  • Add folder-based share payload encoding/decoding and restore logic for multi-file shares.
  • Introduce a folder file-selection dialog with auto-exclusion rules and a new setting to control when the dialog appears.
  • Add editor toolbar share dropdown + file browser context menu integration, with updated UI tests and styling.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ui-tests/tests/plugin-playground.spec.ts Adds UI coverage for file/folder sharing flows, dialog behavior, and toolbar/context menu actions.
style/base.css Styles the new share dropdown button/caret and folder share selection dialog layout.
src/share-via-link-utils.ts Implements folder share candidate filtering, payload building, and file-selection dialog UX.
src/share-link.ts Extends share token format to support folder payloads and adds size-limit error classification.
src/index.ts Wires folder sharing into the command, adds toolbar dropdown + context menu resolution, and restores shared folders from URL.
schema/plugin.json Adds a new setting for dialog behavior and context menu entries for files/folders.
README.md Updates command API docs and behavior notes to cover folder sharing and dialog modes.
package.json Moves @jupyterlab/filebrowser into dependencies (runtime usage).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
@MUFFANUJ

Copy link
Copy Markdown
Member Author

I'm planning for #152 to merge first since i introduced a new reusable component in there which would use here as well. https://github.com/jupyterlab/plugin-playground/pull/152/changes#diff-aaa7ba8da56b0390dea21df0f8d1c641de85d8754864ada8948888a94fcb7990 ( for split action since we are using the dropdown action in multiple places now - command insertion , export , sharing )

@MUFFANUJ

Copy link
Copy Markdown
Member Author

Show available space and auto-select files are included in this PR for #169

@krassowski

Copy link
Copy Markdown
Member

^picked up a conflict

Comment thread README.md Outdated
@krassowski

Copy link
Copy Markdown
Member

Hmm it looks like the limit for readthedocs is just short of 4100 characters (I get the same on Chromium browsers and Firefox):

image

rather than 8000

image

in the future we could try hosting this elsewhere, but for now would it make sense to adjust the numbers we assume?

I guess we could also de-select the Python files by default, since these are not used in playground?

@MUFFANUJ

Copy link
Copy Markdown
Member Author

Yes sure!

@krassowski krassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I find it a bit confusing that clicking on a dropdown option on export changes action but does not invoke it, but dropdown options on share invokes action but I guess we can discuss this in #177 once this gets merged.

Comment thread src/share-via-link-utils.tsx
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/share-link.ts Outdated
Comment thread src/share-link.ts
Comment thread src/share-via-link-controller.ts Outdated
Comment thread style/base.css Outdated
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/share-via-link-utils.tsx
Comment thread ui-tests/tests/plugin-playground.spec.ts
Comment thread src/share-link.ts

@krassowski krassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@MUFFANUJ

Copy link
Copy Markdown
Member Author

One last change to make is to change the character count to be a percentage since it's easier to understand for new user than trying to understand what the URL count means here.

@MUFFANUJ
MUFFANUJ merged commit 21968db into jupyterlab:main Apr 20, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in CFP '25 tracking Apr 20, 2026
@MUFFANUJ
MUFFANUJ deleted the addFolderSharing branch April 20, 2026 12:21
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

Status: Done

Development

Successfully merging this pull request may close these issues.

Add folder sharing support

3 participants