From 8737f7bbea64e8cf74544c3b972183c3cac6a394 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sat, 14 Mar 2026 23:24:29 +0800 Subject: [PATCH 1/9] remove navigate the listing open in interact mode --- packages/host/app/commands/listing-create.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/host/app/commands/listing-create.ts b/packages/host/app/commands/listing-create.ts index ce94c134ece..54e6d940cf7 100644 --- a/packages/host/app/commands/listing-create.ts +++ b/packages/host/app/commands/listing-create.ts @@ -149,7 +149,6 @@ export default class ListingCreateCommand extends HostBaseCommand< if (!listingId) { throw new Error('Failed to create listing card (no localId)'); } - await this.operatorModeStateService.openCardInInteractMode(listingId); const commandModule = await this.loadCommandModule(); const listingCard = listing as CardAPI.CardDef; // ensure correct type From d700f68a667cd5787bf800f32e760626a1df54cc Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 15 Mar 2026 10:26:26 +0800 Subject: [PATCH 2/9] implement openCreateListingModal as a host command --- packages/host/app/commands/index.ts | 6 + .../app/commands/open-create-listing-modal.ts | 33 ++ .../components/operator-mode/container.gts | 2 + .../operator-mode/create-listing-modal.gts | 348 ++++++++++++++++++ .../services/operator-mode-state-service.ts | 16 + 5 files changed, 405 insertions(+) create mode 100644 packages/host/app/commands/open-create-listing-modal.ts create mode 100644 packages/host/app/components/operator-mode/create-listing-modal.gts diff --git a/packages/host/app/commands/index.ts b/packages/host/app/commands/index.ts index 4fd424e63da..d125fdf950d 100644 --- a/packages/host/app/commands/index.ts +++ b/packages/host/app/commands/index.ts @@ -37,6 +37,7 @@ import * as ListingUpdateSpecsCommandModule from './listing-update-specs'; import * as ListingUseCommandModule from './listing-use'; import * as OneShotLlmRequestCommandModule from './one-shot-llm-request'; import * as OpenAiAssistantRoomCommandModule from './open-ai-assistant-room'; +import * as OpenCreateListingModalCommandModule from './open-create-listing-modal'; import * as OpenInInteractModeModule from './open-in-interact-mode'; import * as OpenWorkspaceCommandModule from './open-workspace'; import * as PatchCardInstanceCommandModule from './patch-card-instance'; @@ -256,6 +257,10 @@ export function shimHostCommands(virtualNetwork: VirtualNetwork) { '@cardstack/boxel-host/commands/open-ai-assistant-room', OpenAiAssistantRoomCommandModule, ); + virtualNetwork.shimModule( + '@cardstack/boxel-host/commands/open-create-listing-modal', + OpenCreateListingModalCommandModule, + ); virtualNetwork.shimModule( '@cardstack/boxel-host/commands/open-workspace', OpenWorkspaceCommandModule, @@ -404,6 +409,7 @@ export const HostCommandClasses: (typeof HostBaseCommand)[] = [ ListingUseCommandModule.default, OneShotLlmRequestCommandModule.default, OpenAiAssistantRoomCommandModule.default, + OpenCreateListingModalCommandModule.default, OpenInInteractModeModule.default, OpenWorkspaceCommandModule.default, GenerateThemeExampleCommandModule.default, diff --git a/packages/host/app/commands/open-create-listing-modal.ts b/packages/host/app/commands/open-create-listing-modal.ts new file mode 100644 index 00000000000..c7e51d1a285 --- /dev/null +++ b/packages/host/app/commands/open-create-listing-modal.ts @@ -0,0 +1,33 @@ +import { service } from '@ember/service'; + +import type * as BaseCommandModule from 'https://cardstack.com/base/command'; + +import HostBaseCommand from '../lib/host-base-command'; + +import type OperatorModeStateService from '../services/operator-mode-state-service'; + +export default class OpenCreateListingModalCommand extends HostBaseCommand< + typeof BaseCommandModule.ListingCreateInput +> { + @service declare private operatorModeStateService: OperatorModeStateService; + + description = 'Open create listing confirmation modal'; + + async getInputType() { + let commandModule = await this.loadCommandModule(); + const { ListingCreateInput } = commandModule; + return ListingCreateInput; + } + + requireInputFields = ['codeRef', 'targetRealm']; + + protected async run( + input: BaseCommandModule.ListingCreateInput, + ): Promise { + this.operatorModeStateService.openCreateListingModal({ + codeRef: input.codeRef, + targetRealm: input.targetRealm, + openCardId: input.openCardId, + }); + } +} diff --git a/packages/host/app/components/operator-mode/container.gts b/packages/host/app/components/operator-mode/container.gts index 45653d4104c..b514090ff56 100644 --- a/packages/host/app/components/operator-mode/container.gts +++ b/packages/host/app/components/operator-mode/container.gts @@ -41,6 +41,7 @@ import PrerenderedCardSearch from '../prerendered-card-search'; import { Submodes } from '../submode-switcher'; import ChooseFileModal from './choose-file-modal'; +import CreateListingModal from './create-listing-modal'; import type CardService from '../../services/card-service'; import type CommandService from '../../services/command-service'; @@ -143,6 +144,7 @@ export default class OperatorModeContainer extends Component {