Skip to content

Commit 1e4d2cb

Browse files
authored
chore: Update user visible 'Default Recipe' text to 'Default Pattern' in shell (#1875)
chore: Update user visible 'Default Recipe' text to 'Default Pattern' in shell.
1 parent 6328ee9 commit 1e4d2cb

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

packages/shell/src/lib/default-recipe.ts renamed to packages/shell/src/lib/default-pattern.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function create(cc: CharmsController): Promise<CharmController> {
2525

2626
if (!sourceCell) {
2727
// Not sure how/when this happens
28-
throw new Error("Could not create and link default recipe.");
28+
throw new Error("Could not create and link default pattern.");
2929
}
3030

3131
// Get the well-known allCharms cell using its EntityId format
@@ -41,7 +41,7 @@ export async function create(cc: CharmsController): Promise<CharmController> {
4141
return charm;
4242
}
4343

44-
export function getDefaultRecipe(
44+
export function getDefaultPattern(
4545
charms: CharmController[],
4646
): CharmController | undefined {
4747
return charms.find((c) => {

packages/shell/src/views/DebuggerView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ export class XDebuggerView extends LitElement {
804804
if (isRecord(fn) && isRecord(fn.recipe)) {
805805
details.push(html`
806806
<div class="event-detail">
807-
<span class="event-detail-label">recipe:</span>
807+
<span class="event-detail-label">pattern:</span>
808808
<span class="event-detail-value">${"name" in fn.recipe
809809
? fn.recipe.name
810810
: "unknown"}</span>

packages/shell/src/views/HeaderView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class XHeaderView extends BaseView {
177177
size="small"
178178
@click="${this.handleToggleClick}"
179179
title="${this.showShellCharmListView
180-
? "Show Default Recipe"
180+
? "Show Default Pattern"
181181
: "Show All Charms"}"
182182
>
183183
${this.showShellCharmListView ? "📋" : "🔍"}

packages/shell/src/views/SpaceView.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { css, html } from "lit";
22
import { property, state } from "lit/decorators.js";
33
import { BaseView } from "./BaseView.ts";
44
import { Task } from "@lit/task";
5-
import * as DefaultRecipe from "../lib/default-recipe.ts";
5+
import * as DefaultPattern from "../lib/default-pattern.ts";
66
import { RuntimeInternals } from "../lib/runtime.ts";
77

88
export class XSpaceView extends BaseView {
@@ -20,7 +20,7 @@ export class XSpaceView extends BaseView {
2020
showShellCharmListView = false;
2121

2222
@state()
23-
creatingDefaultRecipe = false;
23+
creatingDefaultPattern = false;
2424

2525
private _charms = new Task(this, {
2626
task: async ([rt]) => {
@@ -34,23 +34,23 @@ export class XSpaceView extends BaseView {
3434
args: () => [this.rt],
3535
});
3636

37-
async onRequestDefaultRecipe(e: Event) {
37+
async onRequestDefaultPattern(e: Event) {
3838
e.preventDefault();
39-
if (this.creatingDefaultRecipe) {
39+
if (this.creatingDefaultPattern) {
4040
return;
4141
}
4242
if (!this.rt) {
4343
throw new Error(
44-
"Cannot create default recipe without a runtime.",
44+
"Cannot create default pattern without a runtime.",
4545
);
4646
}
47-
this.creatingDefaultRecipe = true;
47+
this.creatingDefaultPattern = true;
4848
try {
49-
await DefaultRecipe.create(this.rt.cc());
49+
await DefaultPattern.create(this.rt.cc());
5050
} catch (e) {
51-
console.error(`Could not create default recipe: ${e}`);
51+
console.error(`Could not create default pattern: ${e}`);
5252
} finally {
53-
this.creatingDefaultRecipe = false;
53+
this.creatingDefaultPattern = false;
5454
this._charms.run();
5555
}
5656
}
@@ -60,8 +60,8 @@ export class XSpaceView extends BaseView {
6060
? this.rt.cc().manager().getSpaceName()
6161
: undefined;
6262
const charms = this._charms.value;
63-
const defaultRecipe = charms
64-
? DefaultRecipe.getDefaultRecipe(charms)
63+
const defaultPattern = charms
64+
? DefaultPattern.getDefaultPattern(charms)
6565
: undefined;
6666

6767
const inner = !charms
@@ -77,24 +77,24 @@ export class XSpaceView extends BaseView {
7777
@charm-removed="${() => this._charms.run()}"
7878
></x-charm-list-view>
7979
`
80-
: !defaultRecipe
81-
? (this.creatingDefaultRecipe
80+
: !defaultPattern
81+
? (this.creatingDefaultPattern
8282
? html`
8383
<v-box center="${true}">
84-
<div>Creating default recipe...</div>
84+
<div>Creating default pattern...</div>
8585
<x-spinner></x-spinner>
8686
</v-box>
8787
`
8888
: html`
8989
<v-box center="${true}">
90-
<div>Create default recipe?</div>
90+
<div>Create default pattern?</div>
9191
<x-button variant="primary" @click="${this
92-
.onRequestDefaultRecipe}">Go!</x-button>
92+
.onRequestDefaultPattern}">Go!</x-button>
9393
</v-box>
9494
`)
9595
// TBD if we want to use x-charm or ct-render directly here
9696
: html`
97-
<x-charm-view .charm="${defaultRecipe}"></x-charm-view>
97+
<x-charm-view .charm="${defaultPattern}"></x-charm-view>
9898
`;
9999

100100
return html`

0 commit comments

Comments
 (0)