Skip to content

Commit fe87d39

Browse files
authored
chore: update podman desktop ui to latest and fix files (#3514)
Changed files to use snippets rather than fragments/slots. Some tests and an api had to change due to snippets not rendering elements immediately. Some interfaces needed an extra optional variable to stop linter from complaining. Parent needed min-w-0 to allow carousel to hide overflow. Signed-off-by: Brian <[email protected]>
1 parent e552a42 commit fe87d39

28 files changed

+309
-243
lines changed

packages/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@fortawesome/free-brands-svg-icons": "^6.7.2",
1717
"@fortawesome/free-solid-svg-icons": "^6.7.2",
1818
"@fortawesome/free-regular-svg-icons": "^6.7.2",
19-
"@podman-desktop/ui-svelte": "1.16.0-202501131429-9076680fda2",
19+
"@podman-desktop/ui-svelte": "1.21.0",
2020
"tinro": "^0.6.12",
2121
"filesize": "^11.0.2",
2222
"humanize-duration": "^3.32.2",

packages/frontend/src/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ onDestroy(() => {
6969
<div class="flex flex-row w-full h-full overflow-hidden">
7070
<Navigation meta={meta} />
7171

72-
<div class="flex flex-col w-full h-full">
72+
<div class="flex flex-col w-full h-full min-w-0">
7373
<GPUPromotion />
7474

7575
<!-- Dashboard -->

packages/frontend/src/lib/table/application/ApplicationTable.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const columns: TableColumn<ApplicationState>[] = [
2727
}),
2828
];
2929
const row = new TableRow<ApplicationState>({});
30-
let data: (ApplicationState & { selected?: boolean })[];
30+
let data: ApplicationState[] = [];
3131
onMount(() => {
3232
return applicationStates.subscribe(items => {
3333
data = filter ? filter(items) : items;

packages/frontend/src/lib/table/service/ServiceStatus.spec.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ describe('transition statuses', () => {
4040
status: status,
4141
container: { containerId: 'dummyContainerId', engineId: 'dummyEngineId' },
4242
type: InferenceType.LLAMA_CPP,
43+
labels: {},
4344
},
4445
});
4546

46-
const img = screen.getByRole('img');
47-
expect(img).toBeDefined();
47+
const spinner = screen.queryByRole('progressbar');
48+
expect(spinner).toBeDefined();
4849

4950
const button = screen.queryByRole('button');
5051
expect(button).toBeNull();
@@ -64,11 +65,12 @@ describe('stable statuses', () => {
6465
status: status,
6566
container: { containerId: 'dummyContainerId', engineId: 'dummyEngineId' },
6667
type: InferenceType.LLAMA_CPP,
68+
labels: {},
6769
},
6870
});
6971

70-
const img = screen.queryByRole('img');
71-
expect(img).toBeNull();
72+
const spinner = screen.queryByRole('progressbar');
73+
expect(spinner).toBeNull();
7274

7375
const button = screen.getByRole('button');
7476
expect(button).toBeDefined();
@@ -89,11 +91,12 @@ test('defined health should not display a spinner', async () => {
8991
status: 'running',
9092
container: { containerId: 'dummyContainerId', engineId: 'dummyEngineId' },
9193
type: InferenceType.LLAMA_CPP,
94+
labels: {},
9295
},
9396
});
9497

95-
const img = screen.queryByRole('img');
96-
expect(img).toBeNull();
98+
const spinner = screen.queryByRole('progressbar');
99+
expect(spinner).toBeNull();
97100

98101
const button = screen.getByRole('button');
99102
expect(button).toBeDefined();
@@ -112,6 +115,7 @@ test('click on status icon should redirect to container', async () => {
112115
status: 'running',
113116
container: { containerId: 'dummyContainerId', engineId: 'dummyEngineId' },
114117
type: InferenceType.LLAMA_CPP,
118+
labels: {},
115119
},
116120
});
117121
// Get button and click on it
@@ -131,6 +135,7 @@ test('error status should show degraded', async () => {
131135
status: 'error',
132136
container: { containerId: 'dummyContainerId', engineId: 'dummyEngineId' },
133137
type: InferenceType.LLAMA_CPP,
138+
labels: {},
134139
},
135140
});
136141
// Get button and click on it
@@ -146,6 +151,7 @@ test('running status with no healthcheck should show starting', async () => {
146151
status: 'running',
147152
container: { containerId: 'dummyContainerId', engineId: 'dummyEngineId' },
148153
type: InferenceType.LLAMA_CPP,
154+
labels: {},
149155
},
150156
});
151157
// Get button and click on it

