Skip to content

feat(shell): create new project from the project switcher - #16

Merged
huhn511 merged 1 commit into
mainfrom
feat/create-project-in-shell
Jun 20, 2026
Merged

feat(shell): create new project from the project switcher#16
huhn511 merged 1 commit into
mainfrom
feat/create-project-in-shell

Conversation

@huhn511

@huhn511 huhn511 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

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-side createProject({ name }), which:

  1. slugifies the name → id = {slug}-{rand}
  2. PUTs {podRoot}projects/{id}/project.ttl via the privileged platform fetch, in the Projects-app vocabws:Project (dct:identifier/dct:title/ws:status/ws:startDate/ws:endDate) + an Owner ws:Membership — so the embedded Projects app reads it as owned
  3. re-enumerates workspace projects and setProject()s the new one → IframeHost re-brokers it into the running frame, no reload

Why 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.tscreateProject(opts) on ShellContextValue
  • src/lib/shell/context.tsxcreateProject impl + wired into context value
  • src/components/shell/ProjectSwitcher.tsx — dropdown item + NewProjectDialog

Verification

  • tsc --noEmit clean, npm run build green, changed files lint-clean
  • Browser end-to-end (shell :3100 + projects :3160 + local pod :3011, as alice): create "Q3 Roadmap" → PUT … 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

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>
@huhn511
huhn511 merged commit a320f8a into main Jun 20, 2026
3 checks passed
@huhn511
huhn511 deleted the feat/create-project-in-shell branch June 20, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant