-
Notifications
You must be signed in to change notification settings - Fork 12
Add isLoading checking for the Example field in Create Listing Modal #4250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -47,8 +47,12 @@ export default class CreateListingModal extends Component<Signature> { | |||||
|
|
||||||
| @tracked private selectedExamples: PickerOption[] = []; | ||||||
|
|
||||||
| private instancesSearch = getSearch<CardDef>(this, getOwner(this)!, () => | ||||||
| this.codeRef ? { filter: { type: this.codeRef } } : undefined, | ||||||
| private instancesSearch = getSearch<CardDef>( | ||||||
| this, | ||||||
| getOwner(this)!, | ||||||
| () => (this.codeRef ? { filter: { type: this.codeRef } } : undefined), | ||||||
| () => (this.payload?.targetRealm ? [this.payload.targetRealm] : undefined), | ||||||
| { isLive: true }, | ||||||
|
||||||
| { isLive: true }, | |
| { isLive: false }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add loading checking and also the instance length check else the fieldcontainer will still display if the search result is empty
Copilot
AI
Mar 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Examples picker is now hidden while instancesSearch.isLoading, but the modal’s Create button remains enabled. If the user clicks Create before the search finishes, selectedExampleURLs can resolve to an empty list (because instances/instanceOptions haven’t populated yet), resulting in a listing created without the user’s intended examples. Consider disabling Create while instancesSearch.isLoading and/or having selectedExampleURLs fall back to payload.openCardIds when options haven’t loaded yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense ,agree with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting
isLive: truehere introduces a persistent background subscription after the modal is dismissed.CreateListingModalis always mounted (operator-mode/container.gtsrenders it unconditionally), and when the payload is clearedcodeRefbecomes undefined; inSearchResource.modify()(packages/host/app/resources/search.ts) that path returns early onquery === undefinedwithout unsubscribing existing live subscriptions or clearing#previousQuery. As a result, later realm index events can continue triggeringsearch.perform(...)for the stale query even while the modal is closed, causing unnecessary live refresh traffic/work until the whole component is destroyed.Useful? React with 👍 / 👎.