packages/frontend/src/pages/Applications.svelte

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,27 @@ const openApplicationCatalog = (): void => {
1111
</script>
1212

1313
<NavPage title="AI Apps" searchEnabled={false}>
14-
<div slot="content" class="flex flex-col min-w-full min-h-full space-y-5">
15-
<!-- showing running tasks -->
16-
<div class="w-full">
17-
<TasksBanner title="Pulling recipes" labels={{ 'recipe-pulling': undefined }} />
18-
</div>
14+
{#snippet content()}
15+
<div class="flex flex-col min-w-full min-h-full space-y-5">
16+
<!-- showing running tasks -->
17+
<div class="w-full">
18+
<TasksBanner title="Pulling recipes" labels={{ 'recipe-pulling': undefined }} />
19+
</div>
1920

20-
<div class="flex w-full h-full">
21-
<ApplicationTable>
22-
<svelte:fragment slot="empty-screen">
23-
<EmptyScreen
24-
icon={faServer}
25-
title="No application running"
26-
message="There is no AI App running. You can go to Recipes page to start an application.">
27-
<div class="flex gap-2 justify-center">
28-
<Button type="link" on:click={openApplicationCatalog}>Recipes</Button>
29-
</div>
30-
</EmptyScreen>
31-
</svelte:fragment>
32-
</ApplicationTable>
21+
<div class="flex w-full h-full">
22+
<ApplicationTable>
23+
<svelte:fragment slot="empty-screen">
24+
<EmptyScreen
25+
icon={faServer}
26+
title="No application running"
27+
message="There is no AI App running. You can go to Recipes page to start an application.">
28+
<div class="flex gap-2 justify-center">
29+
<Button type="link" on:click={openApplicationCatalog}>Recipes</Button>
30+
</div>
31+
</EmptyScreen>
32+
</svelte:fragment>
33+
</ApplicationTable>
34+
</div>
3335
</div>
34-
</div>
36+
{/snippet}
3537
</NavPage>

packages/frontend/src/pages/CreateService.svelte

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,14 @@ export function goToUpPage(): void {
157157
title="Creating Model service"
158158
breadcrumbLeftPart="Model Services"
159159
breadcrumbRightPart="Creating Model service"
160-
breadcrumbTitle="Go back to Model Services"
161160
onclose={goToUpPage}
162161
onbreadcrumbClick={goToUpPage}>
163-
<svelte:fragment slot="icon">
162+
{#snippet icon()}
164163
<div class="rounded-full w-8 h-8 flex items-center justify-center">
165164
<Fa size="1.125x" class="text-[var(--pd-content-header-icon)]" icon={faPlus} />
166165
</div>
167-
</svelte:fragment>
168-
<svelte:fragment slot="content">
166+
{/snippet}
167+
{#snippet content()}
169168
<div class="flex flex-col w-full">
170169
<!-- warning machine resources -->
171170
{#if containerProviderConnection}
@@ -211,7 +210,6 @@ export function goToUpPage(): void {
211210
<label for="containerPort" class="pt-4 block mb-2 font-bold text-[var(--pd-content-card-header-text)]"
212211
>Container port</label>
213212
<Input
214-
type="number"
215213
value={String(containerPort ?? 0)}
216214
on:input={onContainerPortInput}
217215
class="w-full"
@@ -220,6 +218,7 @@ export function goToUpPage(): void {
220218
aria-label="Port input"
221219
disabled={loading}
222220
required />
221+
<!-- Removed "type" above, svelte 5 "Input" no longer uses it -->
223222
</div>
224223
{#if errorMsg !== undefined || !containerProviderConnection}
225224
<ErrorMessage error={errorMsg ?? 'No running container engine found'} />
@@ -248,5 +247,5 @@ export function goToUpPage(): void {
248247
</footer>
249248
</div>
250249
</div>
251-
</svelte:fragment>
250+
{/snippet}
252251
</FormPage>

packages/frontend/src/pages/Dashboard.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ const openDiscussionsPage = (): void => {
5050
</script>
5151

5252
<NavPage title="Welcome to Podman AI Lab" searchEnabled={false}>
53-
<svelte:fragment slot="additional-actions">
53+
{#snippet additionalActions()}
5454
<Button type="secondary" title="Open GitHub repository" on:click={openGithub} icon={faGithub}>Github</Button>
55-
</svelte:fragment>
56-
<svelte:fragment slot="content">
55+
{/snippet}
56+
{#snippet content()}
5757
<div class="flex flex-col min-w-full min-h-full text-[var(--pd-details-body-text)]">
5858
<div class="mt-4 px-5 space-y-5" aria-label="inner-content">
5959
<DashboardBanner class="rounded-md my-2 w-full" />
@@ -117,5 +117,5 @@ const openDiscussionsPage = (): void => {
117117
</p>
118118
</div>
119119
</div>
120-
</svelte:fragment>
120+
{/snippet}
121121
</NavPage>

packages/frontend/src/pages/ImportModel.svelte

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,14 @@ function handleDragLeave(): void {
108108
title="Import Model"
109109
breadcrumbLeftPart="Models"
110110
breadcrumbRightPart="Import Model"
111-
breadcrumbTitle="Go back to Models Catalog"
112111
onclose={goToUpPage}
113112
onbreadcrumbClick={goToUpPage}>
114-
<svelte:fragment slot="icon">
113+
{#snippet icon()}
115114
<div class="rounded-full w-8 h-8 flex items-center justify-center">
116115
<Fa size="1.125x" class="text-[var(--pd-content-header-icon)]" icon={faFileImport} />
117116
</div>
118-
</svelte:fragment>
119-
<svelte:fragment slot="content">
117+
{/snippet}
118+
{#snippet content()}
120119
<div class="flex m-5 flex-col w-full">
121120
<!-- Error banner -->
122121
<div aria-label="importError">
@@ -197,5 +196,5 @@ function handleDragLeave(): void {
197196
</div>
198197
</div>
199198
</div>
200-
</svelte:fragment>
199+
{/snippet}
201200
</FormPage>

packages/frontend/src/pages/InferenceServerDetails.svelte

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,29 +199,29 @@ function handleOnChange(): void {
199199
title="Service details"
200200
breadcrumbLeftPart="Model Services"
201201
breadcrumbRightPart="Service details"
202-
breadcrumbTitle="Go back to Model Services"
203202
onclose={goToUpPage}
204203
onbreadcrumbClick={goToUpPage}>
205-
<svelte:fragment slot="icon">
204+
<!-- Removed breadcrumbTitle above, no longer needed for svelte 5 detailspage -->
205+
{#snippet iconSnippet()}
206206
<div class="mr-3">
207207
{#if service !== undefined}
208208
<ServiceStatus object={service} />
209209
{/if}
210210
</div>
211-
</svelte:fragment>
212-
<svelte:fragment slot="subtitle">
211+
{/snippet}
212+
{#snippet subtitleSnippet()}
213213
<div class="flex gap-x-2 items-center text-[var(--pd-content-sub-header)]">
214214
{#if service}
215215
<span class="text-xs">{service.container.containerId}</span>
216216
{/if}
217217
</div>
218-
</svelte:fragment>
219-
<svelte:fragment slot="actions">
218+
{/snippet}
219+
{#snippet actionsSnippet()}
220220
{#if service !== undefined}
221221
<ServiceAction detailed object={service} />
222222
{/if}
223-
</svelte:fragment>
224-
<svelte:fragment slot="content">
223+
{/snippet}
224+
{#snippet contentSnippet()}
225225
<div class="h-full overflow-y-auto bg-[var(--pd-content-bg)]">
226226
<div class="flex flex-col min-w-full min-h-full">
227227
<div class="min-w-full min-h-full flex-1">
@@ -402,5 +402,5 @@ function handleOnChange(): void {
402402
</div>
403403
</div>
404404
</div>
405-
</svelte:fragment>
405+
{/snippet}
406406
</DetailsPage>

packages/frontend/src/pages/InferenceServers.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ function createNewService(): void {
4747
</script>
4848

4949
<NavPage title="Model Services" searchEnabled={false}>
50-
<svelte:fragment slot="additional-actions">
50+
{#snippet additionalActions()}
5151
{#if selectedItemsNumber > 0}
5252
<Button title="Delete selected items" on:click={deleteSelected} icon={faTrash}
5353
>Delete {selectedItemsNumber} selected items</Button>
5454
{/if}
5555
<Button icon={faPlusCircle} title="Create a new model service" on:click={createNewService}
5656
>New Model Service</Button>
57-
</svelte:fragment>
58-
<svelte:fragment slot="content">
57+
{/snippet}
58+
{#snippet content()}
5959
<div class="flex min-w-full min-h-full">
6060
{#if data?.length > 0}
6161
<Table kind="service" data={data} columns={columns} row={row} bind:selectedItemsNumber={selectedItemsNumber} />
@@ -70,5 +70,5 @@ function createNewService(): void {
7070
</EmptyScreen>
7171
{/if}
7272
</div>
73-
</svelte:fragment>
73+
{/snippet}
7474
</NavPage>

0 commit comments

Comments
 (0)