Add public and private notebooks - #235
Merged
Merged
Conversation
Notebooks move from users/{uid}/notebooks/{id} to a top-level
notebooks/{id} collection with an owner and a visibility, so a public
notebook can be opened by anyone with its link. New notebooks are
private.
- Owners can toggle a notebook between private and public from the
editor toolbar. Making it public copies the link.
- Others can view, run, and edit a public notebook locally, but can't
save it. They can duplicate it into their own account.
- Existing notebooks are moved to the new collection as private on
login, then deleted from the old location.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying the new rules before the new code would otherwise stop the live site from saving. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A notebook edited on the old site after being migrated was deleted from the old location without copying the newer edits. Copy an old notebook when it's newer than the migrated one, keeping its visibility. - Validate visibility in the rules and share the owner check. - Share the ownership check in the editor, and reset the "Link copied" label when visibility changes again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each notebook can now be public or private. Anyone with the link can open a public notebook. New notebooks are private.
Database
Notebooks move from
users/{uid}/notebooks/{id}to a top-levelnotebooks/{id}collection, so a link can find a notebook without knowing its owner. Each document now hasownerIdandvisibility.The Firestore rules:
ownerIdfrom changing.Listing your notebooks now filters by
ownerIdand sorts on the client, so no composite index is needed.Migration
When a user logs in, their notebooks in the old location are copied to
notebooks/{id}as private, then deleted from the old location. Notebooks that were already moved are never overwritten, so a failed run just retries on the next login.UI
Deploying
The rules are already deployed to
recho-dev. They still allow the old location, so the live site keeps working until this is merged. Once everyone has migrated, the old location's rule can be removed.Test plan
next buildpass🤖 Generated with Claude Code