@exagone313/dsh-podman 1.2.1 → 1.3.0

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 (94) hide show
  1. package/dist/card-route.d.ts +8 -0
  2. package/dist/card-route.js +19 -8
  3. package/dist/client/ContainerCard.js +147 -110
  4. package/dist/client/card-protocol.d.ts +4 -0
  5. package/dist/client/card-protocol.js +34 -0
  6. package/dist/client/container-card-caches.d.ts +1 -1
  7. package/dist/client/container-card-caches.js +19 -17
  8. package/dist/client/container-card-config.d.ts +47 -0
  9. package/dist/client/container-card-config.js +160 -0
  10. package/dist/client/container-card-controller.d.ts +35 -3
  11. package/dist/client/container-card-controller.js +263 -41
  12. package/dist/client/container-card-create-modal.d.ts +5 -1
  13. package/dist/client/container-card-create-modal.js +111 -94
  14. package/dist/client/container-card-defaults.d.ts +16 -0
  15. package/dist/client/container-card-defaults.js +147 -0
  16. package/dist/client/container-card-dialog-styles.d.ts +7 -0
  17. package/dist/client/container-card-dialog-styles.js +70 -0
  18. package/dist/client/container-card-dialog.d.ts +12 -0
  19. package/dist/client/container-card-dialog.js +47 -0
  20. package/dist/client/container-card-directory-styles.d.ts +1 -1
  21. package/dist/client/container-card-directory-styles.js +5 -5
  22. package/dist/client/container-card-directory.js +8 -7
  23. package/dist/client/container-card-edit-modal.d.ts +39 -0
  24. package/dist/client/container-card-edit-modal.js +29 -0
  25. package/dist/client/container-card-editors.d.ts +5 -2
  26. package/dist/client/container-card-editors.js +109 -134
  27. package/dist/client/container-card-field-styles.d.ts +7 -0
  28. package/dist/client/container-card-field-styles.js +63 -0
  29. package/dist/client/container-card-form.d.ts +47 -0
  30. package/dist/client/container-card-form.js +61 -0
  31. package/dist/client/container-card-group.d.ts +9 -0
  32. package/dist/client/container-card-group.js +22 -0
  33. package/dist/client/container-card-images.d.ts +6 -2
  34. package/dist/client/container-card-images.js +63 -23
  35. package/dist/client/container-card-paths.js +43 -52
  36. package/dist/client/container-card-ports.d.ts +3 -4
  37. package/dist/client/container-card-ports.js +74 -38
  38. package/dist/client/container-card-resources.d.ts +38 -0
  39. package/dist/client/container-card-resources.js +73 -0
  40. package/dist/client/container-card-row.d.ts +11 -19
  41. package/dist/client/container-card-row.js +122 -122
  42. package/dist/client/container-card-secrets.d.ts +31 -3
  43. package/dist/client/container-card-secrets.js +174 -56
  44. package/dist/client/container-card-shared.d.ts +173 -6
  45. package/dist/client/container-card-shared.js +616 -57
  46. package/dist/client/container-card-status.d.ts +18 -0
  47. package/dist/client/container-card-status.js +166 -0
  48. package/dist/client/container-card-styles.d.ts +49 -7
  49. package/dist/client/container-card-styles.js +396 -40
  50. package/dist/client/container-card-table-styles.d.ts +15 -0
  51. package/dist/client/container-card-table-styles.js +237 -0
  52. package/dist/client/container-card-tabs-styles.d.ts +5 -0
  53. package/dist/client/container-card-tabs-styles.js +46 -0
  54. package/dist/client/container-card-toast.d.ts +5 -0
  55. package/dist/client/container-card-toast.js +10 -0
  56. package/dist/client/container-card-volumes.d.ts +1 -0
  57. package/dist/client/container-card-volumes.js +14 -19
  58. package/dist/client/container-card-workspace.d.ts +8 -12
  59. package/dist/client/container-card-workspace.js +76 -14
  60. package/dist/client/index.js +6488 -3474
  61. package/dist/client/locales.d.ts +10 -1
  62. package/dist/client/locales.js +268 -114
  63. package/dist/client/relative-time.d.ts +10 -0
  64. package/dist/client/relative-time.js +74 -0
  65. package/dist/client/slot-contract.d.ts +8 -0
  66. package/dist/client/tool-views.js +1 -1
  67. package/dist/container-env.js +1 -1
  68. package/dist/env-rows.d.ts +9 -11
  69. package/dist/env-rows.js +72 -40
  70. package/dist/generated/version.d.ts +2 -2
  71. package/dist/generated/version.js +2 -2
  72. package/dist/guest-terminal.js +1 -1
  73. package/dist/mount-enums.d.ts +11 -0
  74. package/dist/mount-enums.js +60 -0
  75. package/dist/subprocess.js +1 -1
  76. package/dist/terminal-sessions.js +2 -2
  77. package/dist/terminal-shells.js +1 -1
  78. package/dist/tool-handlers.js +1 -1
  79. package/dist/workspace-binding.js +2 -2
  80. package/docs/architecture.md +4 -4
  81. package/docs/architecture.zh.md +1 -1
  82. package/docs/configuration.md +26 -25
  83. package/docs/configuration.zh.md +13 -11
  84. package/docs/development-prompt.md +7 -7
  85. package/docs/development-prompt.zh.md +7 -7
  86. package/docs/development.md +20 -16
  87. package/docs/development.zh.md +17 -16
  88. package/docs/install-dsh-and-dsh-podman.md +13 -12
  89. package/docs/install-dsh-and-dsh-podman.zh.md +13 -9
  90. package/docs/usage.md +189 -39
  91. package/docs/usage.zh.md +148 -29
  92. package/package.json +5 -1
  93. package/dist/client/container-card-default-env.d.ts +0 -10
  94. package/dist/client/container-card-default-env.js +0 -69
@@ -1,6 +1,6 @@
1
1
  import { type ContainerCreateConfig, type ImageView, type WorkspaceView } from "./container-card-controller.js";
2
2
  import { type DirectoryPickerFace } from "./directory-picker.js";
3
- import type { Translate } from "./locales.js";
3
+ import { type Translate } from "./locales.js";
4
4
  import { type ReactNode } from "react";
5
5
  export declare function CreateContainerModal(props: {
6
6
  t: Translate;
@@ -13,12 +13,16 @@ export declare function CreateContainerModal(props: {
13
13
  name: string;
14
14
  }[];
15
15
  busy: boolean;
16
+ writable: boolean;
16
17
  defaultImage: string;
18
+ defaultEnv: Record<string, string>;
17
19
  projectsRoot: string;
18
20
  directoryPicker?: DirectoryPickerFace;
19
21
  named: boolean;
20
22
  existing: readonly string[];
23
+ gatewayUnavailable: boolean;
21
24
  open: boolean;
22
25
  onClose: () => void;
26
+ onCreateSecret: (name: string, length?: number, charset?: string) => void;
23
27
  onCreate: (container: string, config: ContainerCreateConfig) => void;
24
28
  }): ReactNode;
@@ -1,16 +1,18 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { EnvEditor, MountsEditor } from "./container-card-editors.js";
3
- import { PathsList } from "./container-card-paths.js";
4
- import { Field, namePattern, sanitizeName } from "./container-card-shared.js";
5
- import { greyId, hint, imageSelect, sectionTitle, } from "./container-card-styles.js";
6
- import { Button, Input, Modal } from "@deepseek-ai/dsh-client-ui-primitives";
7
- import { useEffect, useId, useState } from "react";
8
- export function CreateContainerModal(props) {
9
- const { t, workspace, images, volumes, secrets, busy, defaultImage, projectsRoot, directoryPicker, named, existing, open, onClose, onCreate, } = props;
10
- const [image, setImage] = useState(workspace.imageId || defaultImage);
11
- const [name, setName] = useState("");
12
- const [env, setEnv] = useState({});
13
- const [mounts, setMounts] = useState(() => [
2
+ import { configsEqual } from "./container-card-config.js";
3
+ import { ContainerDialog } from "./container-card-dialog.js";
4
+ import { ContainerForm } from "./container-card-form.js";
5
+ import { DiscardChangesModal, namePattern } from "./container-card-shared.js";
6
+ import { mergeDefaultEnv } from "../container-env.js";
7
+ import { orderedEnvRecord } from "../env-rows.js";
8
+ import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
9
+ import { useEffect, useRef, useState } from "react";
10
+ // The one name the orchestrator reserves for a workspace's default container.
11
+ const DEFAULT_CONTAINER_NAME = "default";
12
+ // The project mount every new container starts with; it is the pristine mount
13
+ // the draft is compared against for its dirty state.
14
+ function initialMounts(workspace) {
15
+ return [
14
16
  {
15
17
  kind: "project",
16
18
  project: workspace.projectName,
@@ -19,99 +21,114 @@ export function CreateContainerModal(props) {
19
21
  volume: "",
20
22
  secret: "",
21
23
  },
22
- ]);
23
- const [secretEnv, setSecretEnv] = useState({});
24
- const [paths, setPaths] = useState([]);
25
- const [attachSecret, setAttachSecret] = useState("");
26
- const [attachVar, setAttachVar] = useState("");
24
+ ];
25
+ }
26
+ // The draft an Add/Create dialog opens on: the workspace's image (or the
27
+ // configured default), its own project mount, and the workspace's default
28
+ // environment. The defaults are seeded so the values a new container inherits
29
+ // are visible: a value left alone keeps the default, and an edited one is sent
30
+ // as that container's own.
31
+ function initialConfig(workspace, defaultImage, defaultEnv) {
32
+ return {
33
+ image: workspace.imageId || defaultImage,
34
+ env: orderedEnvRecord(mergeDefaultEnv(defaultEnv, undefined)),
35
+ mounts: initialMounts(workspace),
36
+ paths: [],
37
+ secretEnv: {},
38
+ ports: [],
39
+ };
40
+ }
41
+ export function CreateContainerModal(props) {
42
+ const { t, workspace, images, volumes, secrets, busy, writable, defaultImage, defaultEnv, projectsRoot, directoryPicker, named, existing, gatewayUnavailable, open, onClose, onCreateSecret, onCreate, } = props;
43
+ const [draft, setDraft] = useState(() => initialConfig(workspace, defaultImage, defaultEnv));
44
+ const [name, setName] = useState("");
27
45
  const [submitting, setSubmitting] = useState(false);
28
- const imageLabel = useId();
29
- const nameLabel = useId();
46
+ const [confirmClose, setConfirmClose] = useState(false);
47
+ // A row the editors flagged as conflicting — unnamed or named twice — refuses
48
+ // the create; the footer says why until it is fixed or removed.
49
+ const [blockingError, setBlockingError] = useState(undefined);
50
+ // The dialog owns one draft for as long as it stays open. A snapshot refresh
51
+ // (a command settling, a secret created on top of this dialog) hands down new
52
+ // workspace and image objects, and adopting them then would drop every field
53
+ // the user has already typed; the draft is reset when the dialog opens, and
54
+ // only then.
55
+ const initialized = useRef(false);
30
56
  useEffect(() => {
31
- if (!open)
57
+ if (!open) {
58
+ initialized.current = false;
59
+ return;
60
+ }
61
+ if (initialized.current)
32
62
  return;
33
- setImage(workspace.imageId || defaultImage);
63
+ initialized.current = true;
64
+ setDraft(initialConfig(workspace, defaultImage, defaultEnv));
34
65
  setName("");
35
- setEnv({});
36
- setMounts([
37
- {
38
- kind: "project",
39
- project: workspace.projectName,
40
- destination: "",
41
- mode: "read_write",
42
- volume: "",
43
- secret: "",
44
- },
45
- ]);
46
- setSecretEnv({});
47
- setPaths([]);
48
- setAttachSecret("");
49
- setAttachVar("");
50
66
  setSubmitting(false);
51
- }, [open, workspace, defaultImage]);
52
- const baseImages = images.filter((image) => image.isBase);
53
- const customImages = images.filter((image) => !image.isBase);
54
- const candidates = [
55
- ...baseImages.map((image) => image.imageId),
56
- ...customImages.map((image) => image.imageId),
57
- ];
67
+ setConfirmClose(false);
68
+ }, [open, workspace, defaultImage, defaultEnv]);
69
+ const pristine = initialConfig(workspace, defaultImage, defaultEnv);
70
+ const reservedName = name === DEFAULT_CONTAINER_NAME;
58
71
  const nameTaken = existing.includes(name);
59
- const validName = namePattern.test(name) && name !== "default" && !nameTaken;
60
- const canCreate = !named || validName;
72
+ const namePatternOk = namePattern.test(name);
73
+ const nameValid = namePatternOk && !reservedName && !nameTaken;
74
+ // The name it already refuses: reserved, taken, or outside the allowed
75
+ // character set. Naming the rule is what lets the user fix it in place.
76
+ const nameError = name === ""
77
+ ? ""
78
+ : reservedName
79
+ ? t("containerNameReserved")
80
+ : nameTaken
81
+ ? t("containerNameTaken")
82
+ : namePatternOk
83
+ ? ""
84
+ : t("invalidContainerName");
85
+ const canCreate = !named || nameValid;
86
+ // Anything typed or picked since the dialog opened makes closing lose the
87
+ // draft, so the close is routed through the discard confirmation.
88
+ const dirty = name !== "" || !configsEqual(draft, pristine);
89
+ const requestClose = () => {
90
+ if (dirty)
91
+ setConfirmClose(true);
92
+ else
93
+ onClose();
94
+ };
95
+ const discardAndClose = () => {
96
+ setConfirmClose(false);
97
+ onClose();
98
+ };
61
99
  const submit = () => {
62
100
  if (!canCreate || submitting)
63
101
  return;
64
102
  setSubmitting(true);
65
103
  onCreate(named ? name : "", {
66
- image,
67
- env,
68
- mounts,
69
- paths: paths.map((entry) => entry.path).filter((path) => path !== ""),
70
- secretEnv,
104
+ image: draft.image,
105
+ env: draft.env,
106
+ mounts: [...draft.mounts],
107
+ paths: draft.paths.map((path) => path.trim()).filter((path) => path !== ""),
108
+ secretEnv: draft.secretEnv,
109
+ ports: [...draft.ports],
71
110
  });
72
111
  };
73
- const attach = () => {
74
- const envVar = attachVar.trim();
75
- if (envVar === "" || attachSecret === "")
76
- return;
77
- setSecretEnv({ ...secretEnv, [envVar]: attachSecret });
78
- setAttachVar("");
79
- };
80
- return (_jsx(Modal, { open: open, onClose: onClose, title: named ? t("addContainer") : t("createContainer"), closeLabel: t("cancel"), footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", size: "sm", onClick: onClose, children: t("cancel") }), _jsx(Button, { variant: "primary", size: "sm", disabled: !canCreate || submitting, onClick: submit, children: named ? t("addContainer") : t("createContainer") })] }), children: _jsxs("div", { style: {
81
- display: "flex",
82
- flexDirection: "column",
83
- gap: "12px",
84
- }, children: [_jsx(Field, { label: t("image"), htmlFor: imageLabel, children: _jsxs("select", { id: imageLabel, style: imageSelect, value: image, disabled: busy, onChange: (event) => setImage(event.target.value), children: [candidates.length === 0
85
- ? _jsx("option", { value: "", children: t("none") })
86
- : null, candidates.map((imageId) => (_jsx("option", { value: imageId, children: imageId }, imageId)))] }) }), named
87
- ? (_jsxs(Field, { label: t("containerName"), htmlFor: nameLabel, children: [_jsx(Input, { id: nameLabel, value: name, disabled: busy, onChange: (event) => setName(sanitizeName(event.target.value)) }), name !== "" && !validName
88
- ? (_jsx("p", { style: { ...hint, margin: 0 }, children: nameTaken
89
- ? t("containerNameTaken")
90
- : t("invalidContainerName") }))
91
- : null] }))
92
- : null, _jsx("div", { style: sectionTitle, children: t("envTitle") }), _jsx(EnvEditor, { t: t, env: env, busy: busy, onChange: setEnv }), _jsx("div", { style: sectionTitle, children: t("mountsTitle") }), _jsx(MountsEditor, { t: t, mounts: mounts, volumes: volumes, secrets: secrets, busy: busy, enabled: !busy, projectsRoot: projectsRoot, directoryPicker: directoryPicker, modeControl: "select", onAdd: (mount) => setMounts([...mounts, mount]), onRemove: (mount) => setMounts(mounts.filter((item) => item !== mount)), onUpdate: (updated, index) => setMounts(mounts.map((item, at) => (at === index ? updated : item))) }), _jsx("div", { style: sectionTitle, children: t("pathsTitle") }), _jsx(PathsList, { t: t, entries: paths, busy: busy, onChange: setPaths }), _jsx("div", { style: sectionTitle, children: t("containerSecretsTitle") }), Object.entries(secretEnv).map(([envVar, secretName]) => (_jsxs("div", { style: {
93
- display: "flex",
94
- flexWrap: "wrap",
95
- alignItems: "center",
96
- gap: "8px",
97
- }, children: [_jsxs("code", { style: {
98
- ...greyId,
99
- flex: 1,
100
- fontSize: "13px",
101
- color: "var(--dsw-alias-label-primary)",
102
- }, children: [envVar, "=", secretName] }), _jsx(Button, { variant: "outline", size: "sm", disabled: busy, onClick: () => {
103
- const next = { ...secretEnv };
104
- delete next[envVar];
105
- setSecretEnv(next);
106
- }, children: t("remove") })] }, envVar))), _jsxs("div", { style: {
107
- display: "flex",
108
- flexWrap: "wrap",
109
- alignItems: "center",
110
- gap: "8px",
111
- }, children: [_jsxs("select", { style: imageSelect, value: attachSecret, disabled: busy, onChange: (event) => setAttachSecret(event.target.value), "aria-label": t("attachSecret"), children: [secrets.length === 0
112
- ? _jsx("option", { value: "", children: t("none") })
113
- : null, secrets.map((secret) => (_jsx("option", { value: secret.name, children: secret.name }, secret.name)))] }), _jsx(Input, { value: attachVar, disabled: busy, placeholder: t("secretEnvName"), onChange: (event) => setAttachVar(event.target.value), onKeyDown: (event) => {
114
- if (event.key === "Enter")
115
- attach();
116
- }, style: { width: "200px" } }), _jsx(Button, { variant: "outline", size: "sm", disabled: busy || attachVar.trim() === "" || attachSecret === "", onClick: attach, children: t("attachSecret") })] })] }) }));
112
+ return (_jsxs(_Fragment, { children: [_jsx(ContainerDialog, { t: t, open: open, title: named ? t("addContainer") : t("createContainer"), onClose: requestClose, marker: blockingError === undefined
113
+ ? undefined
114
+ : t(blockingError.key, blockingError.params), markerError: blockingError !== undefined, actions: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", size: "sm", onClick: requestClose, children: t("cancel") }), _jsx(Button, { variant: "primary", size: "sm", disabled: !canCreate || submitting || blockingError !== undefined, onClick: submit, children: named ? t("addContainer") : t("createContainer") })] }), children: _jsx(ContainerForm, { t: t, image: draft.image, env: draft.env, mounts: draft.mounts, paths: draft.paths, secretEnv: draft.secretEnv, ports: draft.ports, images: images, volumes: volumes, secrets: secrets, busy: busy, enabled: !busy, canPublish: !busy && !gatewayUnavailable, gatewayUnavailable: gatewayUnavailable, writable: writable, projectsRoot: projectsRoot, directoryPicker: directoryPicker, mainProject: workspace.projectName,
115
+ // The workspace's default container always keeps its main project
116
+ // mount, so Create greys out its Remove; a named container (Add) keeps
117
+ // the mounts it was given, the seeded project one included.
118
+ primaryProject: named ? "" : workspace.projectName, onCreateSecret: onCreateSecret, onChangeImage: (image) => setDraft({ ...draft, image }), onChangeEnv: (env) => setDraft({ ...draft, env }), onChangeMounts: (mounts) => setDraft({ ...draft, mounts }), onChangePaths: (paths) => setDraft({ ...draft, paths }), onChangeSecretEnv: (secretEnv) => setDraft({ ...draft, secretEnv }), onChangePorts: (ports) => setDraft({ ...draft, ports }), onBlockingError: setBlockingError, name: named
119
+ ? {
120
+ value: name,
121
+ error: nameError,
122
+ readOnly: false,
123
+ disabled: busy,
124
+ onChange: setName,
125
+ }
126
+ : {
127
+ /* The workspace's default container is created under its one
128
+ reserved name, so the group states it instead of offering it. */
129
+ value: DEFAULT_CONTAINER_NAME,
130
+ error: "",
131
+ readOnly: true,
132
+ disabled: false,
133
+ } }) }), _jsx(DiscardChangesModal, { t: t, open: confirmClose, onCancel: () => setConfirmClose(false), onDiscard: discardAndClose })] }));
117
134
  }
@@ -0,0 +1,16 @@
1
+ import { type ContainerView, type ImageView, type WorkspaceView } from "./container-card-controller.js";
2
+ import type { Translate } from "./locales.js";
3
+ import { type ReactNode } from "react";
4
+ export declare function DefaultsSection(props: {
5
+ t: Translate;
6
+ images: readonly ImageView[];
7
+ defaultImage: string;
8
+ env: Record<string, string>;
9
+ workspaces: readonly WorkspaceView[];
10
+ containers: readonly ContainerView[];
11
+ busy: boolean;
12
+ writable: boolean;
13
+ onSetDefaultImage: (name: string) => void;
14
+ onSaveEnv: (env: Record<string, string>) => void;
15
+ onApplyDefaultEnv: (workspace: string) => void;
16
+ }): ReactNode;
@@ -0,0 +1,147 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
+ //
4
+ // SPDX-License-Identifier: MIT
5
+ // The Defaults tab: the image and the environment every new container starts
6
+ // from, plus the one action that applies the environment to existing
7
+ // containers. All of it is one card with one Save and one Discard, so a default
8
+ // image and a default variable are committed together or not at all.
9
+ import { EnvEditor } from "./container-card-editors.js";
10
+ import { COMPACT_DIALOG_CLASS } from "./container-card-dialog-styles.js";
11
+ import { CardGroup } from "./container-card-group.js";
12
+ import { CopyField, countLabel, Field } from "./container-card-shared.js";
13
+ import { TABLE_CARD_CLASS } from "./container-card-table-styles.js";
14
+ import { actionRow, dirtyBadgeSlot, editorGroup, editorTitle, emphasisAction, envFieldLabel, envRow, fieldSelect, footerStack, hint, rowActions, rowMain, } from "./container-card-styles.js";
15
+ import { commitIdentityAction, missingDefaultEnv, readGitIdentity, setGitIdentity, } from "../container-env.js";
16
+ import { Button, Input, Modal } from "@deepseek-ai/dsh-client-ui-primitives";
17
+ import { useEffect, useId, useState } from "react";
18
+ export function DefaultsSection(props) {
19
+ const { t, images, defaultImage, env, workspaces, containers, busy, writable, onSetDefaultImage, onSaveEnv, onApplyDefaultEnv, } = props;
20
+ // One draft holds both defaults: the image and the environment. Either Save
21
+ // commits them, either Discard drops them.
22
+ const [image, setImage] = useState(defaultImage);
23
+ const [envDraft, setEnvDraft] = useState(env);
24
+ const [gitOpen, setGitOpen] = useState(false);
25
+ const [gitName, setGitName] = useState("");
26
+ const [gitEmail, setGitEmail] = useState("");
27
+ // The apply dialog's target: "" applies to every container, a workspace slug
28
+ // narrows it to that workspace's containers.
29
+ const [syncOpen, setSyncOpen] = useState(false);
30
+ const [syncTarget, setSyncTarget] = useState("");
31
+ const imageId = useId();
32
+ const gitNameId = useId();
33
+ const gitEmailId = useId();
34
+ const syncTargetId = useId();
35
+ // An external settings change resyncs its half of the draft; an unrelated
36
+ // refresh does not, so an edit in progress is never clobbered.
37
+ useEffect(() => {
38
+ setImage(defaultImage);
39
+ }, [defaultImage]);
40
+ const serverEnv = JSON.stringify(env);
41
+ useEffect(() => {
42
+ setEnvDraft(env);
43
+ }, [serverEnv]);
44
+ const imageDirty = image !== defaultImage;
45
+ const envDirty = JSON.stringify(envDraft) !== serverEnv;
46
+ const dirty = imageDirty || envDirty;
47
+ const disabled = busy || !writable;
48
+ const candidates = [
49
+ ...images.filter((candidate) => candidate.isBase),
50
+ ...images.filter((candidate) => !candidate.isBase),
51
+ ].map((candidate) => candidate.imageId);
52
+ // With no explicit default, the host falls back to the first base image
53
+ // (archlinux in the shipped catalog), so the card shows that effective default
54
+ // rather than an empty field. The snapshot's base images come in the
55
+ // catalog's own listing order, which is what the host resolves.
56
+ const baseImages = images.filter((candidate) => candidate.isBase);
57
+ const explicitDefault = defaultImage !== "";
58
+ const effectiveDefault = explicitDefault
59
+ ? defaultImage
60
+ : baseImages[0]?.imageId ?? "";
61
+ // The value the select shows: the draft, or the effective default while the
62
+ // draft is still empty. Reading the effective default here (instead of
63
+ // rendering a second option for it) is what keeps a single copy of it in the
64
+ // option list.
65
+ const selected = image === "" ? effectiveDefault : image;
66
+ const save = () => {
67
+ if (imageDirty)
68
+ onSetDefaultImage(image);
69
+ if (envDirty)
70
+ onSaveEnv(envDraft);
71
+ };
72
+ const discard = () => {
73
+ setImage(defaultImage);
74
+ setEnvDraft(env);
75
+ };
76
+ // The identity popup applies into the same draft, so the card's Save stays
77
+ // the single commit; when it restores the persisted environment exactly, its
78
+ // pending change is dropped instead of left as a no-op edit.
79
+ const commitIdentity = (next) => {
80
+ const action = commitIdentityAction(env, envDraft, next);
81
+ setEnvDraft(action === "discard" ? env : next);
82
+ };
83
+ const openGit = () => {
84
+ const identity = readGitIdentity(envDraft);
85
+ setGitName(identity.name);
86
+ setGitEmail(identity.email);
87
+ setGitOpen(true);
88
+ };
89
+ // The sync dialog only offers the workspaces that hold a container.
90
+ const containersByWorkspace = new Map();
91
+ for (const container of containers) {
92
+ containersByWorkspace.set(container.workspaceSlug, (containersByWorkspace.get(container.workspaceSlug) ?? 0) + 1);
93
+ }
94
+ const targetWorkspaces = workspaces.filter((workspace) => (containersByWorkspace.get(workspace.workspaceSlug) ?? 0) > 0);
95
+ // What the chosen target still lacks: a default is listed when at least one
96
+ // targeted container does not carry it, and only a container missing
97
+ // something is counted, so the dialog names exactly what the sync would add.
98
+ const targetContainers = syncTarget === ""
99
+ ? containers
100
+ : containers.filter((container) => container.workspaceSlug === syncTarget);
101
+ const missingByContainer = targetContainers.map((container) => missingDefaultEnv(env, container.env));
102
+ const missingVars = Object.keys(env)
103
+ .filter((key) => missingByContainer.some((missing) => missing[key] !== undefined))
104
+ .map((key) => [key, env[key]]);
105
+ const targetCount = missingByContainer.filter((missing) => Object.keys(missing).length > 0).length;
106
+ const openSync = () => {
107
+ setSyncTarget("");
108
+ setSyncOpen(true);
109
+ };
110
+ return (_jsxs(CardGroup, { title: t("groupDefaultsTitle"), summary: "",
111
+ // The default image and the environment are always shown, so the card
112
+ // always has content.
113
+ hasContent: true,
114
+ // The card is the containment context the environment rows' narrow layout
115
+ // keys off, the same one the tables use.
116
+ className: TABLE_CARD_CLASS, children: [_jsxs("div", { style: editorGroup, children: [_jsx("label", { htmlFor: imageId, style: envFieldLabel, children: t("defaultImage") }), _jsxs("select", { id: imageId,
117
+ // A form field, not a toolbar control: it fills the card so a long
118
+ // image id is never clipped.
119
+ style: { ...fieldSelect, maxWidth: "none" }, value: selected, disabled: disabled, onChange: (event) => setImage(event.target.value), children: [selected !== "" && candidates.includes(selected)
120
+ ? null
121
+ : (_jsx("option", { value: selected, children: selected === "" ? t("noDefaultImage") : selected })), candidates.map((candidate) => (_jsx("option", { value: candidate, children: candidate }, candidate)))] })] }), _jsxs("div", { style: editorGroup, children: [_jsxs("div", { style: actionRow, children: [_jsx("div", { style: rowMain, children: _jsx("h4", { style: editorTitle, children: t("defaultEnvironment") }) }), _jsxs("div", { style: rowActions, children: [_jsx(Button, { variant: "outline", size: "sm", disabled: disabled,
122
+ // The identity popup is a recommended setup step rather than a
123
+ // neutral control, so it carries the success state colour, the
124
+ // same emphasis a completed recommendation uses.
125
+ style: emphasisAction.success, onClick: openGit, children: t("gitIdentity") }), _jsx(Button, { variant: "outline", size: "sm", disabled: busy,
126
+ // Applying the defaults is a deliberate action rather than a
127
+ // neutral one, so it carries the business state colour, the same
128
+ // emphasis "Rebuild all images" uses.
129
+ style: emphasisAction.business, onClick: openSync, children: t("addMissingVars") })] })] }), _jsx(EnvEditor, { t: t, env: envDraft, busy: disabled, onChange: setEnvDraft })] }), _jsxs("div", { style: footerStack, children: [_jsx("div", { style: { ...actionRow, justifyContent: "flex-end" }, children: _jsxs("div", { style: rowActions, children: [_jsx(Button, { variant: "primary", size: "sm", disabled: disabled || !dirty, onClick: save, children: t("save") }), _jsx(Button, { variant: "ghost", size: "sm", disabled: busy || !dirty, onClick: discard, children: t("discard") })] }) }), _jsx("span", { style: dirtyBadgeSlot, children: dirty ? t("unsavedChanges") : "" })] }), _jsx(Modal, { open: gitOpen, onClose: () => setGitOpen(false), title: t("gitIdentity"), closeLabel: t("cancel"), footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setGitOpen(false), children: t("cancel") }), _jsx(Button, { variant: "primary", size: "sm", disabled: busy || gitName === "" || gitEmail === "", onClick: () => {
130
+ commitIdentity(setGitIdentity(envDraft, gitName, gitEmail));
131
+ setGitOpen(false);
132
+ }, children: t("apply") })] }), children: _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [_jsx(Field, { label: t("gitName"), htmlFor: gitNameId, children: _jsx(Input, { id: gitNameId, value: gitName, disabled: busy, onChange: (event) => setGitName(event.target.value) }) }), _jsx(Field, { label: t("gitEmail"), htmlFor: gitEmailId, children: _jsx(Input, { id: gitEmailId, value: gitEmail, disabled: busy, onChange: (event) => setGitEmail(event.target.value) }) })] }) }), _jsx(Modal, { open: syncOpen, onClose: () => setSyncOpen(false), title: t("addMissingVars"), closeLabel: t("cancel"), className: COMPACT_DIALOG_CLASS, footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setSyncOpen(false), children: t("cancel") }), _jsx(Button, { variant: "primary", size: "sm", disabled: busy || missingVars.length === 0, onClick: () => {
133
+ onApplyDefaultEnv(syncTarget);
134
+ setSyncOpen(false);
135
+ }, children: t("addMissingVarsApply", {
136
+ containers: countLabel(t, targetCount, "countContainerOne", "countContainerMany"),
137
+ }) })] }), children: _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [_jsx(Field, { label: t("applyTo"), htmlFor: syncTargetId, children: _jsxs("select", { id: syncTargetId, style: fieldSelect, value: syncTarget, disabled: busy, onChange: (event) => setSyncTarget(event.target.value), children: [_jsx("option", { value: "", children: t("allContainers") }), targetWorkspaces.map((workspace) => (_jsx("option", { value: workspace.workspaceSlug, children: workspace.projectName }, workspace.workspaceSlug)))] }) }), _jsxs("div", { style: editorGroup, children: [_jsx("span", { style: envFieldLabel, children: t("variablesToAdd") }), missingVars.length === 0
138
+ ? _jsx("span", { style: { ...hint, margin: 0 }, children: t("none") })
139
+ : (_jsx("ul", { style: {
140
+ margin: 0,
141
+ padding: 0,
142
+ listStyle: "none",
143
+ display: "flex",
144
+ flexDirection: "column",
145
+ gap: "8px",
146
+ }, children: missingVars.map(([key, value]) => (_jsxs("li", { style: envRow, children: [_jsx(CopyField, { t: t, label: t("envKey"), value: key, copyLabel: t("copyEnvKey", { key }) }), _jsx(CopyField, { t: t, label: t("envValue"), value: value, copyLabel: t("copyEnvValue", { key }) })] }, key))) }))] })] }) })] }));
147
+ }
@@ -0,0 +1,7 @@
1
+ import type { Context as ClientContext } from "@deepseek-ai/cordis";
2
+ export declare const CONTAINER_DIALOG_CLASS = "dsh-podman-container-dialog";
3
+ export declare const CONTAINER_DIALOG_CONTENT_CLASS = "dsh-podman-container-dialog-content";
4
+ export declare const COMPACT_DIALOG_CLASS = "dsh-podman-compact-dialog";
5
+ export declare const CONTAINER_DIALOG_STYLES = "\n.dsh-podman-container-dialog.dsh-podman-container-dialog {\n width: min(1100px, 92vw);\n max-height: min(85vh, 100%);\n gap: 0;\n padding: 0;\n}\n.dsh-podman-container-dialog-content.dsh-podman-container-dialog-content {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 0;\n}\n/* The header, the body and the footer share one 24px inset. The header and the\n footer stay pinned, and the body is the one region allowed to scroll: it is\n the content region's last element (the description, when a caller gives one,\n is a paragraph before it). */\n.dsh-podman-container-dialog-content > div:first-child {\n flex: none;\n padding: 24px 24px 12px;\n}\n.dsh-podman-container-dialog-content > div:last-child {\n min-height: 0;\n overflow-y: auto;\n padding: 0 24px;\n}\n.dsh-podman-container-dialog > div:last-child {\n flex: none;\n padding: 24px;\n}\n.dsh-podman-compact-dialog.dsh-podman-compact-dialog {\n width: min(480px, 92vw);\n}\n";
6
+ /** Inject the container dialogs' stylesheet for the owning plugin lifetime. */
7
+ export declare function installDialogStyles(ctx: ClientContext): void;
@@ -0,0 +1,70 @@
1
+ // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
2
+ //
3
+ // SPDX-License-Identifier: MIT
4
+ // The class passed to Modal for every container dialog (the Add-container
5
+ // dialog, the Create-container dialog and the Edit dialog). The primitive's own
6
+ // dialog is a 380px card that grows with its content, so this class gives all
7
+ // three the same explicit size: the viewport's height and a desktop width. The
8
+ // header and the footer stay pinned, the body between them is the only region
9
+ // that scrolls, and an environment row shows its Key and Value on one line on a
10
+ // desktop pane. The width is a max (the primitive's own 100% still fits a
11
+ // narrow pane), and the cap is the smaller of the viewport and the mask's
12
+ // padding box, which is the box the primitive sizes its cards against.
13
+ export const CONTAINER_DIALOG_CLASS = "dsh-podman-container-dialog";
14
+ // The class passed as the dialog's contentClassName: the primitive wraps the
15
+ // header, the optional description and the body in this region, so making it
16
+ // the flex column that may shrink is what pins the header while the body below
17
+ // takes the remaining height.
18
+ export const CONTAINER_DIALOG_CONTENT_CLASS = "dsh-podman-container-dialog-content";
19
+ // The class the small dialogs carry (the Publish port dialog, the Create secret
20
+ // dialog and the project-directory picker): they keep an explicit compact cap
21
+ // instead of the container dialogs' desktop width.
22
+ export const COMPACT_DIALOG_CLASS = "dsh-podman-compact-dialog";
23
+ export const CONTAINER_DIALOG_STYLES = `
24
+ .dsh-podman-container-dialog.dsh-podman-container-dialog {
25
+ width: min(1100px, 92vw);
26
+ max-height: min(85vh, 100%);
27
+ gap: 0;
28
+ padding: 0;
29
+ }
30
+ .dsh-podman-container-dialog-content.dsh-podman-container-dialog-content {
31
+ display: flex;
32
+ flex-direction: column;
33
+ flex: 1 1 auto;
34
+ min-height: 0;
35
+ }
36
+ /* The header, the body and the footer share one 24px inset. The header and the
37
+ footer stay pinned, and the body is the one region allowed to scroll: it is
38
+ the content region's last element (the description, when a caller gives one,
39
+ is a paragraph before it). */
40
+ .dsh-podman-container-dialog-content > div:first-child {
41
+ flex: none;
42
+ padding: 24px 24px 12px;
43
+ }
44
+ .dsh-podman-container-dialog-content > div:last-child {
45
+ min-height: 0;
46
+ overflow-y: auto;
47
+ padding: 0 24px;
48
+ }
49
+ .dsh-podman-container-dialog > div:last-child {
50
+ flex: none;
51
+ padding: 24px;
52
+ }
53
+ .dsh-podman-compact-dialog.dsh-podman-compact-dialog {
54
+ width: min(480px, 92vw);
55
+ }
56
+ `;
57
+ /** Inject the container dialogs' stylesheet for the owning plugin lifetime. */
58
+ export function installDialogStyles(ctx) {
59
+ if (typeof document === "undefined")
60
+ return;
61
+ ctx.effect(() => {
62
+ const tag = document.createElement("style");
63
+ tag.dataset.plugin = "@exagone313/dsh-podman";
64
+ tag.textContent = CONTAINER_DIALOG_STYLES;
65
+ document.head.appendChild(tag);
66
+ return () => {
67
+ tag.remove();
68
+ };
69
+ }, "podman: dialog styles");
70
+ }
@@ -0,0 +1,12 @@
1
+ import { type Translate } from "./locales.js";
2
+ import { type ReactNode } from "react";
3
+ export declare function ContainerDialog(props: {
4
+ t: Translate;
5
+ open: boolean;
6
+ title: string;
7
+ onClose: () => void;
8
+ marker?: string;
9
+ markerError?: boolean;
10
+ actions: ReactNode;
11
+ children: ReactNode;
12
+ }): ReactNode;
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
+ //
4
+ // SPDX-License-Identifier: MIT
5
+ // The one shell the three container dialogs render through: the Add-container
6
+ // dialog, the Create-container dialog (the workspace's default) and the Edit
7
+ // dialog. Each dialog keeps its own draft and its own commands and renders its
8
+ // own body through the shared ContainerForm, while this component owns the
9
+ // primitive Modal, the explicit size, the pinned header and footer, the one
10
+ // scrolling body, and the footer's action row — so the three cannot drift apart
11
+ // in width, padding or action layout again. Only what the dialogs genuinely
12
+ // differ in is passed in: the title, the actions, and Edit's staged marker.
13
+ import { CONTAINER_DIALOG_CLASS, CONTAINER_DIALOG_CONTENT_CLASS, } from "./container-card-dialog-styles.js";
14
+ import { dirtyBadge } from "./container-card-styles.js";
15
+ import { Modal } from "@deepseek-ai/dsh-client-ui-primitives";
16
+ // The one footer: the reserved marker slot on the left, then the dialog's own
17
+ // actions, right-aligned. The marker slot is always rendered, so the actions
18
+ // keep their place whether or not a draft is staged.
19
+ const footerRow = {
20
+ display: "flex",
21
+ alignItems: "center",
22
+ gap: "8px",
23
+ width: "100%",
24
+ };
25
+ // The marker slot's own line: it keeps the height of its text so the actions
26
+ // beside it never move when the marker appears.
27
+ const footerMarker = {
28
+ ...dirtyBadge,
29
+ flex: "1 1 auto",
30
+ minHeight: "18px",
31
+ };
32
+ // The marker line when it names a blocking problem rather than a staged draft:
33
+ // the same line and size, in the error state's colour.
34
+ const footerMarkerError = {
35
+ ...footerMarker,
36
+ color: "var(--dsw-alias-state-error-primary)",
37
+ };
38
+ const footerActions = {
39
+ display: "flex",
40
+ alignItems: "center",
41
+ gap: "8px",
42
+ flex: "none",
43
+ };
44
+ export function ContainerDialog(props) {
45
+ const { t, open, title, onClose, marker, markerError, actions, children } = props;
46
+ return (_jsx(Modal, { open: open, onClose: onClose, title: title, closeLabel: t("cancel"), className: CONTAINER_DIALOG_CLASS, contentClassName: CONTAINER_DIALOG_CONTENT_CLASS, footer: _jsxs("div", { style: footerRow, children: [_jsx("span", { style: markerError === true ? footerMarkerError : footerMarker, children: marker ?? "" }), _jsx("div", { style: footerActions, children: actions })] }), children: children }));
47
+ }
@@ -1,5 +1,5 @@
1
1
  import type { Context as ClientContext } from "@deepseek-ai/cordis";
2
2
  export declare const DIRECTORY_CLASS = "dsh-podman-directory";
3
- export declare const DIRECTORY_STYLES = "\n.dsh-podman-directory.dsh-podman-directory {\n width: min(680px, 100%);\n height: min(500px, calc(100dvh - 32px));\n padding: 0;\n gap: 0;\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n.dsh-podman-directory-scope {\n display: contents;\n}\n.dsh-podman-directory-header {\n display: flex;\n flex-direction: column;\n flex: none;\n gap: 8px;\n padding: 16px 14px 8px 24px;\n border-bottom: 0.5px solid var(--dsw-alias-border-l3);\n}\n.dsh-podman-directory-title {\n margin: 0;\n min-height: 28px;\n font-size: 16px;\n line-height: 24px;\n font-weight: 510;\n color: var(--dsw-alias-label-primary);\n}\n.dsh-podman-directory-crumbbar {\n display: flex;\n align-items: center;\n gap: 4px;\n box-sizing: border-box;\n min-height: 24px;\n margin-left: -9px;\n padding: 0 8px;\n border: 1px solid transparent;\n border-radius: 8px;\n}\n.dsh-podman-directory-crumbs {\n display: flex;\n align-items: center;\n gap: 4px;\n flex: 0 1 auto;\n min-width: 0;\n overflow-x: auto;\n scrollbar-width: none;\n}\n.dsh-podman-directory-crumbseat {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n flex: none;\n min-width: 0;\n}\n.dsh-podman-directory-crumb {\n border: none;\n background: transparent;\n padding: 0;\n max-width: 160px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n.dsh-podman-directory-crumb:hover {\n color: var(--dsw-alias-label-primary);\n}\n.dsh-podman-directory-crumb:disabled {\n cursor: default;\n color: var(--dsw-alias-label-caption);\n}\n.dsh-podman-directory-crumbchevron {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n}\n.dsh-podman-directory-content {\n display: flex;\n flex-direction: column;\n flex: 1 1 0;\n min-height: 0;\n position: relative;\n padding: 16px 16px 16px 24px;\n}\n.dsh-podman-directory-miller {\n display: flex;\n align-items: stretch;\n flex: 1 1 0;\n min-height: 0;\n gap: 12px;\n overflow-x: auto;\n scrollbar-width: none;\n}\n.dsh-podman-directory-column {\n display: flex;\n flex-direction: column;\n gap: 2px;\n flex: 1 1 0;\n min-width: 256px;\n margin: 0;\n list-style: none;\n overflow-y: auto;\n padding-right: 8px;\n}\n.dsh-podman-directory-divider {\n flex: none;\n width: 0.5px;\n background: var(--dsw-alias-border-l3);\n}\n.dsh-podman-directory-row {\n width: 100%;\n display: flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n flex: none;\n padding: 4px;\n border: none;\n border-radius: 6px;\n background: transparent;\n text-align: left;\n cursor: pointer;\n}\n.dsh-podman-directory-seat {\n display: flex;\n flex: none;\n}\n.dsh-podman-directory-row:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.dsh-podman-directory-row-selected,\n.dsh-podman-directory-row-selected:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-active, var(--dsw-alias-interactive-bg-hover));\n}\n.dsh-podman-directory-row:disabled {\n cursor: default;\n}\n.dsh-podman-directory-rowicon {\n flex: none;\n color: var(--dsw-alias-label-secondary);\n}\n.dsh-podman-directory-rowicon-selected {\n flex: none;\n color: var(--dsw-alias-button-info-fill);\n}\n.dsh-podman-directory-rowname {\n flex: 1 1 0;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n.dsh-podman-directory-rowchevron {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n}\n.dsh-podman-directory-status,\n.dsh-podman-directory-error {\n margin: 0;\n padding: 4px;\n font-size: 12px;\n line-height: 18px;\n}\n.dsh-podman-directory-status {\n color: var(--dsw-alias-label-secondary);\n}\n.dsh-podman-directory-error {\n color: var(--dsw-alias-state-error-primary);\n}\n.dsh-podman-directory-loading {\n position: absolute;\n right: 16px;\n bottom: 8px;\n padding: 2px 8px;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-bg-layer-2);\n}\n.dsh-podman-directory-footer {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n flex: none;\n padding: 16px 24px;\n border-top: 0.5px solid var(--dsw-alias-border-l3);\n}\n.dsh-podman-directory-toggle {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 0;\n border: none;\n background: transparent;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n.dsh-podman-directory-toggle[aria-pressed=\"true\"] {\n color: var(--dsw-alias-label-primary);\n}\n.dsh-podman-directory-toggle:disabled {\n cursor: default;\n color: var(--dsw-alias-label-caption);\n}\n.dsh-podman-directory-gap {\n flex: 1 1 0;\n}\n.dsh-podman-directory-action {\n min-width: 72px;\n}\n";
3
+ export declare const DIRECTORY_STYLES = "\n.dsh-podman-directory.dsh-podman-directory {\n height: min(500px, calc(100dvh - 32px));\n padding: 0;\n gap: 0;\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n.dsh-podman-directory-scope {\n display: contents;\n}\n.dsh-podman-directory-header {\n display: flex;\n flex-direction: column;\n flex: none;\n gap: 8px;\n padding: 16px 14px 8px 24px;\n border-bottom: 0.5px solid var(--dsw-alias-border-l3);\n}\n.dsh-podman-directory-title {\n margin: 0;\n min-height: 28px;\n font-size: 16px;\n line-height: 24px;\n font-weight: 510;\n color: var(--dsw-alias-label-primary);\n}\n.dsh-podman-directory-crumbbar {\n display: flex;\n align-items: center;\n gap: 4px;\n box-sizing: border-box;\n min-height: 24px;\n margin-left: -9px;\n padding: 0 8px;\n border: 1px solid transparent;\n border-radius: 8px;\n}\n.dsh-podman-directory-crumbs {\n display: flex;\n align-items: center;\n gap: 4px;\n flex: 0 1 auto;\n min-width: 0;\n overflow-x: auto;\n scrollbar-width: none;\n}\n.dsh-podman-directory-crumbseat {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n flex: none;\n min-width: 0;\n}\n.dsh-podman-directory-crumb {\n border: none;\n background: transparent;\n padding: 0;\n max-width: 160px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n.dsh-podman-directory-crumb:hover {\n color: var(--dsw-alias-label-primary);\n}\n.dsh-podman-directory-crumb:disabled {\n cursor: default;\n color: var(--dsw-alias-label-caption);\n}\n.dsh-podman-directory-crumbchevron {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n}\n.dsh-podman-directory-content {\n display: flex;\n flex-direction: column;\n flex: 1 1 0;\n min-height: 0;\n position: relative;\n padding: 16px 16px 16px 24px;\n}\n.dsh-podman-directory-miller {\n display: flex;\n align-items: stretch;\n flex: 1 1 0;\n min-height: 0;\n gap: 12px;\n overflow-x: auto;\n scrollbar-width: none;\n}\n.dsh-podman-directory-column {\n display: flex;\n flex-direction: column;\n gap: 2px;\n flex: 1 1 0;\n min-width: 256px;\n margin: 0;\n list-style: none;\n overflow-y: auto;\n padding-right: 8px;\n}\n.dsh-podman-directory-divider {\n flex: none;\n width: 0.5px;\n background: var(--dsw-alias-border-l3);\n}\n.dsh-podman-directory-row {\n width: 100%;\n display: flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n flex: none;\n padding: 4px;\n border: none;\n border-radius: 6px;\n background: transparent;\n text-align: left;\n cursor: pointer;\n}\n.dsh-podman-directory-seat {\n display: flex;\n flex: none;\n}\n.dsh-podman-directory-row:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.dsh-podman-directory-row-selected,\n.dsh-podman-directory-row-selected:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-active, var(--dsw-alias-interactive-bg-hover));\n}\n.dsh-podman-directory-row:disabled {\n cursor: default;\n}\n.dsh-podman-directory-rowicon {\n flex: none;\n color: var(--dsw-alias-label-secondary);\n}\n.dsh-podman-directory-rowicon-selected {\n flex: none;\n color: var(--dsw-alias-button-info-fill);\n}\n.dsh-podman-directory-rowname {\n flex: 1 1 0;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n.dsh-podman-directory-rowchevron {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n}\n.dsh-podman-directory-status,\n.dsh-podman-directory-error {\n margin: 0;\n padding: 4px;\n font-size: 12px;\n line-height: 18px;\n}\n.dsh-podman-directory-status {\n color: var(--dsw-alias-label-secondary);\n}\n.dsh-podman-directory-error {\n color: var(--dsw-alias-state-error-primary);\n}\n.dsh-podman-directory-loading {\n position: absolute;\n right: 16px;\n bottom: 8px;\n padding: 2px 8px;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-bg-layer-2);\n}\n.dsh-podman-directory-footer {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n flex: none;\n padding: 16px 24px;\n border-top: 0.5px solid var(--dsw-alias-border-l3);\n}\n.dsh-podman-directory-toggle {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 0;\n border: none;\n background: transparent;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n.dsh-podman-directory-toggle[aria-pressed=\"true\"] {\n color: var(--dsw-alias-label-primary);\n}\n.dsh-podman-directory-toggle:disabled {\n cursor: default;\n color: var(--dsw-alias-label-caption);\n}\n.dsh-podman-directory-gap {\n flex: 1 1 0;\n}\n.dsh-podman-directory-action {\n min-width: 72px;\n}\n";
4
4
  /** Inject the directory browser stylesheet for the owning plugin lifetime. */
5
5
  export declare function installDirectoryStyles(ctx: ClientContext): void;
@@ -2,14 +2,14 @@
2
2
  //
3
3
  // SPDX-License-Identifier: MIT
4
4
  // The class passed to Modal for the project directory browser. The layout,
5
- // typography and tokens mirror dsh's own directory browser (680x500 dialog,
6
- // two Miller columns, chevron breadcrumbs, 28px rows with folder icons), so the
7
- // plugin's picker reads like the harness's workspace directory selection. The
8
- // dialog is clamped to the projects root, so its breadcrumb trail starts there.
5
+ // typography and tokens mirror dsh's own directory browser (two Miller columns,
6
+ // chevron breadcrumbs, 28px rows with folder icons), so the plugin's picker
7
+ // reads like the harness's workspace directory selection; its width comes from
8
+ // the small dialogs' shared compact cap. The dialog is clamped to the projects
9
+ // root, so its breadcrumb trail starts there.
9
10
  export const DIRECTORY_CLASS = "dsh-podman-directory";
10
11
  export const DIRECTORY_STYLES = `
11
12
  .dsh-podman-directory.dsh-podman-directory {
12
- width: min(680px, 100%);
13
13
  height: min(500px, calc(100dvh - 32px));
14
14
  padding: 0;
15
15
  gap: 0;