Skip to content

Commit 4563c19

Browse files
authored
feat(devbox): style improvements (#36)
## Description <img width="921" height="628" alt="image" src="https://github.com/user-attachments/assets/992e932f-6c94-4c45-bbeb-c4aeb566fca9" /> Looks like this now <!-- Provide a brief description of your changes --> **Note:** PR titles should follow [Conventional Commits](https://www.conventionalcommits.org/) format (e.g., `feat(devbox): add support for custom env vars` or `fix(snapshot): resolve pagination issue`) as they are used for automatic release notes generation. ## Type of Change <!-- Mark the relevant option with an 'x' --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test updates ## Related Issues <!-- Link to related issues using #issue-number --> Closes # ## Changes Made <!-- Describe the changes in detail --> ## Testing <!-- Describe how you tested your changes --> - [ ] I have tested locally - [ ] I have added/updated tests - [ ] All existing tests pass ## Checklist - [ ] My code follows the code style of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published ## Screenshots (if applicable) <!-- Add screenshots to help explain your changes --> ## Additional Notes <!-- Any additional information that reviewers should know -->
1 parent 8943183 commit 4563c19

11 files changed

Lines changed: 555 additions & 192 deletions

src/commands/devbox/list.tsx

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { SpinnerComponent } from "../../components/Spinner.js";
88
import { ErrorMessage } from "../../components/ErrorMessage.js";
99
import { getStatusDisplay } from "../../components/StatusBadge.js";
1010
import { Breadcrumb } from "../../components/Breadcrumb.js";
11+
import type { Column } from "../../components/Table.js";
1112
import { Table, createTextColumn } from "../../components/Table.js";
1213
import { formatTimeAgo } from "../../components/ResourceListView.js";
1314
import { output, outputError } from "../../utils/output.js";
@@ -202,12 +203,36 @@ const ListDevboxesUI = ({
202203
const ABSOLUTE_MAX_NAME = 80;
203204
const ABSOLUTE_MAX_ID = 50;
204205

205-
const columns = [
206+
const columns: Column<Devbox>[] = [
207+
// Status icon column - visual indicator for quick scanning
208+
{
209+
key: "statusIcon",
210+
label: "",
211+
width: statusIconWidth,
212+
render: (devbox: Devbox, _index: number, isSelected: boolean) => {
213+
const statusDisplay = getStatusDisplay(devbox?.status);
214+
const statusColor =
215+
statusDisplay.color === colors.textDim
216+
? colors.info
217+
: statusDisplay.color;
218+
return (
219+
<Text
220+
color={isSelected ? "white" : statusColor}
221+
bold={true}
222+
dimColor={false}
223+
inverse={isSelected}
224+
wrap="truncate"
225+
>
226+
{statusDisplay.icon}{" "}
227+
</Text>
228+
);
229+
},
230+
},
206231
createTextColumn(
207232
"name",
208233
"Name",
209234
(devbox: Devbox) => {
210-
const name = String(devbox?.name || devbox?.id || "");
235+
const name = String(devbox?.name || "");
211236
const safeMax = Math.min(nameWidth || 15, ABSOLUTE_MAX_NAME);
212237
return name.length > safeMax
213238
? name.substring(0, Math.max(1, safeMax - 3)) + "..."
@@ -235,19 +260,33 @@ const ListDevboxesUI = ({
235260
bold: false,
236261
},
237262
),
238-
createTextColumn(
239-
"status",
240-
"Status",
241-
(devbox: Devbox) => {
263+
// Status text column with color matching the icon
264+
{
265+
key: "status",
266+
label: "Status",
267+
width: statusTextWidth,
268+
render: (devbox: Devbox, _index: number, isSelected: boolean) => {
242269
const statusDisplay = getStatusDisplay(devbox?.status);
243-
const text = String(statusDisplay?.text || "-");
244-
return text.length > 20 ? text.substring(0, 17) + "..." : text;
245-
},
246-
{
247-
width: statusTextWidth,
248-
dimColor: false,
270+
const statusColor =
271+
statusDisplay.color === colors.textDim
272+
? colors.info
273+
: statusDisplay.color;
274+
const safeWidth = Math.max(1, statusTextWidth);
275+
const truncated = statusDisplay.text.slice(0, safeWidth);
276+
const padded = truncated.padEnd(safeWidth, " ");
277+
return (
278+
<Text
279+
color={isSelected ? "white" : statusColor}
280+
bold={true}
281+
dimColor={false}
282+
inverse={isSelected}
283+
wrap="truncate"
284+
>
285+
{padded}
286+
</Text>
287+
);
249288
},
250-
),
289+
},
251290
createTextColumn(
252291
"created",
253292
"Created",
@@ -308,6 +347,7 @@ const ListDevboxesUI = ({
308347

309348
return columns;
310349
}, [
350+
statusIconWidth,
311351
nameWidth,
312352
idWidth,
313353
statusTextWidth,

src/components/DevboxCreatePage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ export const DevboxCreatePage = ({
6666
const [currentField, setCurrentField] = React.useState<FormField>("create");
6767
const [formData, setFormData] = React.useState<FormData>({
6868
name: "",
69-
architecture: "arm64",
69+
architecture: "x86_64",
7070
resource_size: "SMALL",
7171
custom_cpu: "",
7272
custom_memory: "",
7373
custom_disk: "",
74-
keep_alive: "3600",
74+
keep_alive: "3600", // 1 hour
7575
metadata: {},
7676
blueprint_id: initialBlueprintId || "",
7777
snapshot_id: initialSnapshotId || "",
@@ -632,6 +632,7 @@ export const DevboxCreatePage = ({
632632
<MetadataDisplay
633633
metadata={formData.metadata}
634634
showBorder={false}
635+
compact
635636
/>
636637
</Box>
637638
)}

0 commit comments

Comments
 (0)