feat(shell): create new project from the project switcher - #16
Merged
Conversation
The ProjectSwitcher gains a "+ New project" item (shown when a workspace
pod is active). It opens a dialog that calls a new shell-side
`createProject({name})`, which writes `{podRoot}projects/{id}/project.ttl`
in the Projects-app vocab (ws:Project + an Owner ws:Membership), then
re-enumerates and setProject()s — IframeHost re-brokers the new project
into the running frame with no reload.
Project creation must be shell-side: the bridge scope-checks every
embedded app write to its own zone, so an iframe app can't create a
sibling project. This adds the privileged surface for it.
Verified end-to-end in the browser (shell + projects + local pod): create
→ PUT 201 → switcher/scope update → embedded Projects app renders the new
project as owned, no reload.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds a + New project item to the
ProjectSwitcher(shown when a workspace pod is active). It opens a small dialog that calls a new shell-sidecreateProject({ name }), which:id = {slug}-{rand}{podRoot}projects/{id}/project.ttlvia the privileged platform fetch, in the Projects-app vocab —ws:Project(dct:identifier/dct:title/ws:status/ws:startDate/ws:endDate) + an Ownerws:Membership— so the embedded Projects app reads it as ownedsetProject()s the new one →IframeHostre-brokers it into the running frame, no reloadWhy shell-side
The bridge scope-checks every embedded-app write to its own zone (
projects/{id}/apps/{appKey}/), so an iframe app cannot create a sibling project container. Creation is therefore a shell-side privileged operation; this PR adds that surface. The embedded Projects app has no create button; a standalone build keeps its own.Files
src/lib/shell/types.ts—createProject(opts)onShellContextValuesrc/lib/shell/context.tsx—createProjectimpl + wired into context valuesrc/components/shell/ProjectSwitcher.tsx— dropdown item +NewProjectDialogVerification
tsc --noEmitclean,npm run buildgreen, changed files lint-cleanPUT … 201→ switcher/scope update → embedded Projects app renders the new project dashboard with alice as owner (no "no access"), no frame reload. All console noise was benign empty-container 404s.🤖 Generated with Claude Code