Skip to content

Cs 10383 create listing should have a loading user experience#4190

Draft
lucaslyl wants to merge 9 commits intomainfrom
CS-10383-create-listing-should-have-a-loading-user-experience
Draft

Cs 10383 create listing should have a loading user experience#4190
lucaslyl wants to merge 9 commits intomainfrom
CS-10383-create-listing-should-have-a-loading-user-experience

Conversation

@lucaslyl
Copy link
Contributor

@lucaslyl lucaslyl commented Mar 15, 2026

linear: https://linear.app/cardstack/issue/CS-10383/create-listing-should-have-a-loading-user-experience

This branch implements an openCreateListingModal command and the associated modal UI for creating a listing, along with a pre-selected source flow when triggered from a card instance.

Changes:

  • Remove navigate on listing open — Removed the auto-navigation to the listing in interact mode after creation
    (listing-create.ts)
  • Implement openCreateListingModal as a host command and built out the full CreateListingModal component
  • Support creating a listing from card instances with pre-selected source — Updated detail-panel.gts to trigger the command from a card instance context, passing a pre-selected source; updated menu-items.ts accordingly

Note: The modal auto-closes after the listing is created. A follow-up task will build a toast notification component to display the async creation progress and status, along with a link to the newly created listing so users can navigate to it directly.

Added acceptance tests

  1. inspector test
  2. create-listing-modal-test
  3. open-create-listing-modal-test

Follow up Task:

https://linear.app/cardstack/issue/CS-10454/display-a-toast-notification-indicating-that-the-listing-has-been

Demo:

Screen.Recording.2026-03-15.at.10.09.07.PM.mov

@lucaslyl lucaslyl self-assigned this Mar 15, 2026
@github-actions
Copy link

Preview deployments

@github-actions
Copy link

github-actions bot commented Mar 15, 2026

Host Test Results

    1 files  ± 0      1 suites  ±0   2h 34m 52s ⏱️ + 5m 6s
2 036 tests +14  2 021 ✅ +14  15 💤 ±0  0 ❌ ±0 
2 051 runs  +14  2 036 ✅ +14  15 💤 ±0  0 ❌ ±0 

Results for commit 15cfc04. ± Comparison against base commit 0db3b27.

♻️ This comment has been updated with latest results.

@lucaslyl
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0606903eb1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

targetRealm,
});
if (this.isCardInstance) {
const openCardId = this.args.readyFile.url;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use extensionless card id for listing creation

When the action runs from an instance, openCardId is sourced from readyFile.url, and this path is guaranteed to include .json (isCardInstance checks that). ListingCreateCommand then uses that value as the canonical instance identifier (for examples.0.links.self and in linkSpecs() via _dependencies?url=...), but instance entries are indexed by extensionless ids (for example .../Pet/mango). In this path, passing the file URL causes dependency/spec resolution to miss and can produce listings without the expected linked example/specs; use the instance id (this.args.cardInstance?.id) or strip .json before executing the command.

Useful? React with 👍 / 👎.

@lucaslyl lucaslyl marked this pull request as ready for review March 15, 2026 09:00
@lucaslyl lucaslyl requested a review from tintinthong March 15, 2026 09:01
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e825a478e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +176 to +179
@action private onClose() {
this.errorMessage = undefined;
this.operatorModeStateService.closeCreateListingModal();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset source override when closing the listing modal

Closing the modal only clears errorMessage, so _userSelectedKey/_userSelectedValue persist across sessions. If a user opens from an instance, switches Source to the definition, cancels, and then reopens from that same instance, activeOpenCardId will reuse the stale override instead of pre-selecting the triggering instance. That breaks the instance-driven preselection flow and can cause creating a listing from the wrong source when users immediately confirm.

Useful? React with 👍 / 👎.

targetRealm: request.targetRealm,
openCardId: this.activeOpenCardId ?? undefined,
});
this.operatorModeStateService.closeCreateListingModal();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent stale create task from closing newer modal requests

The create task always calls closeCreateListingModal() after ListingCreateCommand resolves, even if the modal request changed while the task was running. In a long-running create, a user can dismiss and reopen the modal for a different card; when the first task finishes, it clears the newer request and dismisses the new modal unexpectedly.

Useful? React with 👍 / 👎.

@lucaslyl lucaslyl requested a review from a team March 16, 2026 02:07
@lucaslyl lucaslyl marked this pull request as draft March 16, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant