Repository navigation
feat(app-kit): offer the project picker to apps through the sdk - #36322
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the picker is the dashboard's existing one, the blind reader read it correctly, and the new refusal is in a screenshot. Notes
[UX-REVIEWED] e954c5f Description read[DESCRIPTION-READ] 95959f675e828fddf9512101aebef26a54a1ce5ae3277eeb103cf745987565bf That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The access check runs before mount and covers every path the picker sends, and a test pins that list against the picker's real source. Notes
[DESIGN-REVIEWED] e954c5f Description read[DESCRIPTION-READ] 830efb73e8ee30f928b2a3bc5cd6daa016bacb0d7995fa2905ef7f410e66e955 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the export removes a named harm, the adopted Create Folders app losing its Browse picker under #26967, which no existing seam already does. Not checked: the in-repo consumer count; the only consumer is the external app repository the description names. Notes
What this change shipsInventory (5 items) — 5 justifiedIntent: let an app installed from its own repository open the dashboard's project picker, so Create Folders keeps Browse after it leaves core. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] e954c5f Description read[DESCRIPTION-READ] b7160fc1242815fb1ee347ee4bebeb8720d94cac4265a7bc04758272e6ac7200 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] e954c5f Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
* feat: Create Folders From Project as a standalone Kiro Crew app Port the built-in app from kirodotdev/KiroCrew (src/kiro_crew/apps/builtins/ project_scaffolder and website/src/apps/project-scaffolder at 9b32941be66d) into a repository of its own, so an existing user's copy can move onto it in place and a new user can install it from the App Store. The page is the built-in's, built into a committed ESM bundle: the same markup, strings and requests, with its requests over the app's scoped client and the project picker taken from the App SDK (level 7, kirodotdev/KiroCrew#36322). The manifest keeps the built-in's name, permissions, platform and defaultEnabled. PORTING.md lists every difference. * fix: replace process.env in the bundled animation library at build time The page crashed on its first animated row in a real dashboard: library mode left framer-motion's process.env.NODE_ENV checks in the bundle, and a browser has no process. The jsdom tests define one, so only a gateway run showed it. The bundle now names no process.env, pinned by a test.
b9e703d to
86c1558
Compare
|
Code change approver recommendation: A person should decideWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 475 lines, more than the 400 it may approve on its own. Adds ProjectPicker to @kirocrew/app-sdk at level 7, wrapping the dashboard's components/ProjectPicker. Verified: the host picker and its New folder form make seven api.* calls (browseDirs, browseDrives, createBrowseDir, recentProjects, favoriteProjects, addFavoriteProject, removeFavoriteProject), and all of them go to the four PROJECT_PICKER_PATHS; browseDrives uses /api/browse-dirs?drives=1. Gating copies PullRequestPanel: identity origin 'builtin' (host-assigned, not forgeable through a nested AppApiProvider) mounts directly; otherwise apiPathAllowed checks each path separately and a missing provider fails closed. ErrorNotice defaults askAgent to false, so the refusal has no hand-off. Using the dashboard client instead of the scoped transport matches docs/architecture/app-platform-trust-model.md (frontend scoping is a guardrail, not a boundary). The three families added to the built-in manifest only matter for the adopted copy's E9 parity check (permission_refusal), and nothing else in the repo reads that path list. Vendor stub and index exports were both updated, i18n strings exist in all 12 locales, and tests pin the per-path refusal, the exact-entry refusal, the three identit An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
Backend Lint & Type Check (3.12) on 86c1558 is main's red, not this diff: mypy |
86c1558 to
eef4231
Compare
eef4231 to
ce45245
Compare
|
Rebased onto main 6d61070 to pick up #36804 (the |
|
Rebased onto main 02bad16 to clear a merge conflict with #36356 ( |
416bf0c to
1b39665
Compare
1b39665 to
5bd5469
Compare
|
Rebased onto On 1b39665, the red |
5bd5469 to
0bac453
Compare
|
Synced onto main 66dc266 to clear the merge conflict (two level-7 lines in |
An app page that asks for a project directory had no way to open the dashboard's own picker (Favorites, Recent, Browse, the desktop folder picker, New folder): the component lives in the host bundle, and only a built-in page could import it. Create Folders From Project is such a page, so a copy of it installed from its own repository would lose the picker and fall back to a typed path. ProjectPicker joins @kirocrew/app-sdk as App Kit level 7. It mounts the dashboard's picker for a built-in page, and for an external app only once its permissions.api declares every endpoint family the picker calls (PROJECT_PICKER_PATHS); otherwise it renders a refusal naming the missing path and sends nothing. The Create Folders built-in declares those families in its own manifest, so an adopted copy declares nothing the built-in did not. Part of #26967
0bac453 to
e954c5f
Compare
|
Green on e954c5f (PR Readiness passed). green_age reports main +22 commits (f98bf61 -> 30f3498) in files this PR shares: shared docs and the locale catalogs, plus one test-stem match. I checked the head on that newer main without pushing. It rebases with no conflict onto 30f3498, leaving the same 21 files, +470/-5, and every locale catalog still parses. |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
The review read the whole diff on this head and found no blocking issue. The mount check covers each request the host picker and New folder send: /api/browse-dirs (and ?drives=1), /api/browse-dirs/create, /api/recent-projects and /api/favorite-projects. apiPathAllowed uses the same matcher as the gateway, both hooks run before the early return, and the picker fails closed with no identity. All 13 catalogs keep {{path}}.
Security: the flagged risk is that the picker sends requests through the dashboard client, not the app's scoped transport. The risk is not realized because the picker mounts only when the host-published identity is built-in, or when the app's manifest admits every path in PROJECT_PICKER_PATHS. An app cannot claim built-in identity by wrapping itself, because the host identity wins and AppIdentityProvider is not exported. The project_scaffolder manifest gains three families that its page already calls. The app has no backend and no app token, so this grants nothing new.
Done well: the member sweep calls each picker api. member on the real client and requires the sent path to be in PROJECT_PICKER_PATHS. The backend test checks the built-in's families against that same list through the gateway's matcher, so a new endpoint or a narrowed family turns a test red.
Optional:
website/src/app-sdk/ProjectPicker.tsx:89: the refusalErrorNoticehas noonDismiss, so an app that closes only fromonOpenChange(false)cannot close it. PassingonDismiss={() => onOpenChange(false)}would fix that.- §18i in
app-kit-platform.mdsays each built-in that opens the picker declares the families. Issue Radar and Spec Builder do not declare them yet. Consider wording this as a step to do before adoption. Also, open PR #36967 adds its own §18i, so whichever PR lands second should renumber. docs/app-kit/api-reference.md:803ties the picker to SDK level 7. Release 0.13.0 ships level 7 without it, and main is at level 8. Feature-detecting the export, as the snippet already does, is the safe guidance.
Problem / Motivation
Goal: An installed app can open the dashboard's own project picker, so Create Folders From Project keeps its Browse picker when it moves to its own repository.
The project picker (Favorites, Recent, Browse, the desktop app's system folder picker, New folder) lives in the dashboard bundle, and only a built-in page can import it. Create Folders From Project opens it from its Choose directory button. A copy of that app installed from its own repository (the campaign in #26967) has no way to reach it, so it would lose the picker and leave the user typing an absolute path.
Why it matters
Moving a built-in out of core must not change what its users see. Without a picker an app can open, the adopted Create Folders page would drop the way most people choose a project directory, and every other app that asks for a project directory would have to rebuild a picker of its own against the same host endpoints.
Not a goal
/api/project-scaffold/*): its app repository and its adoption pin are separate steps.What changed (motivation → approach → change)
ProjectPicker(website/src/app-sdk/ProjectPicker.tsx, exported fromapp-sdk/index.tsand the vendor stub) joins@kirocrew/app-sdkat App Kit level 7. Other seams share that level, so an app feature-detects the export, never the level alone; the level-7 rows in both docs name it. Whether it mounts follows the identity the host published, as the pull-request panel does: a built-in page gets the picker; an external app gets it only once itspermissions.apiadmits every path the picker sends (the module-localPROJECT_PICKER_PATHS, which the SDK does not re-export because an app declares paths in its static manifest:/api/browse-dirs,/api/browse-dirs/createfor New folder,/api/recent-projects,/api/favorite-projects), each checked on its own so an exact=/api/browse-dirsentry does not admit New folder's write. Otherwise it sees a refusal naming the missing path, with nothing sent. A page with no app identity fails closed.The mounted picker keeps the dashboard's client rather than a client over the app's scoped transport. Its failure notices read that client's deadlines, error codes and journaled reports, so a second client would word the same refusal differently in an app. The check before mount covers every request it can send, and a scoped request carries the dashboard user's own authority too, so this grants nothing the scoped transport would not. The export takes no
errorHandoffand nofooter, and its refusal offers no Ask the agent hand-off: the hand-off navigates to the chat and unmounts the app page, losing the form the picker opens from.The Create Folders built-in now declares the three bare families (
/api/browse-dirs,/api/recent-projects,/api/favorite-projects), which admit all four paths, beside/api/project-scaffold. A built-in approves what it ships, so its adopted copy can declare the same set without E9 calling it a widening. Spec: §18i inapp-kit-platform.md; app authors: "Project Picker" indocs/app-kit/api-reference.md. One new catalog string (the refusal,appSdk.projectPicker.not_declared) in all 12website/src/i18n/locales/catalogs, withen-XA.jsonregenerated.Backwards compatibility
Compatible: the picker and every dashboard surface that opens it are unchanged; the SDK gains one export at its current level, and an app that does not look for it sees nothing new.
Removes nothing: the change only adds an export and three declared paths on one built-in.
Tests
website/src/test/AppSdkProjectPicker.test.tsx: the per-path refusal and its message, the exact-entry refusal naming/api/browse-dirs/create, no hand-off on the refusal, the three identity answers (external declared or not, builtin, none), the props passed through (noerrorHandoff), nothing rendered while closed; and, against the real picker source and the real dashboard client, that everyapi.member the picker and its New folder form call sends to a pathPROJECT_PICKER_PATHSnames itself, so a new endpoint in the picker fails this test until the list names it. Dropping/api/browse-dirs/createfrom the list, or puttingaskAgentback on the refusal, turns it red.src/kiro_crew/apps/builtins/project_scaffolder/tests/test_manifest.py: the built-in declares exactly its page's paths, and, through the gateway's own pattern matcher, its three families admit every path in the SDK constant and each family admits one (source checkout only).appSharedModuleBoundary,chatProtocolBoundary),appSdkTypes, the i18n parity suite andtest_app_sdk_level_mirror.pypass with the new export and string.test_manifest.pypassed 10 repeated runs and one run with its 12 tests in reversed order;AppSdkProjectPicker.test.tsxpassed 10 repeated runs and one--sequence.shufflerun (seed 36322).Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
On an isolated loopback gateway from this branch, with the Create Folders app's own repository (KiroCrewCaptain/kirocrew-app-project-scaffolder) adopted in place through a harness pin row: the adopted page loaded its own bundle at
/project-scaffolder, Choose directory opened the dashboard's picker through this export (Favorites, Recent, Browse), and a scan from the page worked. A throwaway external app that declares none of the families rendered the refusal and sent no picker request.Screenshots / video
The dashboard's picker opened from the adopted app's own page (external identity, families declared):
The same page as the built-in shows it today, for comparison:
An external app that declares none of the picker's paths gets the refusal, with nothing sent. This capture predates removing the Ask the agent link from the notice; the message text is unchanged, and the test above pins the notice without it:
Related Issues
Part of #26967
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)