Add a dev store picker to store delete, shared with app dev - #8474
Draft
amcaplan wants to merge 2 commits into
Draft
Add a dev store picker to store delete, shared with app dev#8474amcaplan wants to merge 2 commits into
amcaplan wants to merge 2 commits into
Conversation
`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
`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
force-pushed
the
add-store-selector-in-store-delete-when-no-store-is-provided
branch
from
September 4, 2026 06:41
7a1f375 to
8147e30
Compare
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.
WHY are these changes introduced?
Fixes a request from @nickwesselman:
shopify store deleterequires--store, so there's no way to pick a store you don't already know the domain of.--storeshould only be required when we can't prompt.WHAT is this pull request doing?
store deletenow shows a store picker when--storeis omitted:--storeusesrequiredIfNonInteractive, 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-idis 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 devapp devalready had an autocomplete store picker, andstore deleteneeds 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/organizationsasstoreChoiceList. Callers project their own store shape onto it viatoChoice, 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 inapp dev, and its existing tests pass untouched.It hands back one
promptPropsobject to spread intorenderAutocompletePromptrather than a baresearchcallback, because an explicitsearch: undefinedoverrides the prompt's default in-memory filtering instead of leaving it in place (ui.tsx:420sets the flag, then...propsoverwrites 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.tsabout 18 lines. It's close to a wash on line count — the argument for sharing is that the search/id-map step and thesearch: undefinedtrap are each written once.Server-side dev-store filtering and search
ListAccessibleShopsnow takes its filters and search term as variables.store deletepassesSTORE_TYPE = development_superset(both development types at once), so:store list's call site is unchanged; it just gets the sameSTORE_STATUS = activefilter through a variable instead of inline in the document.How to test your changes?
shopify store delete— pick an organization (if you have several) and a dev store, confirm by typing the domain.shopify store delete --store some-store.myshopify.com— no picker, unchanged behavior.echo "" | shopify store delete --force— fails with "Flag not specified:--store".shopify app devin an app with several dev stores — picker unchanged.Measuring impact
Checklist
store deleteis stillhidden, and theapp devchange is behavior-preserving🤖 Generated with Claude Code