Skip to content

Add a dev store picker to store delete, shared with app dev - #8474

Draft
amcaplan wants to merge 2 commits into
mainfrom
add-store-selector-in-store-delete-when-no-store-is-provided
Draft

amcaplan wants to merge 2 commits into
mainfrom
add-store-selector-in-store-delete-when-no-store-is-provided

Conversation

@amcaplan

@amcaplan amcaplan commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Fixes a request from @nickwesselman: shopify store delete requires --store, so there's no way to pick a store you don't already know the domain of. --store should only be required when we can't prompt.

WHAT is this pull request doing?

store delete now shows a store picker when --store is omitted:

?  Which dev store do you want to delete?

>  (f)  My Dev Store (my-dev-store.myshopify.com)
   (g)  Another Store (another-store.myshopify.com)

   Press ↑↓ arrows to select, enter to confirm.

--store uses requiredIfNonInteractive, so non-interactive runs still fail with the usual "Flag not specified: --store" error rather than hanging on a prompt. As before, the picker's organization step is skipped when --organization-id is passed or you belong to a single organization, and the chosen store still goes through the dangerous-confirmation prompt — a lone dev store is offered as a choice rather than auto-selected, so you see which store you're about to delete.

One picker, shared with app dev

app dev already had an autocomplete store picker, and store delete needs the same bookkeeping: label a set of stores, keep the id lookup in step with whatever a remote search offers, resolve what the developer submits back to a store. That now lives once in @shopify/organizations as storeChoiceList. Callers project their own store shape onto it via toChoice, so each keeps its own query, filter, wording and surrounding flow — app dev's empty-list, auto-select-single and create-store behavior is unchanged and still lives in app dev, and its existing tests pass untouched.

It hands back one promptProps object to spread into renderAutocompletePrompt rather than a bare search callback, because an explicit search: undefined overrides the prompt's default in-memory filtering instead of leaving it in place (ui.tsx:420 sets the flag, then ...props overwrites it). Keeping the key absent is now the helper's job instead of each caller's.

Worth a reviewer's eye: this shares ~28 lines of bookkeeping, and duplicating it instead would have cost store/select.ts about 18 lines. It's close to a wash on line count — the argument for sharing is that the search/id-map step and the search: undefined trap are each written once.

Server-side dev-store filtering and search

ListAccessibleShops now takes its filters and search term as variables. store delete passes STORE_TYPE = development_superset (both development types at once), so:

  • the 250-store page cap means 250 dev stores, not 250 stores of any type that we then filter down;
  • typeahead is delegated to Business Platform, so you can find a store beyond the first page by typing its name — which is what the prompt's own "1-N of many" hint promises.

store list's call site is unchanged; it just gets the same STORE_STATUS = active filter through a variable instead of inline in the document.

How to test your changes?

  1. shopify store delete — pick an organization (if you have several) and a dev store, confirm by typing the domain.
  2. Type part of a store's name in the picker to check the search hits the server.
  3. shopify store delete --store some-store.myshopify.com — no picker, unchanged behavior.
  4. echo "" | shopify store delete --force — fails with "Flag not specified: --store".
  5. shopify app dev in an app with several dev stores — picker unchanged.

Measuring impact

  • n/a - Not applicable

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes — n/a, store delete is still hidden, and the app dev change is behavior-preserving
  • I've added tests to cover my changes
  • I've updated the documentation if needed — command docs are regenerated from the manifest

🤖 Generated with Claude Code

`shopify store delete` required `--store` up front. Interactively there is
enough context to offer the organization's dev stores instead, so `--store`
is now only required where prompting is impossible.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assisted-By: devx/19acce5b-fd85-4605-8c06-84e7e56e37ed
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Sep 3, 2026
@amcaplan amcaplan changed the title Prompt for a dev store when store delete has no --store Add a dev store picker to store delete, shared with app dev Sep 3, 2026
`app dev` and `store delete` both need an autocomplete store picker. The
bookkeeping they'd otherwise each write now lives once in
`@shopify/organizations` as `storeChoiceList`: it labels a set of stores,
keeps the id lookup in step with whatever a remote search offers, and hands
back props to spread into `renderAutocompletePrompt`. Callers project their
own store shape onto it, so each keeps its own query, filter, wording and
flow. `app dev`'s empty-list, auto-select and create-store behavior is
unchanged and still lives in `app dev`.

The props come back as one object because `search: undefined` overrides
`renderAutocompletePrompt`'s default in-memory filtering rather than leaving
it alone, so the key has to be absent when a caller can't search remotely.

`ListAccessibleShops` now takes its filters and search term as variables, so
`store delete` asks Business Platform for `development_superset` stores and
delegates typeahead to the server. That makes the 250-store page cap mean 250
dev stores rather than 250 stores of any type, and replaces the client-side
filter and truncation warning with the prompt's own paging hint.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assisted-By: devx/19acce5b-fd85-4605-8c06-84e7e56e37ed
@amcaplan
amcaplan force-pushed the add-store-selector-in-store-delete-when-no-store-is-provided branch from 7a1f375 to 8147e30 Compare September 4, 2026 06:41
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

@amcaplan

Copy link
Copy Markdown
Contributor Author

Still relevant, just haven't had the time/attention for it

@github-actions

Copy link
Copy Markdown
Contributor

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

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

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. no-pr-activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant