Skip to content

Commit a9bb3eb

Browse files
committed
Better looking version strings in the Dashboard
1 parent 3c4b667 commit a9bb3eb

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

components/dashboard/src/settings/SelectIDE.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ interface SelectIDEProps {
2020
location: IDEChangedTrackLocation;
2121
}
2222

23+
const makeVersionHumanReadable = (versionString?: string) => {
24+
if (!versionString) {
25+
return undefined;
26+
}
27+
28+
let [version, pre] = versionString.split("-");
29+
if (pre) {
30+
// Capitalize the string, so that 1.74.0-insider becomes 1.74.0 Insider
31+
pre = pre[0].toUpperCase() + pre.slice(1);
32+
}
33+
34+
return [version, pre].join(" ").trim();
35+
};
36+
2337
export const updateUserIDEInfo = async (
2438
user: User,
2539
selectedIde: string,
@@ -92,7 +106,12 @@ export default function SelectIDE(props: SelectIDEProps) {
92106
const selected = defaultIde === id;
93107
const version = useLatestVersion ? option.latestImageVersion : option.imageVersion;
94108
const onSelect = () => actuallySetDefaultIde(id);
95-
return renderIdeOption(option, selected, version, onSelect);
109+
return renderIdeOption(
110+
option,
111+
selected,
112+
makeVersionHumanReadable(version),
113+
onSelect,
114+
);
96115
})}
97116
</div>
98117
{ideOptions.options[defaultIde]?.notes && (

0 commit comments

Comments
 (0)