@exagone313/dsh-podman 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/card-route.d.ts +2 -1
  2. package/dist/card-route.js +89 -6
  3. package/dist/client/ContainerCard.js +1 -1
  4. package/dist/client/card-protocol.d.ts +12 -1
  5. package/dist/client/card-protocol.js +20 -0
  6. package/dist/client/container-card-controller.d.ts +5 -1
  7. package/dist/client/container-card-controller.js +12 -1
  8. package/dist/client/container-card-create-modal.js +14 -12
  9. package/dist/client/container-card-images.d.ts +9 -0
  10. package/dist/client/container-card-images.js +25 -3
  11. package/dist/client/container-card-ptc-section.d.ts +11 -0
  12. package/dist/client/container-card-ptc-section.js +36 -0
  13. package/dist/client/container-card-ptc.d.ts +69 -0
  14. package/dist/client/container-card-ptc.js +148 -0
  15. package/dist/client/container-card-resources.d.ts +1 -0
  16. package/dist/client/container-card-resources.js +13 -8
  17. package/dist/client/container-card-row.js +4 -2
  18. package/dist/client/container-card-shared.d.ts +1 -0
  19. package/dist/client/container-card-shared.js +4 -3
  20. package/dist/client/container-card-status.d.ts +6 -0
  21. package/dist/client/container-card-status.js +18 -14
  22. package/dist/client/index.js +832 -511
  23. package/dist/client/locales.d.ts +1 -1
  24. package/dist/client/locales.js +20 -0
  25. package/dist/client/relative-time.d.ts +2 -2
  26. package/dist/client/relative-time.js +8 -7
  27. package/dist/container-kind.d.ts +10 -0
  28. package/dist/container-kind.js +38 -0
  29. package/dist/dsh-version.d.ts +2 -0
  30. package/dist/dsh-version.js +33 -0
  31. package/dist/generated/version.d.ts +2 -2
  32. package/dist/generated/version.js +2 -2
  33. package/dist/grpc/proto/dshctl/v1/control.proto +35 -7
  34. package/dist/grpc/proto/dshguest/v1/guest.proto +17 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +1 -1
  37. package/dist/public.d.ts +2 -0
  38. package/dist/public.js +19 -0
  39. package/dist/subprocess.js +271 -105
  40. package/dist/tool-handlers.js +12 -13
  41. package/dist/workspace-binding.d.ts +2 -0
  42. package/dist/workspace-binding.js +54 -11
  43. package/docs/configuration.md +6 -5
  44. package/docs/configuration.zh.md +6 -5
  45. package/docs/usage.md +37 -1
  46. package/docs/usage.zh.md +31 -1
  47. package/package.json +1 -1
@@ -0,0 +1,148 @@
1
+ // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
2
+ //
3
+ // SPDX-License-Identifier: MIT
4
+ import { PTC_CONTAINER_NAME, PTC_IMAGE_ID, } from "./card-protocol.js";
5
+ export { PTC_CONTAINER_NAME, PTC_IMAGE_ID };
6
+ // The one name the orchestrator reserves for a workspace's default container.
7
+ export const DEFAULT_CONTAINER_NAME = "default";
8
+ const RESERVED_CONTAINER_NAMES = [
9
+ DEFAULT_CONTAINER_NAME,
10
+ PTC_CONTAINER_NAME,
11
+ ];
12
+ // reservedContainerName names the reserved container a typed name would claim,
13
+ // or undefined for a name the create form may offer.
14
+ export function reservedContainerName(name) {
15
+ return RESERVED_CONTAINER_NAMES.find((reserved) => reserved === name);
16
+ }
17
+ // The translation key the PTC marker reads through. It stays a dictionary entry
18
+ // even though both languages spell it "PTC", so every visible string has one.
19
+ export const PTC_CHIP_KEY = "containerKindPtc";
20
+ // The marker repeats the container kind in the violet tone tmpfs already uses.
21
+ export const PTC_CHIP_TONE = "violet";
22
+ // The phrase the shared PTC container's state reads with. Absent is the normal
23
+ // state before the container is created on its first use, not an error, so it
24
+ // reads as Missing rather than as an absence the user has to interpret.
25
+ export function ptcStateLabel(t, state) {
26
+ if (state === "running")
27
+ return t("statusRunning");
28
+ if (state === "stopped")
29
+ return t("statusStopped");
30
+ return t("statusMissing");
31
+ }
32
+ // The status chip of the shared container: a running one is fine and a stopped
33
+ // one is neutral, while an absent one is Missing in the muted tone — explicitly
34
+ // not the error red, since the container is created lazily on first use. The
35
+ // sentence explaining that laziness is the chip's tooltip rather than a line of
36
+ // its own.
37
+ export function ptcStatusChip(t, state) {
38
+ const chip = {
39
+ key: "state",
40
+ tone: state === "running" ? "ok" : "muted",
41
+ label: ptcStateLabel(t, state),
42
+ };
43
+ return state === "absent" ? { ...chip, title: t("ptcMissing") } : chip;
44
+ }
45
+ // The marker chip every PTC row carries. Its tooltip says which PTC object the
46
+ // row describes, because the three-letter marker alone does not.
47
+ export function ptcChip(t, titleKey) {
48
+ return {
49
+ key: "ptc",
50
+ tone: PTC_CHIP_TONE,
51
+ label: t(PTC_CHIP_KEY),
52
+ title: t(titleKey),
53
+ };
54
+ }
55
+ // The PTC card's chips, in the order it renders them: the container's state,
56
+ // then the violet marker with the container's tooltip.
57
+ export function ptcChips(t, state) {
58
+ return [
59
+ ptcStatusChip(t, state),
60
+ ptcChip(t, "ptcContainerTooltip"),
61
+ ];
62
+ }
63
+ // The PTC card's actions, in order: Recreate (the workspace-less remove
64
+ // followed by the ensure) and the destructive Remove. The container has no
65
+ // editable field, so both act on its fixed identity.
66
+ export function ptcActionViews(t, containerName) {
67
+ return [
68
+ {
69
+ key: "recreate",
70
+ op: "ptc_recreate",
71
+ label: t("recreate"),
72
+ title: t("recreatePtcTitle"),
73
+ description: t("confirmRecreatePtc", { container: containerName }),
74
+ destructive: false,
75
+ },
76
+ {
77
+ key: "remove",
78
+ op: "ptc_remove",
79
+ label: t("remove"),
80
+ title: t("removePtcTitle"),
81
+ description: t("confirmRemovePtc", { container: containerName }),
82
+ destructive: true,
83
+ },
84
+ ];
85
+ }
86
+ // Whether an image is the one reserved for the shared PTC container.
87
+ export function isPtcImage(imageId) {
88
+ return imageId === PTC_IMAGE_ID;
89
+ }
90
+ // buildParentImages lists the images a custom-image build may choose as its
91
+ // parent: every image except the reserved PTC one, in snapshot order. The PTC
92
+ // image keeps its row in the base card, but the orchestrator owns its single
93
+ // on-demand build, so no build form may offer it as a parent.
94
+ export function buildParentImages(images) {
95
+ return images.filter((image) => !isPtcImage(image.imageId));
96
+ }
97
+ // orderedImages lists the snapshot's images with the reserved PTC image last:
98
+ // the order a card fills itself from, so the base card can append the PTC row
99
+ // after the images it lists while the custom card never sees it.
100
+ export function orderedImages(images) {
101
+ return [
102
+ ...buildParentImages(images),
103
+ ...images.filter((image) => isPtcImage(image.imageId)),
104
+ ];
105
+ }
106
+ export function imageCardRows(images) {
107
+ const listed = orderedImages(images);
108
+ const ptc = listed.find((image) => isPtcImage(image.imageId));
109
+ const editable = listed.filter((image) => !isPtcImage(image.imageId));
110
+ const base = editable.filter((image) => image.isBase);
111
+ const custom = editable.filter((image) => !image.isBase);
112
+ return {
113
+ editable,
114
+ base,
115
+ ptc,
116
+ custom,
117
+ baseCount: base.length + (ptc === undefined ? 0 : 1),
118
+ customCount: custom.length,
119
+ };
120
+ }
121
+ export function ptcImageRow(t, image) {
122
+ const built = image.status === "built";
123
+ const parent = image.parent ?? "";
124
+ return {
125
+ imageId: image.imageId,
126
+ builtAt: image.builtAt ?? "",
127
+ // The PTC image names its parent as the primitive it builds from; a row
128
+ // that only carries that primitive still shows it rather than an empty
129
+ // field.
130
+ parent: parent !== "" ? parent : image.primitive ?? "",
131
+ chips: [
132
+ {
133
+ key: "state",
134
+ tone: built ? "ok" : "error",
135
+ label: built ? t("statusBuilt") : t("statusMissing"),
136
+ },
137
+ ptcChip(t, "ptcImageTooltip"),
138
+ ],
139
+ // A missing PTC image is built through the container's ensure (which
140
+ // creates the container too), while an existing one is only rebuilt.
141
+ build: { label: built ? t("rebuildImage") : t("build") },
142
+ setDefault: {
143
+ disabled: true,
144
+ label: t("setDefaultImage"),
145
+ tooltip: t("ptcImageReserved"),
146
+ },
147
+ };
148
+ }
@@ -15,6 +15,7 @@ export declare function ImagesSection(props: {
15
15
  onPullBaseImage: (name: string) => void;
16
16
  onRemoveImage: (imageId: string) => void;
17
17
  onRebuildImage: (imageId: string) => void;
18
+ onBuildPtcImage: () => void;
18
19
  onSetDefaultImage: (name: string) => void;
19
20
  }): ReactNode;
20
21
  export declare function StorageSection(props: {
@@ -6,19 +6,20 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
6
6
  // Storage the volumes, secrets and package caches the container references.
7
7
  // They are separate tabs because choosing an image and freeing storage are
8
8
  // different tasks even though both act on the same build machinery.
9
- import { BaseImageRow, ImageBuildModal, ImageItem, } from "./container-card-images.js";
9
+ import { BaseImageRow, ImageBuildModal, ImageItem, PtcImageRow, } from "./container-card-images.js";
10
10
  import { CachesSection } from "./container-card-caches.js";
11
11
  import { SecretsSection } from "./container-card-secrets.js";
12
12
  import { VolumesSection } from "./container-card-volumes.js";
13
13
  import { CardGroup } from "./container-card-group.js";
14
14
  import { countLabel } from "./container-card-shared.js";
15
+ import { buildParentImages, imageCardRows } from "./container-card-ptc.js";
15
16
  import { TABLE_CARD_CLASS } from "./container-card-table-styles.js";
16
17
  import { actionRow, cardList, emphasisAction, hint, } from "./container-card-styles.js";
17
18
  import { bareActionKey } from "./card-protocol.js";
18
19
  import { Button, RiskConfirmation, } from "@deepseek-ai/dsh-client-ui-primitives";
19
20
  import { useState } from "react";
20
21
  export function ImagesSection(props) {
21
- const { t, images, busy, pendingActions, defaultImage, locale, onBuildImage, onRebuildAllImages, onRebuildBaseImage, onPullBaseImage, onRemoveImage, onRebuildImage, onSetDefaultImage, } = props;
22
+ const { t, images, busy, pendingActions, defaultImage, locale, onBuildImage, onRebuildAllImages, onRebuildBaseImage, onPullBaseImage, onRemoveImage, onRebuildImage, onBuildPtcImage, onSetDefaultImage, } = props;
22
23
  const [buildOpen, setBuildOpen] = useState(false);
23
24
  const [imageId, setImageId] = useState("");
24
25
  const [parent, setParent] = useState("");
@@ -26,16 +27,19 @@ export function ImagesSection(props) {
26
27
  const [rebuildAllOpen, setRebuildAllOpen] = useState(false);
27
28
  const [rebuildAllAcknowledged, setRebuildAllAcknowledged] = useState(false);
28
29
  const rebuildAllPending = pendingActions.includes(bareActionKey("image_rebuild_all"));
29
- const baseImages = images.filter((image) => image.isBase);
30
- const customImages = images.filter((image) => !image.isBase);
30
+ // The reserved PTC image is the base card's last row and never takes part in
31
+ // the editable image set: it is not a Build parent, a default or a removal
32
+ // target, though its own row carries the on-demand build action.
33
+ const { base: baseImages, ptc: ptcImage, custom: customImages, baseCount: baseImageCount, customCount: customImageCount, } = imageCardRows(images);
31
34
  // Rebuilding covers every image, so it acts on the image set as a whole and
32
35
  // stays on the tab's toolbar; building makes a custom image, so its action
33
36
  // lives on that card's own title row instead.
34
37
  const openBuild = () => {
35
38
  // A build always starts from a real image: the configured default when it is
36
39
  // still a candidate, and the first listed image otherwise. The parent field
37
- // then never opens on an empty choice.
38
- const candidates = [...baseImages, ...customImages].map((image) => image.imageId);
40
+ // then never opens on an empty choice, and the reserved PTC image is not a
41
+ // candidate.
42
+ const candidates = buildParentImages(images).map((image) => image.imageId);
39
43
  setImageId("");
40
44
  setParent(candidates.includes(defaultImage) ? defaultImage : candidates[0] ?? "");
41
45
  setPackages([]);
@@ -48,9 +52,10 @@ export function ImagesSection(props) {
48
52
  return (_jsxs(_Fragment, { children: [_jsx("div", { style: actionRow, children: _jsx(Button, { variant: "outline", size: "sm", disabled: rebuildAllPending,
49
53
  // A deliberate build action rather than a removal: it carries the
50
54
  // business state colour, so it is not read as a neutral control.
51
- style: emphasisAction.business, onClick: openRebuildAll, children: rebuildAllPending ? t("busy") : t("rebuildAllImages") }) }), _jsx(CardGroup, { title: t("baseImagesTitle"), summary: countLabel(t, baseImages.length, "countImageOne", "countImageMany"), hasContent: baseImages.length > 0, className: TABLE_CARD_CLASS, children: baseImages.length === 0
55
+ style: emphasisAction.business, onClick: openRebuildAll, children: rebuildAllPending ? t("busy") : t("rebuildAllImages") }) }), _jsx(CardGroup, { title: t("baseImagesTitle"), summary: countLabel(t, baseImageCount, "countImageOne", "countImageMany"), hasContent: baseImageCount > 0, className: TABLE_CARD_CLASS, children: baseImageCount === 0
52
56
  ? _jsx("p", { style: { ...hint, margin: 0 }, children: t("noBaseImages") })
53
- : (_jsx("div", { style: cardList, children: baseImages.map((image, index) => (_jsx(BaseImageRow, { t: t, image: image, defaultImage: defaultImage, locale: locale, last: index === baseImages.length - 1, pendingActions: pendingActions, onRebuild: onRebuildBaseImage, onPull: onPullBaseImage, onSetDefault: onSetDefaultImage }, image.imageId))) })) }), _jsx(CardGroup, { title: t("customImagesTitle"), summary: countLabel(t, customImages.length, "countImageOne", "countImageMany"), hasContent: customImages.length > 0, action: _jsx(Button, { variant: "primary", size: "sm", disabled: busy, onClick: openBuild, children: t("buildImage") }), className: TABLE_CARD_CLASS, children: customImages.length === 0
57
+ : (_jsxs("div", { style: cardList, children: [baseImages.map((image, index) => (_jsx(BaseImageRow, { t: t, image: image, defaultImage: defaultImage, locale: locale, last: index === baseImages.length - 1 &&
58
+ ptcImage === undefined, pendingActions: pendingActions, onRebuild: onRebuildBaseImage, onPull: onPullBaseImage, onSetDefault: onSetDefaultImage }, image.imageId))), ptcImage === undefined ? null : (_jsx(PtcImageRow, { t: t, image: ptcImage, locale: locale, last: true, pendingActions: pendingActions, onRebuild: onRebuildImage, onBuild: onBuildPtcImage }))] })) }), _jsx(CardGroup, { title: t("customImagesTitle"), summary: countLabel(t, customImageCount, "countImageOne", "countImageMany"), hasContent: customImageCount > 0, action: _jsx(Button, { variant: "primary", size: "sm", disabled: busy, onClick: openBuild, children: t("buildImage") }), className: TABLE_CARD_CLASS, children: customImageCount === 0
54
59
  ? _jsx("p", { style: { ...hint, margin: 0 }, children: t("noCustomImages") })
55
60
  : (_jsx("div", { style: cardList, children: customImages.map((image, index) => (_jsx(ImageItem, { t: t, image: image, defaultImage: defaultImage, locale: locale, last: index === customImages.length - 1, pendingActions: pendingActions, onRemove: onRemoveImage, onRebuild: onRebuildImage, onSetDefault: onSetDefaultImage }, image.imageId))) })) }), _jsx(RiskConfirmation, { open: rebuildAllOpen, title: t("rebuildAllImagesTitle"), description: t("confirmRebuildAllImages"), acknowledgeLabel: t("acknowledgeRebuildAllImages"), cancelLabel: t("cancel"), closeLabel: t("cancel"), confirmLabel: t("rebuildAllImages"), acknowledged: rebuildAllAcknowledged, disabled: rebuildAllPending, onAcknowledgedChange: setRebuildAllAcknowledged, onCancel: () => {
56
61
  setRebuildAllAcknowledged(false);
@@ -33,7 +33,8 @@ function NoEntries(props) {
33
33
  // makes the block taller. Edit opens the dialog holding every editor; its one
34
34
  // primary action applies the draft (rebuilding the container when the change
35
35
  // reaches what it runs, updating it in place otherwise) and Discard drops it.
36
- // Recreate rebuilds the container as it is, without touching the draft.
36
+ // Recreate rebuilds the container as it is, without touching the draft. The
37
+ // orchestrator-owned PTC container is rendered by its own card, never here.
37
38
  export function ContainerRow(props) {
38
39
  const { t, container, images, volumes, secrets, pendingActions, locale, last, writable, onRemove, onRecreate, onCreateSecret, onApplyContainerConfig, gatewayUnavailable, projectName, projectsRoot, directoryPicker, } = props;
39
40
  // The row edits one draft of the container's whole configuration and applies
@@ -122,7 +123,8 @@ export function ContainerRow(props) {
122
123
  ? _jsx(NoEntries, { t: t })
123
124
  : envEntries.map(([name, value]) => (_jsx(EnvRow, { t: t, mode: "view", name: name, value: value }, name))) }), _jsx(FieldGroup, { label: t("mountsTitle"), children: mounts.length === 0
124
125
  ? _jsx(NoEntries, { t: t })
125
- : mounts.map(({ mount, index }) => (_jsx(MountRow, { t: t, mode: "view", mount: mount, destination: container.mounts[index]?.destination ?? "" }, index))) }), _jsx(FieldGroup, { label: t("pathsTitle"), children: container.paths.length === 0
126
+ : mounts.map(({ mount, index }) => (_jsx(MountRow, { t: t, mode: "view", mount: mount, destination: container.mounts[index]?.destination ??
127
+ "" }, index))) }), _jsx(FieldGroup, { label: t("pathsTitle"), children: container.paths.length === 0
126
128
  ? _jsx(NoEntries, { t: t })
127
129
  : container.paths.map((path, index) => (_jsx(PathRow, { t: t, mode: "view", path: path }, index))) }), _jsx(FieldGroup, { label: t("containerSecretsTitle"), children: secretEnvEntries.length === 0
128
130
  ? _jsx(NoEntries, { t: t })
@@ -35,6 +35,7 @@ export type StatusTone = "ok" | "warn" | "error" | "business" | "violet" | "mute
35
35
  export declare function StatusChip(props: {
36
36
  tone: StatusTone;
37
37
  label: ReactNode;
38
+ title?: string;
38
39
  }): ReactNode;
39
40
  export declare function MountKindChip(props: {
40
41
  label: string;
@@ -102,10 +102,11 @@ const STATUS_TONES = {
102
102
  },
103
103
  };
104
104
  // A state chip: the words state the fact and the tone repeats it in colour, so
105
- // a failure is visible without relying on colour alone.
105
+ // a failure is visible without relying on colour alone. A chip whose word needs
106
+ // context carries that context as its tooltip, never as a second line of copy.
106
107
  export function StatusChip(props) {
107
- const { tone, label } = props;
108
- return _jsx("span", { style: { ...statusChip, ...STATUS_TONES[tone] }, children: label });
108
+ const { tone, label, title } = props;
109
+ return (_jsx("span", { style: { ...statusChip, ...STATUS_TONES[tone] }, title: title, children: label }));
109
110
  }
110
111
  // The short kind chip a mount row leads with. Its tone repeats the kind in
111
112
  // colour at a glance, while the chip's word still names it outright.
@@ -1,4 +1,5 @@
1
1
  import { type CardState } from "./container-card-controller.js";
2
+ import { type PtcView } from "./card-protocol.js";
2
3
  import { type Translate } from "./locales.js";
3
4
  import { type ReactNode } from "react";
4
5
  export declare function StatusSection(props: {
@@ -15,4 +16,9 @@ export declare function StatusSection(props: {
15
16
  gatewayVersion: string;
16
17
  gatewayCommit: string;
17
18
  gatewayVersionState: CardState["gatewayVersionState"];
19
+ ptc: PtcView;
20
+ locale: string;
21
+ pendingActions: readonly string[];
22
+ onRecreatePtc: () => void;
23
+ onRemovePtc: () => void;
18
24
  }): ReactNode;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
3
  //
4
4
  // SPDX-License-Identifier: MIT
@@ -8,9 +8,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
8
  // for a bug report. The State column carries the runtime state and, beside it,
9
9
  // the version comparison: a component the plugin runs alongside reads "ready"
10
10
  // plus "different versions", one the plugin cannot talk to reads "incompatible".
11
+ // Directly below the component card sits the shared PTC container's own card:
12
+ // it belongs to no workspace, so the Status tab is where its identity, image
13
+ // and actions live.
11
14
  // The reload that re-reads the snapshot sits at the bottom of the page, below
12
15
  // the tabs, so it stays reachable from every tab.
13
16
  import { CardGroup } from "./container-card-group.js";
17
+ import { PtcSection } from "./container-card-ptc-section.js";
14
18
  import { countLabel, StatusChip, Subsection, } from "./container-card-shared.js";
15
19
  import { TABLE_CARD_CLASS, TABLE_CLASS, } from "./container-card-table-styles.js";
16
20
  import { missingValue } from "./container-card-styles.js";
@@ -53,7 +57,7 @@ function versionNote(state) {
53
57
  return undefined;
54
58
  }
55
59
  export function StatusSection(props) {
56
- const { t, dshVersion, version, commit, versionState, orchestratorVersion, orchestratorCommit, orchestratorReady, orchestratorKnown, gatewayState, gatewayVersion, gatewayCommit, gatewayVersionState, } = props;
60
+ const { t, dshVersion, version, commit, versionState, orchestratorVersion, orchestratorCommit, orchestratorReady, orchestratorKnown, gatewayState, gatewayVersion, gatewayCommit, gatewayVersionState, ptc, locale, pendingActions, onRecreatePtc, onRemovePtc, } = props;
57
61
  const [copyState, setCopyState] = useState("idle");
58
62
  const copyResetTimer = useRef();
59
63
  // Copies the version lines as displayed, so a user can paste them into a bug
@@ -150,17 +154,17 @@ export function StatusSection(props) {
150
154
  commit: gatewayCommit,
151
155
  },
152
156
  ];
153
- return (_jsx(CardGroup, { title: t("groupStatusTitle"), summary: countLabel(t, knownVersions, "countVersionOne", "countVersionMany"),
154
- // The version table is always listed, so the card always has content.
155
- hasContent: true, className: TABLE_CARD_CLASS, children: _jsx(Subsection, { title: t("versionsTitle"), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void copyVersions(), children: copyState === "copied"
156
- ? t("copied")
157
- : copyState === "failed"
158
- ? t("copyFailed")
159
- : t("copyVersions") }), children: _jsxs("table", { className: TABLE_CLASS, style: versionTable, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: t("columnComponent") }), _jsx("th", { scope: "col", children: t("columnState") }), _jsx("th", { scope: "col", children: t("columnVersion") }), _jsx("th", { scope: "col", children: t("columnCommit") })] }) }), _jsx("tbody", { children: componentRows.map((row) => (_jsxs("tr", { children: [_jsx("td", { "data-label": t("columnComponent"), style: versionCell, children: row.component }), _jsx("td", { "data-label": t("columnState"), style: versionCell, children: _jsxs("span", { style: stateLine, children: [row.state === undefined
157
+ return (_jsxs(_Fragment, { children: [_jsx(CardGroup, { title: t("groupStatusTitle"), summary: countLabel(t, knownVersions, "countVersionOne", "countVersionMany"),
158
+ // The version table is always listed, so the card always has content.
159
+ hasContent: true, className: TABLE_CARD_CLASS, children: _jsx(Subsection, { title: t("versionsTitle"), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void copyVersions(), children: copyState === "copied"
160
+ ? t("copied")
161
+ : copyState === "failed"
162
+ ? t("copyFailed")
163
+ : t("copyVersions") }), children: _jsxs("table", { className: TABLE_CLASS, style: versionTable, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: t("columnComponent") }), _jsx("th", { scope: "col", children: t("columnState") }), _jsx("th", { scope: "col", children: t("columnVersion") }), _jsx("th", { scope: "col", children: t("columnCommit") })] }) }), _jsx("tbody", { children: componentRows.map((row) => (_jsxs("tr", { children: [_jsx("td", { "data-label": t("columnComponent"), style: versionCell, children: row.component }), _jsx("td", { "data-label": t("columnState"), style: versionCell, children: _jsxs("span", { style: stateLine, children: [row.state === undefined
164
+ ? _jsx("span", { style: missingValue, children: t("valueMissing") })
165
+ : (_jsx(StatusChip, { tone: row.state.tone, label: t(row.state.label) })), row.versionNote === undefined ? null : (_jsx(StatusChip, { tone: row.versionNote.tone, label: t(row.versionNote.label) }))] }) }), _jsx("td", { "data-label": t("columnVersion"), style: versionCell, children: row.version === ""
160
166
  ? _jsx("span", { style: missingValue, children: t("valueMissing") })
161
- : (_jsx(StatusChip, { tone: row.state.tone, label: t(row.state.label) })), row.versionNote === undefined ? null : (_jsx(StatusChip, { tone: row.versionNote.tone, label: t(row.versionNote.label) }))] }) }), _jsx("td", { "data-label": t("columnVersion"), style: versionCell, children: row.version === ""
162
- ? _jsx("span", { style: missingValue, children: t("valueMissing") })
163
- : row.version }), _jsx("td", { "data-label": t("columnCommit"), style: versionCommit, children: row.commit === ""
164
- ? _jsx("span", { style: missingValue, children: t("valueMissing") })
165
- : row.commit })] }, row.key))) })] }) }) }));
167
+ : row.version }), _jsx("td", { "data-label": t("columnCommit"), style: versionCommit, children: row.commit === ""
168
+ ? _jsx("span", { style: missingValue, children: t("valueMissing") })
169
+ : row.commit })] }, row.key))) })] }) }) }), _jsx(PtcSection, { t: t, ptc: ptc, locale: locale, pendingActions: pendingActions, onRecreate: onRecreatePtc, onRemove: onRemovePtc })] }));
166
170
  }