Skip to content

New folder in the shared folder picker (desktop, iOS, Android) - #5252

Open
DoodleBears wants to merge 2 commits into
codex/4935-new-folder-permissionfrom
claude/4935-new-folder-ui
Open

DoodleBears wants to merge 2 commits into
codex/4935-new-folder-permissionfrom
claude/4935-new-folder-ui

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Why the change

Creating a Workspace folder needed a trip to a terminal or Finder; the folder picker now creates one in place, on every platform where it is used.

Issue / Discussion: Refs #4935 (UI half; the Host/CLI half is #5241, which this PR stacks on — together they cover the issue's acceptance criteria; retarget to main after #5241 merges).

Harness / Model

Harness: Claude Code
Model: claude-opus-5-5

Special things to note

  • Merge risk: two-way door — UI only, no storage or protocol change; revert removes the New folder row/button. Blast radius: the three folder-picker surfaces (New Session, Bot Workspace grants, Bot folder-request card) on mobile and the shared desktop FolderBrowser. Review focus: NewFolderPage / NewFolderForm, the permission hooks (useCreateFolder on both clients) and packages/host-client/src/new-folder.ts.
  • Verification: automated — host-client new-folder.test.ts 10 ✓, mobile folder-picker-new-folder.test.tsx 10 ✓ and member-folder-creation.test.tsx 3 ✓, client folder-browser-new-folder.test.ts 10 ✓; affected client + host-client suites 29 files / 361 tests ✓; mobile full suite 549 files ✓ with 6 pre-existing __DEV__ is not defined failures that also fail on the Create and register Host folders within Team permissions #5241 base; pnpm lint, root and mobile typecheck ✓. Runtime — real isolated DSH Host: iOS Simulator drove all three entry points end to end (Workspaces registered, two Grants created, request card resolved), desktop Web Client drove grants with refusal and confirmation; Team role editor shows "Create folders in granted folders". Not run: Android (no SDK on this Mac), member-account UI session, AX5 navigation inside the picker list (see below), Human QA.
  • Fix PRs: n/a (feature).
  • Design review: object (the folder being browsed, shown as Location), state (inline name error / Host refusal under the field, busy Create) and next action (Create / Back) are visible on one page inside the existing sheet; no extra descriptions beyond the location line. Checked Light + Dark on iOS (Chinese) and desktop (English); zh/en copy both added.
  • CI test plan: plan tests job pending at writing time; no new config, test directory or repo-file-reading test added.

Change outline

