feat(playground): add lifecycle actions for One playgrounds - #840
Open
johnleider wants to merge 3 commits into
Open
feat(playground): add lifecycle actions for One playgrounds#840johnleider wants to merge 3 commits into
johnleider wants to merge 3 commits into
Conversation
- Add owner tracking and isOwner computed to useOnePlaygrounds - Add patchMeta for partial meta updates (favorite/pinned/locked/visibility) - Add destroy for DELETE with favorite/locked guards - Add fork for creating owned copy of non-owned playgrounds - Add visibility control to save dialog for initial create - Add lifecycle actions to File menu: visibility, favorite, pin, lock, delete (owner); fork (non-owner) - Register icons: star, pin, lock, eye-off, delete, fork Fixes #828
API returns owner: { id: string } not userId. Update:
- OnePlayground interface to use owner?: { id: string }
- remember() to use playground.owner?.id
- usePlaygroundFiles setCurrent to pass owner when loading from route
- VuetifyPlayground type to include owner field
- openSaved in Open dialog to pass owner
Also verified:
- clearCurrent + navigateToRoot preserves REPL content/hash
- patchMeta only sends meta fields, not content
johnleider
marked this pull request as ready for review
August 12, 2026 23:55
Replace File-menu native buttons and the homemade autosave switch with Button.Root / Switch. Confirm timers use useTimer (3s, one-shot) and stop when the menu closes. Save-dialog visibility uses Button.Group. useOnePlaygrounds compares with isUndefined / isNullOrUndefined.
johnleider
added a commit
that referenced
this pull request
Aug 13, 2026
Replace the AGENTS.md inventory dump with a v0-vs-native/homemade if/then (file stays under 10k). Point at SKILL.md, PHILOSOPHY.md, and .claude/rules/. Skill description now fires on native button, homemade timer, and homemade overlay so the #840 misses load it.
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.
Summary
Implements playground lifecycle actions (favorite/pinned/locked/visibility/delete/fork) for v0play, enabling owners to manage their saved playgrounds and non-owners to fork public playgrounds.
Fixes #828
Changes
Composable API (
useOnePlaygrounds.ts)New exports:
currentMeta- reactive state for favorite/pinned/locked/visibilitycurrentOwner- owner user ID from API responsesisOwner- computed that compares current user to ownerpatchMeta({ favorite?, pinned?, locked?, visibility?, title? })- partial POST for meta-only updatesdestroy()- DELETE with guards (throws if favorite or locked)fork(getContent)- create owned copy with defaults, navigate to new playgroundUpdated:
create()now accepts{ visibility }optionsave()passes visibility through to createUI
Save Dialog (
PlaygroundSaveDialog.vue):File Menu (
PlaygroundMenuBar.vue):Icons (
icons.ts):star,star-outline,pin,pin-outline,lock,lock-open,visibility-public,visibility-private,delete,forkAPI Notes
Testing Checklist