Skip to content

Commit d616b3c

Browse files
authored
add molab share action (#9207)
## 📝 Summary <!-- If this PR closes any issues, list them here by number (e.g., Closes #123). Detail the specific changes made in this pull request. Explain the problem addressed and how it was resolved. If applicable, provide before and after comparisons, screenshots, or any relevant details to help reviewers understand the changes easily. --> Adds molab share action which opens up `molab.marimo.io/new#code/...` in a new tab. This is shown if either sharing option is enabled, but not shown if both are disabled. <img width="400" height="205" alt="image" src="https://github.com/user-attachments/assets/0c8a80af-585d-41a3-8d09-1a2796df4b81" /> https://github.com/user-attachments/assets/c10a116b-3c5b-46cc-ade8-bd93aade8a3e ## 📋 Pre-Review Checklist <!-- These checks need to be completed before a PR is reviewed --> - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [ ] Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it. - [x] Video or media evidence is provided for any visual changes (optional). <!-- PR is more likely to be merged if evidence is provided for changes made --> ## ✅ Merge Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] Documentation has been updated where applicable, including docstrings for API changes. - [ ] Tests have been added for the changes made.
1 parent 0a2ccf2 commit d616b3c

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

frontend/src/components/editor/actions/useNotebookActions.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,18 @@ export function useNotebookActions() {
381381
});
382382
},
383383
},
384+
{
385+
icon: <MarimoPlusIcon size={14} strokeWidth={1.5} />,
386+
label: "Create molab notebook",
387+
handle: async () => {
388+
const code = await readCode();
389+
const url = createShareableLink({
390+
code: code.contents,
391+
baseUrl: `${Constants.molab}/new`,
392+
});
393+
window.open(url, "_blank");
394+
},
395+
},
384396
],
385397
},
386398

frontend/src/core/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const Constants = {
77
discordLink: "https://marimo.io/discord?ref=notebook",
88
docsPage: "https://docs.marimo.io",
99
youtube: "https://www.youtube.com/@marimo-team",
10+
molab: "https://molab.marimo.io",
1011
};
1112

1213
export const KnownQueryParams = {

0 commit comments

Comments
 (0)