-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: notebooks sharing step 1 #16415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of comments. Main thing is a little confusion / conflation around when a notebook is being shared versus the state when the share modal is open
!notebook?.is_template && { | ||
label: 'Share', | ||
onClick: () => { | ||
push(urls.notebookShare(notebookId)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing we use the push
method here to avoid actually setting the notebook into NotebookMode.Share
via the setNotebookMode
method as is done for View / Edit toggles:
posthog/frontend/src/scenes/notebooks/NotebookScene.tsx
Lines 131 to 143 in 04c54dd
{!editEnabled ? null : mode === NotebookMode.Edit ? ( | |
<> | |
<LemonButton type="primary" onClick={() => setNotebookMode(NotebookMode.View)}> | |
Done | |
</LemonButton> | |
</> | |
) : ( | |
<> | |
<LemonButton type="primary" onClick={() => setNotebookMode(NotebookMode.Edit)}> | |
Edit | |
</LemonButton> | |
</> | |
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the URL to open the modal is only to keep the mechanism the same between the different types of shareable thing. With the added bonus that it's nice for states to be addressable -> "You can click this link if you want to stop sharing that notebook"
have introduced a bug where when we render the notebooks sometimes we get an error... (reproducible by pinning to side or opening in full pane)
|
maybe fixed here in next release :'( ueberdosis/tiptap#4000 |
I can reproduce this on master so I'd imagine it isn't related to your changes. Looks like ueberdosis/tiptap#3764 (comment) might fix it in the meantime |
Ah, thanks for checking @daibhin I checked briefly and couldn't but maybe my machine is in a weird state 🤔 |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant. |
not so fast posthog-bot |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant. |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
we'll come back to this |
Problem
Notebooks are the best, except for one thing, you can't use them as a simple blog...
Changes
This definitely isn't finished but is already a meaty PR
How did you test this code?
some developer tests, some 👀 locally
./bin/tests -vv --lf posthog/models/test/test_exported_asset_model.py posthog/api/test/test_exports.py posthog/api/test/test_sharing.py posthog/tasks/exports/test/test_image_exporter.py posthog/api/test/notebooks/test_notebook.py