Skip to content

Commit a77f5e0

Browse files
committed
cp dines
1 parent ed3f30b commit a77f5e0

11 files changed

Lines changed: 109 additions & 68 deletions

File tree

src/commands/blueprint/list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const ListBlueprintsUI = ({
126126
const padded = truncated.padEnd(width, " ");
127127
return (
128128
<Text
129-
color={isSelected ? "white" : colors.textDim}
129+
color={isSelected ? "white" : colors.idColor}
130130
bold={false}
131131
dimColor={false}
132132
inverse={isSelected}

src/commands/config.tsx

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import {
99
} from "../utils/config.js";
1010
import { Header } from "../components/Header.js";
1111
import { SuccessMessage } from "../components/SuccessMessage.js";
12-
import {
13-
colors,
14-
getCurrentTheme,
15-
setThemeMode,
16-
} from "../utils/theme.js";
12+
import { colors, getCurrentTheme, setThemeMode } from "../utils/theme.js";
1713

1814
interface ThemeOption {
1915
value: "auto" | "light" | "dark";
@@ -51,13 +47,8 @@ const InteractiveThemeSelector = ({
5147
themeOptions.findIndex((opt) => opt.value === initialTheme),
5248
);
5349
const [saved, setSaved] = React.useState(false);
54-
const [detectedTheme] = React.useState<"light" | "dark">(
55-
getCurrentTheme(),
56-
);
57-
const [currentTheme, setCurrentTheme] = React.useState<"light" | "dark">(
58-
getCurrentTheme(),
59-
);
60-
50+
const [detectedTheme] = React.useState<"light" | "dark">(getCurrentTheme());
51+
6152
// Update theme preview when selection changes
6253
React.useEffect(() => {
6354
const newTheme = themeOptions[selectedIndex].value;
@@ -73,7 +64,6 @@ const InteractiveThemeSelector = ({
7364

7465
// Apply theme change for preview
7566
setThemeMode(targetTheme);
76-
setCurrentTheme(targetTheme);
7767
}, [selectedIndex, detectedTheme]);
7868

7969
useInput((input, key) => {
@@ -90,12 +80,12 @@ const InteractiveThemeSelector = ({
9080
// Save the selected theme to config
9181
const selectedTheme = themeOptions[selectedIndex].value;
9282
setThemePreference(selectedTheme);
93-
83+
9484
// If setting to 'auto', clear cached detection for re-run
9585
if (selectedTheme === "auto") {
9686
clearDetectedTheme();
9787
}
98-
88+
9989
setSaved(true);
10090
setTimeout(() => exit(), 1500);
10191
} else if (key.escape || input === "q") {
@@ -167,9 +157,9 @@ const InteractiveThemeSelector = ({
167157
<Text color={colors.text} bold>
168158
{figures.play} Live Preview:
169159
</Text>
170-
<Box
171-
marginTop={1}
172-
marginLeft={2}
160+
<Box
161+
marginTop={1}
162+
marginLeft={2}
173163
paddingX={2}
174164
paddingY={1}
175165
borderStyle="round"
@@ -180,27 +170,21 @@ const InteractiveThemeSelector = ({
180170
<Text color={colors.primary} bold>
181171
{figures.tick} Primary
182172
</Text>
183-
<Text> </Text>
173+
<Text> </Text>
184174
<Text color={colors.secondary} bold>
185175
{figures.star} Secondary
186176
</Text>
187177
</Box>
188178
<Box>
189-
<Text color={colors.success}>
190-
{figures.tick} Success
191-
</Text>
192-
<Text> </Text>
193-
<Text color={colors.warning}>
194-
{figures.warning} Warning
195-
</Text>
196-
<Text> </Text>
197-
<Text color={colors.error}>
198-
{figures.cross} Error
199-
</Text>
179+
<Text color={colors.success}>{figures.tick} Success</Text>
180+
<Text> </Text>
181+
<Text color={colors.warning}>{figures.warning} Warning</Text>
182+
<Text> </Text>
183+
<Text color={colors.error}>{figures.cross} Error</Text>
200184
</Box>
201185
<Box>
202186
<Text color={colors.text}>Normal text</Text>
203-
<Text> </Text>
187+
<Text> </Text>
204188
<Text color={colors.textDim}>Dim text</Text>
205189
</Box>
206190
</Box>
@@ -227,12 +211,12 @@ const StaticConfigUI = ({ action, value }: StaticConfigUIProps) => {
227211
React.useEffect(() => {
228212
if (action === "set" && value) {
229213
setThemePreference(value);
230-
214+
231215
// If setting to 'auto', clear the cached detection so it re-runs on next start
232216
if (value === "auto") {
233217
clearDetectedTheme();
234218
}
235-
219+
236220
setSaved(true);
237221
setTimeout(() => process.exit(0), 1500);
238222
} else if (action === "get" || !action) {
@@ -284,8 +268,8 @@ const StaticConfigUI = ({ action, value }: StaticConfigUIProps) => {
284268
background automatically
285269
</Text>
286270
<Text color={colors.textDim}>
287-
<Text color={colors.primary}>light</Text> - Force light mode
288-
(dark text on light background)
271+
<Text color={colors.primary}>light</Text> - Force light mode (dark
272+
text on light background)
289273
</Text>
290274
<Text color={colors.textDim}>
291275
<Text color={colors.primary}>dark</Text> - Force dark mode (light
@@ -314,4 +298,3 @@ export function showThemeConfig() {
314298
export function setThemeConfig(theme: "auto" | "light" | "dark") {
315299
render(<StaticConfigUI action="set" value={theme} />);
316300
}
317-

src/commands/devbox/list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ const ListDevboxesUI = ({
169169
},
170170
{
171171
width: Math.min(idWidth || 26, ABSOLUTE_MAX_ID),
172-
color: colors.textDim,
172+
color: colors.idColor,
173173
dimColor: false,
174174
bold: false,
175175
},

src/commands/object/download.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,25 @@ const DownloadObjectUI = ({
8080
<Banner />
8181
{loading && <SpinnerComponent message="Downloading object..." />}
8282
{result && (
83-
<SuccessMessage
84-
message="Object downloaded successfully"
85-
details={`Object ID: ${result.objectId}\nPath: ${result.path}\nExtracted: ${result.extract ? "Yes" : "No"}`}
86-
/>
83+
<>
84+
<SuccessMessage message="Object downloaded successfully" />
85+
<Box marginLeft={2} flexDirection="column" marginTop={1}>
86+
<Box>
87+
<Text color={colors.textDim} dimColor>Object ID: </Text>
88+
<Text color={colors.idColor}>{result.objectId}</Text>
89+
</Box>
90+
<Box>
91+
<Text color={colors.textDim} dimColor>
92+
Path: {result.path}
93+
</Text>
94+
</Box>
95+
<Box>
96+
<Text color={colors.textDim} dimColor>
97+
Extracted: {result.extract ? "Yes" : "No"}
98+
</Text>
99+
</Box>
100+
</Box>
101+
</>
87102
)}
88103
{error && (
89104
<ErrorMessage message="Failed to download object" error={error} />

src/commands/snapshot/create.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,23 @@ const CreateSnapshotUI = ({
8787

8888
{result && (
8989
<>
90-
<SuccessMessage
91-
message="Snapshot created successfully!"
92-
details={`ID: ${result.id}\nName: ${result.name || "(unnamed)"}\nStatus: ${result.status}`}
93-
/>
90+
<SuccessMessage message="Snapshot created successfully!" />
91+
<Box marginLeft={2} flexDirection="column" marginTop={1}>
92+
<Box>
93+
<Text color={colors.textDim} dimColor>ID: </Text>
94+
<Text color={colors.idColor}>{result.id}</Text>
95+
</Box>
96+
<Box>
97+
<Text color={colors.textDim} dimColor>
98+
Name: {result.name || "(unnamed)"}
99+
</Text>
100+
</Box>
101+
<Box>
102+
<Text color={colors.textDim} dimColor>
103+
Status: {result.status}
104+
</Text>
105+
</Box>
106+
</Box>
94107
<Box
95108
borderStyle="double"
96109
borderColor={colors.success}
@@ -116,8 +129,9 @@ const CreateSnapshotUI = ({
116129
{figures.tick} Create devbox from snapshot:{" "}
117130
</Text>
118131
<Text color={colors.primary}>
119-
rli devbox create -t {result.id}
132+
rli devbox create -t{" "}
120133
</Text>
134+
<Text color={colors.idColor}>{result.id}</Text>
121135
</Box>
122136
</Box>
123137
</Box>

src/commands/snapshot/list.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const ListSnapshotsUI = ({
108108
columns: [
109109
createTextColumn("id", "ID", (snapshot: any) => snapshot.id, {
110110
width: idWidth,
111-
color: colors.textDim,
111+
color: colors.idColor,
112112
dimColor: false,
113113
bold: false,
114114
}),
@@ -126,7 +126,7 @@ const ListSnapshotsUI = ({
126126
(snapshot: any) => snapshot.source_devbox_id || "",
127127
{
128128
width: devboxWidth,
129-
color: colors.primary,
129+
color: colors.idColor,
130130
dimColor: false,
131131
bold: false,
132132
visible: showDevboxId,

src/components/DevboxCreatePage.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,23 @@ export const DevboxCreatePage = ({
447447
<Breadcrumb
448448
items={[{ label: "Devboxes" }, { label: "Create", active: true }]}
449449
/>
450-
<SuccessMessage
451-
message="Devbox created successfully!"
452-
details={`ID: ${result.id}\nName: ${result.name || "(none)"}\nStatus: ${result.status}`}
453-
/>
450+
<SuccessMessage message="Devbox created successfully!" />
451+
<Box marginLeft={2} flexDirection="column" marginTop={1}>
452+
<Box>
453+
<Text color={colors.textDim} dimColor>ID: </Text>
454+
<Text color={colors.idColor}>{result.id}</Text>
455+
</Box>
456+
<Box>
457+
<Text color={colors.textDim} dimColor>
458+
Name: {result.name || "(none)"}
459+
</Text>
460+
</Box>
461+
<Box>
462+
<Text color={colors.textDim} dimColor>
463+
Status: {result.status}
464+
</Text>
465+
</Box>
466+
</Box>
454467
<Box marginTop={1}>
455468
<Text color={colors.textDim} dimColor>
456469
Press [Enter], [q], or [esc] to return to list

src/components/DevboxDetailPage.tsx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export const DevboxDetailPage = ({
264264
</Text>,
265265
);
266266
lines.push(
267-
<Text key="core-id" dimColor>
267+
<Text key="core-id" color={colors.idColor}>
268268
{" "}
269269
ID: {selectedDevbox.id}
270270
</Text>,
@@ -452,15 +452,15 @@ export const DevboxDetailPage = ({
452452
);
453453
if (selectedDevbox.blueprint_id) {
454454
lines.push(
455-
<Text key="source-bp" dimColor>
455+
<Text key="source-bp" color={colors.idColor}>
456456
{" "}
457457
{selectedDevbox.blueprint_id}
458458
</Text>,
459459
);
460460
}
461461
if (selectedDevbox.snapshot_id) {
462462
lines.push(
463-
<Text key="source-snap" dimColor>
463+
<Text key="source-snap" color={colors.idColor}>
464464
{" "}
465465
{selectedDevbox.snapshot_id}
466466
</Text>,
@@ -484,7 +484,7 @@ export const DevboxDetailPage = ({
484484
);
485485
if (selectedDevbox.initiator_id) {
486486
lines.push(
487-
<Text key="init-id" dimColor>
487+
<Text key="init-id" color={colors.idColor}>
488488
{" "}
489489
ID: {selectedDevbox.initiator_id}
490490
</Text>,
@@ -632,7 +632,7 @@ export const DevboxDetailPage = ({
632632
<Box marginBottom={1}>
633633
<StatusBadge status={selectedDevbox.status} />
634634
<Text> </Text>
635-
<Text color={colors.textDim} dimColor>
635+
<Text color={colors.idColor}>
636636
{selectedDevbox.id}
637637
</Text>
638638
</Box>
@@ -692,7 +692,7 @@ export const DevboxDetailPage = ({
692692
</Text>
693693
<Text> </Text>
694694
<StatusBadge status={selectedDevbox.status} />
695-
<Text color={colors.textDim} dimColor>
695+
<Text color={colors.idColor}>
696696
{" "}
697697
{selectedDevbox.id}
698698
</Text>
@@ -766,12 +766,22 @@ export const DevboxDetailPage = ({
766766
<Text color={colors.secondary} bold>
767767
{figures.circleFilled} Source
768768
</Text>
769-
<Text dimColor>
770-
{selectedDevbox.blueprint_id &&
771-
`BP: ${selectedDevbox.blueprint_id}`}
772-
{selectedDevbox.snapshot_id &&
773-
`Snap: ${selectedDevbox.snapshot_id}`}
774-
</Text>
769+
{selectedDevbox.blueprint_id && (
770+
<>
771+
<Text dimColor>BP: </Text>
772+
<Text color={colors.idColor}>
773+
{selectedDevbox.blueprint_id}
774+
</Text>
775+
</>
776+
)}
777+
{selectedDevbox.snapshot_id && (
778+
<>
779+
<Text dimColor>Snap: </Text>
780+
<Text color={colors.idColor}>
781+
{selectedDevbox.snapshot_id}
782+
</Text>
783+
</>
784+
)}
775785
</Box>
776786
)}
777787
</Box>

src/screens/DevboxListScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export function DevboxListScreen() {
267267
1,
268268
ABSOLUTE_MAX_ID,
269269
),
270-
color: colors.textDim,
270+
color: colors.idColor,
271271
dimColor: false,
272272
bold: false,
273273
},
@@ -317,7 +317,7 @@ export function DevboxListScreen() {
317317
},
318318
{
319319
width: sanitizeWidth(sourceWidth, 1, 100),
320-
color: colors.textDim,
320+
color: colors.idColor,
321321
dimColor: false,
322322
},
323323
),

src/utils/ssh.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ export function getSSHUrl(): string {
149149
*/
150150
export function getProxyCommand(): string {
151151
const sshUrl = getSSHUrl();
152-
const sshHost = sshUrl.split(":")[0]; // Extract hostname from "host:port"
153152
// macOS openssl doesn't support -verify_quiet, use compatible flags
154153
// servername should be %h (target hostname) - SSH will replace %h with the actual hostname from the SSH command
155154
return `openssl s_client -quiet -servername %h -connect ${sshUrl} 2>/dev/null`;

0 commit comments

Comments
 (0)