Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8737f7b
remove navigate the listing open in interact mode
lucaslyl Mar 14, 2026
d700f68
implement openCreateListingModal as a host command
lucaslyl Mar 15, 2026
d793a22
implement command & support create listing from card instances with p…
lucaslyl Mar 15, 2026
c62229d
add command test
lucaslyl Mar 15, 2026
5230c83
Merge branch 'main' into CS-10383-create-listing-should-have-a-loadin…
lucaslyl Mar 15, 2026
0d6e5c8
fix lint
lucaslyl Mar 15, 2026
0606903
fix realm index
lucaslyl Mar 15, 2026
5e825a4
address codex feedback
lucaslyl Mar 15, 2026
15cfc04
prevent stale create task from closing newer modal requests
lucaslyl Mar 15, 2026
82239b5
implement oeprator mode toast
lucaslyl Mar 17, 2026
988ef33
Merge branch 'main' into CS-10383-create-listing-should-have-a-loadin…
lucaslyl Mar 18, 2026
0ddd02c
support openCardIDs
lucaslyl Mar 18, 2026
74d2a99
add isListingDef checking
lucaslyl Mar 18, 2026
beab058
update test
lucaslyl Mar 18, 2026
13a49f9
remove toast
lucaslyl Mar 18, 2026
0a12266
menu item should pass openCardIds
lucaslyl Mar 18, 2026
368cfd9
fix test
lucaslyl Mar 18, 2026
5336b8c
fix test
lucaslyl Mar 18, 2026
065d64d
remove accidentally added submodule reference
lucaslyl Mar 18, 2026
87624ce
fix lint
lucaslyl Mar 18, 2026
83b9a03
fix test
lucaslyl Mar 18, 2026
5e3dd97
address codex feedback
lucaslyl Mar 18, 2026
7853b39
Merge branch 'main' into CS-10383-create-listing-should-have-a-loadin…
lucaslyl Mar 18, 2026
11bd5fc
Merge branch 'main' into CS-10383-create-listing-should-have-a-loadin…
lucaslyl Mar 19, 2026
f6892db
Refactor create-listing modal to use CardInstancePicker component
lucaslyl Mar 19, 2026
66fe721
fix inspector test
lucaslyl Mar 19, 2026
5ad688f
temporaily point GITHUB_TEAM_REVIEWERS to ecosystem team only
lucaslyl Mar 19, 2026
ac4203f
revert changes
lucaslyl Mar 19, 2026
45e145f
Merge branch 'main' into CS-10383-create-listing-should-have-a-loadin…
lucaslyl Mar 19, 2026
0e3d6a4
Merge branch 'main' into CS-10383-create-listing-should-have-a-loadin…
lucaslyl Mar 24, 2026
3cadc52
Merge branch 'main' into CS-10383-create-listing-should-have-a-loadin…
lucaslyl Mar 24, 2026
89e30fd
Update CommandRunner to use configurable submission realm URL and use…
lucaslyl Mar 24, 2026
1b26b11
implement OpenCreatePRModalCommand
lucaslyl Mar 24, 2026
9edd53a
Merge branch 'main' into CS-10383-create-listing-should-have-a-loadin…
lucaslyl Mar 24, 2026
17d2994
fix bot runner test
lucaslyl Mar 24, 2026
276b8ad
Merge branch 'main' into CS-10383-create-listing-should-have-a-loadin…
lucaslyl Mar 25, 2026
cfc895b
update listing submitted title
lucaslyl Mar 25, 2026
5ac9be7
remove the timeline addon
lucaslyl Mar 25, 2026
676d9d3
remove linked theme process
lucaslyl Mar 25, 2026
94a017d
add prnumber on isolated
lucaslyl Mar 25, 2026
addf805
fix lint
lucaslyl Mar 25, 2026
3c99522
add create pr-modal test
lucaslyl Mar 25, 2026
57a0501
fix lint
lucaslyl Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/base/command.gts
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,11 @@ export class ListingInstallResult extends CardDef {
export class CreateListingPRRequestInput extends CardDef {
@field realm = contains(RealmField);
@field listingId = contains(StringField);
@field listingName = contains(StringField);
}

export class ListingCreateInput extends CardDef {
@field openCardId = contains(StringField);
@field openCardIds = containsMany(StringField);
@field codeRef = contains(CodeRefField);
@field targetRealm = contains(RealmField);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/base/menu-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {

import CopyCardCommand from '@cardstack/boxel-host/commands/copy-card';
import GenerateExampleCardsCommand from '@cardstack/boxel-host/commands/generate-example-cards';
import ListingCreateCommand from '@cardstack/boxel-host/commands/listing-create';
import OpenCreateListingModalCommand from '@cardstack/boxel-host/commands/open-create-listing-modal';
import OpenInInteractModeCommand from '@cardstack/boxel-host/commands/open-in-interact-mode';
import PopulateWithSampleDataCommand from '@cardstack/boxel-host/commands/populate-with-sample-data';
import ShowCardCommand from '@cardstack/boxel-host/commands/show-card';
Expand Down Expand Up @@ -155,7 +155,7 @@ export function getDefaultCardMenuItems(
});
menuItems = [...menuItems, ...getSampleDataMenuItems(card, params)];
menuItems.push({
label: `Create Listing with AI`,
label: `Create Listing`,
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

action: async () => {
const codeRef = resolveAdoptsFrom(card);
if (!codeRef) {
Expand All @@ -165,9 +165,9 @@ export function getDefaultCardMenuItems(
if (!targetRealm) {
throw new Error('Unable to determine target realm from card');
}
await new ListingCreateCommand(params.commandContext).execute({
openCardId: cardId,
await new OpenCreateListingModalCommand(params.commandContext).execute({
codeRef,
openCardIds: [cardId],
targetRealm,
});
},
Expand Down
2 changes: 1 addition & 1 deletion packages/bot-runner/lib/github.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const GITHUB_API_BASE = 'https://api.github.com';
const GITHUB_TEAM_REVIEWERS = ['ecosystem-team', 'boxel-developers'];
const GITHUB_TEAM_REVIEWERS = ['ecosystem-team'];

export interface OpenPullRequestParams {
owner: string;
Expand Down
19 changes: 11 additions & 8 deletions packages/bot-runner/tests/command-runner-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import type {
import type { GitHubClient } from '../lib/github';
import { CommandRunner } from '../lib/command-runner';

const SUBMISSION_REALM_URL = 'http://localhost:4201/submissions/';
const SUBMISSION_BOT_USER_ID = '@submissionbot:localhost';

module('command runner', () => {
test('enqueues run-command job for matching trigger', async (assert) => {
let publishedJobs: unknown[] = [];
Expand Down Expand Up @@ -65,7 +68,7 @@ module('command runner', () => {
} as DBAdapter;

let commandRunner = new CommandRunner(
'@submissionbot:localhost',
SUBMISSION_BOT_USER_ID,
dbAdapter,
queuePublisher,
githubClient,
Expand Down Expand Up @@ -203,7 +206,7 @@ module('command runner', () => {
} as DBAdapter;

let commandRunner = new CommandRunner(
'@submissionbot:localhost',
SUBMISSION_BOT_USER_ID,
dbAdapter,
queuePublisher,
githubClient,
Expand Down Expand Up @@ -234,12 +237,12 @@ module('command runner', () => {
assert.deepEqual(
(publishedJobs[1] as { args: Record<string, unknown> }).args,
{
realmURL: 'http://localhost:4201/submissions/',
realmUsername: '@submissionbot:localhost',
runAs: '@submissionbot:localhost',
realmURL: SUBMISSION_REALM_URL,
realmUsername: SUBMISSION_BOT_USER_ID,
runAs: SUBMISSION_BOT_USER_ID,
command: '@cardstack/catalog/commands/create-pr-card/default',
commandInput: {
realm: 'http://localhost:4201/submissions/',
realm: SUBMISSION_REALM_URL,
prNumber: 1,
prUrl: 'https://example/pr/1',
prTitle: 'Add My Listing Name listing',
Expand Down Expand Up @@ -351,7 +354,7 @@ module('command runner', () => {
} as DBAdapter;

let commandRunner = new CommandRunner(
'@submissionbot:localhost',
SUBMISSION_BOT_USER_ID,
dbAdapter,
queuePublisher,
githubClient,
Expand Down Expand Up @@ -448,7 +451,7 @@ module('command runner', () => {
} as DBAdapter;

let commandRunner = new CommandRunner(
'@submissionbot:localhost',
SUBMISSION_BOT_USER_ID,
dbAdapter,
queuePublisher,
githubClient,
Expand Down
8 changes: 5 additions & 3 deletions packages/catalog-realm/catalog-app/listing/listing.gts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { listingActions, isReady } from '../resources/listing-actions';
import GetAllRealmMetasCommand from '@cardstack/boxel-host/commands/get-all-realm-metas';
import ListingGenerateExampleCommand from '@cardstack/boxel-host/commands/listing-generate-example';
import ListingUpdateSpecsCommand from '@cardstack/boxel-host/commands/listing-update-specs';
import CreateListingPRRequestCommand from '@cardstack/boxel-host/commands/create-listing-pr-request';
import OpenCreatePRModalCommand from '@cardstack/boxel-host/commands/open-create-pr-modal';

import { getMenuItems } from '@cardstack/runtime-common';

Expand Down Expand Up @@ -564,6 +564,7 @@ class EmbeddedTemplate extends Component<typeof Listing> {
export class Listing extends CardDef {
static displayName = 'Listing';
static headerColor = '#6638ff';
static isListingDef = true;

@field name = contains(StringField);
@field summary = contains(MarkdownField);
Expand Down Expand Up @@ -641,7 +642,7 @@ export class Listing extends CardDef {
[getMenuItems](params: GetMenuItemParams): MenuItemOptions[] {
let menuItems = super
[getMenuItems](params)
.filter((item) => item.label?.toLowerCase() !== 'create listing with ai');
.filter((item) => item.label?.toLowerCase() !== 'create listing');
if (params.menuContext === 'interact') {
const extra = this.getGenerateExampleMenuItem(params);
if (extra) {
Expand Down Expand Up @@ -676,9 +677,10 @@ export class Listing extends CardDef {
return {
label: 'Make a PR',
action: async () => {
await new CreateListingPRRequestCommand(commandContext).execute({
await new OpenCreatePRModalCommand(commandContext).execute({
listingId: this.id,
realm: this[realmURL]!.href,
listingName: this.name,
});
},
icon: Package,
Expand Down
22 changes: 2 additions & 20 deletions packages/catalog-realm/commands/create-pr-card.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import { Command, RealmPaths } from '@cardstack/runtime-common';
import {
CardDef,
field,
contains,
type Theme,
} from 'https://cardstack.com/base/card-api';
import { Command } from '@cardstack/runtime-common';
import { CardDef, field, contains } from 'https://cardstack.com/base/card-api';
import MarkdownField from 'https://cardstack.com/base/markdown';
import StringField from 'https://cardstack.com/base/string';
import NumberField from 'https://cardstack.com/base/number';
import GetCardCommand from '@cardstack/boxel-host/commands/get-card';
import SaveCardCommand from '@cardstack/boxel-host/commands/save-card';
import { PrCard } from '../pr-card/pr-card';

const GITHUB_PR_THEME_PATH = 'Theme/github-pr-brand-guide';

class CreatePrCardInput extends CardDef {
@field realm = contains(StringField);
@field prNumber = contains(NumberField);
Expand Down Expand Up @@ -44,7 +36,6 @@ export default class CreatePrCardCommand extends Command<
prSummary,
submittedBy,
} = input;
let catalogRealmUrl = new RealmPaths(new URL('..', import.meta.url)).url;

let card = new PrCard({
prNumber,
Expand All @@ -56,15 +47,6 @@ export default class CreatePrCardCommand extends Command<
submittedAt: new Date(),
});

// Link the GitHub PR brand guide theme from the catalog realm
let themeCardId = `${catalogRealmUrl}${GITHUB_PR_THEME_PATH}`;
let theme = await new GetCardCommand(this.commandContext).execute({
cardId: themeCardId,
});
if (theme) {
card.cardInfo.theme = theme as Theme;
}

// Save the PR card to the submission realm
let savedCard = (await new SaveCardCommand(this.commandContext).execute({
card,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export class IsolatedTemplate extends Component<typeof SubmissionCard> {
return this.args.model.roomId;
}

get prNumber() {
return this.args.model.prCard?.prNumber;
}

get listingImage() {
return this.args.model.listing?.images?.[0];
}
Expand Down Expand Up @@ -166,7 +170,12 @@ export class IsolatedTemplate extends Component<typeof SubmissionCard> {
aria-label='View PR card'
{{on 'click' this.openPrCard}}
>
<GitPullRequestIcon width='14' height='14' />View PR
<GitPullRequestIcon width='14' height='14' />
{{#if this.prNumber}}
View PR #{{this.prNumber}}
{{else}}
View PR
{{/if}}
</BoxelButton>
{{/if}}
</div>
Expand Down Expand Up @@ -453,4 +462,3 @@ export class IsolatedTemplate extends Component<typeof SubmissionCard> {
</style>
</template>
}

12 changes: 12 additions & 0 deletions packages/host/app/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ 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 OpenCreatePRModalCommandModule from './open-create-pr-modal';
import * as OpenInInteractModeModule from './open-in-interact-mode';
import * as OpenWorkspaceCommandModule from './open-workspace';
import * as PatchCardInstanceCommandModule from './patch-card-instance';
Expand Down Expand Up @@ -256,6 +258,14 @@ 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-create-pr-modal',
OpenCreatePRModalCommandModule,
);
virtualNetwork.shimModule(
'@cardstack/boxel-host/commands/open-workspace',
OpenWorkspaceCommandModule,
Expand Down Expand Up @@ -404,6 +414,8 @@ export const HostCommandClasses: (typeof HostBaseCommand<any, any>)[] = [
ListingUseCommandModule.default,
OneShotLlmRequestCommandModule.default,
OpenAiAssistantRoomCommandModule.default,
OpenCreateListingModalCommandModule.default,
OpenCreatePRModalCommandModule.default,
OpenInInteractModeModule.default,
OpenWorkspaceCommandModule.default,
GenerateThemeExampleCommandModule.default,
Expand Down
Loading
Loading