New folder in the shared folder picker on iOS, Android and desktop. It creates one child of the folder being browsed through createHostFolder (#5241), and the registered Workspace is selected right away.

 packages/host-client/src/
+└── new-folder.ts            # name check (one segment, no / \ .. NUL, ≤255), Host refusal → message key, canCreateFolders(viewer)

 apps/mobile (one sheet, one stack — creation is a page inside the existing sheet)
 <FolderPickerSheet port={…, createFolder?}>      # New Session + Bot folder-request card
+  row "New folder" → <NewFolderPage>             # src/ui/chat/new-folder-page.tsx
 <WorkspaceSheet createFolder?>                    # Bot Workspace grants
+  mode 'new-folder' → <NewFolderPage>
+useCreateFolder(client)                           # src/host/member-permissions.ts

 packages/client (desktop)
 <FolderBrowser>                                   # grants entry ×2 + grant-request card
+  useCreateFolder(actions)  → <NewFolderButton> / <NewFolderForm>   # workspace-new-folder.tsx
+actions.createHostFolder(parent, name)
create(name)
  if name is not one segment → inline error, no Host call
  workspace = createHostFolder({ parent: browsed folder, name })
    refused → inline: already exists | outside your folders | Host can't write | ask the Owner
  New Session      → pick { path, title, workspaceId }
  grants / request → existing confirm step with the new Workspace

Who sees it: the Owner always; a member only with the workspaces.createFolder Host Permission (mobile tracks it with the existing member permission refresh; desktop reads teamMode.viewer). The Host still enforces it.

Evidence

Real isolated DSH Host (verify-app instance, launched with an SSH marker so DSH serves the in-app folder browser instead of the macOS chooser). iPhone 18 Pro Simulator (iOS 27.2) through T3 Device, Debug dev client, JS from this branch vs the #5241 head (3d569b96b). Fixture folders live in /tmp/tobs-qa. Black bars hide the "registered folders" rows (they include a path with the Mac account name). App locale is Chinese.

iOS — New Session

Before · Light Before · Dark Picker · Light Picker · Dark Created and selected · Light Created and selected · Dark
Before New Session Light
Before New Session Light
Before New Session Dark
Before New Session Dark
After Picker Light
After Picker Light
After Picker Dark
After Picker Dark
After Created and selected Light
After Created and selected Light
After Created and selected Dark
After Created and selected Dark

iOS — Bot Workspace grants

Before · Light Before · Dark Picker · Light Picker · Dark Name · Light Name · Dark Selected → confirm · Light Selected → confirm · Dark
Before Bot Workspace grants Light
Before Bot Workspace grants Light
Before Bot Workspace grants Dark
Before Bot Workspace grants Dark
After Picker Light
After Picker Light
After Picker Dark
After Picker Dark
After Name Light
After Name Light
After Name Dark
After Name Dark
After Selected → confirm Light
After Selected → confirm Light
After Selected → confirm Dark
After Selected → confirm Dark

After: separator refused before the Host call · Light
After: separator refused before the Host call · Light

iOS — Bot folder-request card

Before · Light Before · Dark Picker · Light Picker · Dark Host refusal inline · Light Host refusal inline · Dark Selected → allow · Light Selected → allow · Dark
Before Bot folder-request card Light
Before Bot folder-request card Light
Before Bot folder-request card Dark
Before Bot folder-request card Dark
After Picker Light
After Picker Light
After Picker Dark
After Picker Dark
After Host refusal inline Light
After Host refusal inline Light
After Host refusal inline Dark
After Host refusal inline Dark
After Selected → allow Light
After Selected → allow Light
After Selected → allow Dark
After Selected → allow Dark

Canonical state after the iOS run (Host CLI / /api):

workspaceOptions → "Budget", "Launch Plan", "Research Drafts" registered
grants <Ada>     → Budget (from Workspace grants), Research Drafts (from the request card)
card line        → 文件夹授权 · 已允许读写 · Research Drafts
filesystem       → /tmp/tobs-qa/home/Projects/{Budget, Launch Plan, Research Drafts}

Desktop (Web Client)

Light Dark
Before Before desktop Light
Before desktop Light
Before desktop Dark
Before desktop Dark
After: picker After desktop picker Light
After desktop picker Light
After desktop picker Dark
After desktop picker Dark
After: name After desktop name Light
After desktop name Light
After desktop name Dark
After desktop name Dark
After: already exists After desktop refusal Light
After desktop refusal Light
After desktop refusal Dark
After desktop refusal Dark
After: created → confirm After desktop selected Light
After desktop selected Light
After desktop selected Dark
After desktop selected Dark

Team role editor renders the new permission from #5241: checkbox "Create folders in granted folders" (ARIA of the New role dialog).

Tests (written first)

host-client  new-folder.test.ts                10 ✓  name rules, refusal codes, Owner/member visibility
mobile       folder-picker-new-folder.test.tsx 10 ✓  create+select in New Session / grants / request card,
                                                    separator & traversal refused before the Host,
                                                    4 Host refusals inline (name kept), hidden without permission, Back
mobile       member-folder-creation.test.tsx    3 ✓  Owner yes; member hidden until permission known; member without it hidden
client       folder-browser-new-folder.test.ts 10 ✓  same flow on desktop + member with/without permission

Native QA not captured

  • Android: no Android SDK on this Mac. Covered by the shared render tests above (same components; Android gets the create_new_folder Material Symbol drawable, generated by scripts/material-symbol-drawable.mjs). Needs a run on the Linux/Windows QA lane.
  • System text sizes: default (Large) captured Light + Dark above. Intermediate not captured. At maximum (AX5) the New folder page reuses TextField/SheetActions (actions stack at large text), but the picker's existing list area is only ~100pt tall and could not be scrolled through the driver — identical on Before, so AX5 is unverified here.
  • Member path in the UI: member visibility is covered by unit tests; Host-side enforcement is Create and register Host folders within Team permissions #5241's M15 B6.

🤖 Generated with Claude Code

DoodleBears and others added 2 commits November 25, 2026 07:55
Refs #4935

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…older page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 2 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Product Terms Follow The Glossary Warning The check fails on two product-noun uses in the PR description that match Avoid words in GLOSSARY.md. Other added copy passes. 1. Host, avoid "instance". The PR description says "Real isolated D… Edit the PR description, not the code: 1. Replace "DSH Host (verify-app instance, …)" with "DSH Host (verify-app Host, …)" or another phrase that uses the term Host. 2. Replace "member-account UI session" with "Host Member UI sessio…
Touched Features Are Verified Warning Summary: Four feature files map to changed runtime files in this PR. The PR range is 3d569b9..4eb3d38 (the #5241 head is the base). Three of the four lack a named journey run or a stated reason for … For each of these features, either name a run of its journey or state a specific reason it was not run in the PR verification notes: - phone-sessions-navigation (new-session-screen.tsx): run the Sessions navigation journey on the shared d…
Passed Passed checks: 2 passed

Check name Status Explanation
Fix Targets The Root Cause Passed The check applies only when the PR title starts with "fix". The contributor's title is "New folder in the shared folder picker (desktop, iOS, Android)", which does not start with "fix". The check is t…
Consistent With Adrs And Existing Features Passed The PR adds behaviour: a New folder action in the shared folder picker (iOS, Android, desktop). The check therefore applies. I found no failure condition. ADR contradiction: none found. - docs/adr/ ho…
Full details: Fix Targets The Root Cause

Explanation

The check applies only when the PR title starts with "fix". The contributor's title is "New folder in the shared folder picker (desktop, iOS, Android)", which does not start with "fix". The check is therefore inapplicable, and it passes by its own terms. The PR adds a feature (a New folder action in the folder picker). It does not fix a defect, so the root-cause criteria do not apply. No code inspection was needed to reach this result.

Full details: Consistent With Adrs And Existing Features

Explanation

The PR adds behaviour: a New folder action in the shared folder picker (iOS, Android, desktop). The check therefore applies. I found no failure condition. ADR contradiction: none found. - docs/adr/ holds ADRs 0353–0365. None covers folder creation, the folder picker or Workspace registration. The matches are unrelated (ADR-0356 grant write switch, ADR-0364 environment switching). - The closest decision text is docs/decisions/workspaces.md and docs/architecture/botharness-architecture.md ("Browsing creates no Workspace or Grant"). That sentence limits browsing. The PR adds an explicit create action, and the Grant still needs the existing confirmation step. I found no direct contradiction. The PR does not update that architecture line, so a reviewer may want to note the new create path there. - docs/decisions/team-mode.md gates creation through workspaces.createFolder. The PR uses that same permission. Reuse of existing modules (no second implementation of the core behaviour): - The Host call reuses createHostFolder in packages/host-client/src/bot-settings.ts (line 393). The PR does not add a new bridge method. - The picker reuses the existing FolderPickerSheet and WorkspaceSheet. The PR extends them. It does not add a second picker. - The permission gate uses the existing team viewer data (teamMode.viewer and the member permission refresh in apps/mobile/src/host/member-permissions.ts). Possible duplication, judged as acceptable: - packages/host-client/src/new-folder.ts (newFolderNameProblem) repeats the single-segment name rule already enforced by packages/core/src/workspaces/folder-create.ts (lines 89–99). The client copy omits the Windows reserved-name and character rules from the Host copy. This is a real drift risk. The Host stays authoritative. - The client copy is a pre-check only. host-client depends only on @botharness/host-protocol and @tanstack/query-core. It cannot import packages/core, and core cannot run in the client. A shared package would be needed to reuse the rule. The PR does not add that. I do not treat this as a failing duplicate under the check wording. - canCreateFolders in new-folder.ts repeats owner-or-permission logic also found in canManage (packages/client/src/client/team-roles-bridge.ts, line 278). host-client cannot import the client package, so the copy is needed in this package. Result: no accepted ADR is contradicted, and the core behaviour reuses existing modules. The rule copies are noted above as a maintenance risk. They do not meet the FAIL condition.

Full details: Product Terms Follow The Glossary

Explanation

The check fails on two product-noun uses in the PR description that match Avoid words in GLOSSARY.md. Other added copy passes. 1. Host, avoid "instance". The PR description says "Real isolated DSH Host (verify-app instance, launched with an SSH marker …)". GLOSSARY.md defines Host as "The single DSH process that runs the plugin and every PersonaBot" and lists _Avoid_: server, instance, node, worker. Here "instance" names the same process that the sentence calls the Host. Preferred term: Host, for example "Real isolated DSH Host (verify-app Host, launched …)". 2. Host Member, avoid "account". The PR description says "Not run: … member-account UI session". GLOSSARY.md defines Host Member and lists _Avoid_: user, account, tenant, external person. Here "member-account" refers to a session signed in as a Host Member. Preferred term: Host Member (sign-in uses Member Credential), for example "member UI session signed in with a Member Credential". Checked and not violations: - Host Owner, Host Permission, Host Role: used with their glossary terms. No avoid words. - Bot: used as the visible UI name, which GLOSSARY.md and docs/agents/ui-copy.md both require. Not the bare lowercase "bot" that is avoided. - Workspace: "folder" is used for a Host directory. Workspace avoids only "project", "multi-root folder" and "group". The glossary's own Workspace root entry says "A Host folder". - Session: "新建会话" matches the existing zh UI copy (apps/mobile/src/features/sessions/strings.ts). GLOSSARY.zh.md does not list 会话 as an avoid word for Session. - Folder: the glossary's "folder" avoid applies to Channel sections, not Host directories. - Added user-visible strings and the changelog contain no avoid words for these nouns. The "Project" hits are test fixture folder names, not user copy. - "Projects" in the evidence filesystem path and "Mac account name" are a literal directory name and a macOS account. Neither uses a product noun in the glossary sense.

Resolution

Edit the PR description, not the code: 1. Replace "DSH Host (verify-app instance, …)" with "DSH Host (verify-app Host, …)" or another phrase that uses the term Host. 2. Replace "member-account UI session" with "Host Member UI session" or "member UI session signed in with a Member Credential". After these edits, re-run the check. The rest of the added copy already passes.

Full details: Touched Features Are Verified

Explanation

Summary: Four feature files map to changed runtime files in this PR. The PR range is 3d569b9..4eb3d38 (the #5241 head is the base). Three of the four lack a named journey run or a stated reason for not running it. Mapped features and changed files (glob matches against ## Sources): 1. workspace-grant.md matches packages/client/src/client/workspace-grant* via workspace-grants-entry.tsx. This file adds the New folder button and form to FolderBrowser. The PR notes say "desktop Web Client drove grants with refusal and confirmation". That names a run of the grant authorization flow. It does not name the scripted journey scripts/e2e-workspace-grant.mjs or its read and revoke steps. I treat this as a partial but acceptable run. 2. phone-sessions-navigation.md matches apps/mobile/src/features/sessions/new-session-screen.tsx. This file adds the createFolder port and useCreateFolder. The notes cover an iOS New Session run for folder creation. They do not name the feature's journey: Drawer/Stacked switching, On launch and Returning to Sessions landing, or the re-tap root check. No reason for skipping that journey is given. 3. phone-pairing.md and 4. phone-multiple-hosts.md both match apps/mobile/src/host/host-session.ts. This file adds markMemberClient(client) on member connections, which is runtime code. The notes do not name the pairing or two-Host journeys. The "Not run" list mentions a "member-account UI session", but it does not link that gap to either feature's journey. The iOS run needed a paired Host, but the notes do not present it as a pairing or multi-host run. The verification notes cover unit tests, lint, typecheck, and manual runs of the new picker. Those do not satisfy the check's requirement. The check requires a run of each touched feature's journey, or a reason it was not run. Features 2–4 do not meet that requirement. Only phone-sessions-navigation, phone-pairing, and phone-multiple-hosts need a fix. The workspace-grant run is partial but counts.

Resolution

For each of these features, either name a run of its journey or state a specific reason it was not run in the PR verification notes: - phone-sessions-navigation (new-session-screen.tsx): run the Sessions navigation journey on the shared device queue (Drawer/Stacked switch, On launch and Returning to Sessions landing, root re-tap), or record why it is not run. - phone-multiple-hosts (host-session.ts): run the shared-device two-Host journey, or record why it is not run. - phone-pairing (host-session.ts): run the pairing journey (for example scripts/e2e-mobile-pairing-web.mjs or the shared-device pairing path), or record why it is not run. The member-connection path in markMemberClient should be named explicitly. - Optional for workspace-grant: name scripts/e2e-workspace-grant.mjs, or state that the desktop grant run covers authorization only, with read and revoke not run.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant