Skip to content

Commit bb4c8af

Browse files
committed
chore: bug fixes and download sidebar item
1 parent 7ab675d commit bb4c8af

File tree

7 files changed

+68
-40
lines changed

7 files changed

+68
-40
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ Access app from the browser at `http://localhost:3001`
124124

125125
### Build
126126

127-
__Static web build__
127+
**Static web build**
128128

129129
```bash
130130
yarn build
131131
```
132132

133-
__Desktop (Tauri) build__
133+
**Desktop (Tauri) build**
134134

135135
```bash
136136
yarn tauri build

src-tauri/tauri.conf.json

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
"bundle": {
33
"targets": "all",
44
"active": true,
5-
"icon": [
6-
"icons/icon.png",
7-
"icons/icon.icns",
8-
"icons/icon.ico"
9-
],
5+
"icon": ["icons/icon.png", "icons/icon.icns", "icons/icon.ico"],
106
"windows": {
117
"timestampUrl": "",
128
"certificateThumbprint": null,
@@ -46,9 +42,7 @@
4642
"mainBinaryName": "devbox",
4743
"plugins": {
4844
"updater": {
49-
"endpoints": [
50-
"https://github.com/smithg09/devbox/releases/latest/download/latest.json"
51-
],
45+
"endpoints": ["https://github.com/smithg09/devbox/releases/latest/download/latest.json"],
5246
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IENFNzFGMjVDNjFFMEI3QkIKUldTN3QrQmhYUEp4em5JRjBvTkFPRG1Zd1RsMkVuOUZKcnhwc1JOWnA4Vm03RkZocHFhTzBwY0IK"
5347
}
5448
},
@@ -57,13 +51,9 @@
5751
"security": {
5852
"assetProtocol": {
5953
"enable": true,
60-
"scope": [
61-
"http://asset.localhost"
62-
]
54+
"scope": ["http://asset.localhost"]
6355
},
64-
"dangerousDisableAssetCspModification": [
65-
"style-src"
66-
],
56+
"dangerousDisableAssetCspModification": ["style-src"],
6757
"csp": {
6858
"connect-src": [
6959
"https://www.google-analytics.com",
@@ -91,28 +81,16 @@
9181
"tauri:",
9282
"asset:"
9383
],
94-
"worker-src": [
95-
"'self'",
96-
"blob:",
97-
"https://unpkg.com"
98-
],
84+
"worker-src": ["'self'", "blob:", "https://unpkg.com"],
9985
"script-src": [
10086
"'self'",
10187
"'unsafe-inline'",
10288
"'unsafe-eval'",
10389
"https://www.googletagmanager.com",
10490
"https://www.google-analytics.com"
10591
],
106-
"style-src": [
107-
"'self'",
108-
"'unsafe-inline'",
109-
"https://fonts.googleapis.com"
110-
],
111-
"font-src": [
112-
"'self'",
113-
"data:",
114-
"https://fonts.gstatic.com"
115-
],
92+
"style-src": ["'self'", "'unsafe-inline'", "https://fonts.googleapis.com"],
93+
"font-src": ["'self'", "data:", "https://fonts.gstatic.com"],
11694
"img-src": [
11795
"'self'",
11896
"data:",

src/components/Sidebar/index.tsx

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ import { isTauri } from "@/utils/isTauri";
2222
import { formatShortcutDisplay } from "@/utils/keyboard";
2323
import { DragDropContext, Draggable, Droppable, OnDragEndResponder } from "@hello-pangea/dnd";
2424
import { useLocalStorage } from "@mantine/hooks";
25-
import { BsGear, BsHouse, BsSearch } from "react-icons/bs";
25+
import { BsDownload, BsGear, BsHouse, BsSearch } from "react-icons/bs";
2626
import { SidebarConfig } from "../Settings";
2727
import { SIDEBAR_CONSTANTS } from "./constants";
2828
import Tool from "./Tool";
2929
import { DropDownItem, Props, SidebarTool } from "./types";
30+
import { APP_CONFIG } from "@/constants/app";
3031

3132
export const Sidebar = ({ collapsed, setCollapsed }: Props) => {
3233
const location = useLocation();
@@ -331,6 +332,47 @@ export const Sidebar = ({ collapsed, setCollapsed }: Props) => {
331332

332333
<Divider w="90%" mx="auto" mt={0} />
333334
<Stack className={classes.settingsSection} mt={4}>
335+
{!isTauri() && (
336+
<Box
337+
className={cx(classes.navigationItem)}
338+
onClick={() => window.open(APP_CONFIG.RELEASES_URL, "_blank")}
339+
>
340+
<Box className={classes.itemContent} w="100%">
341+
{collapsed ? (
342+
<BsGear size={SIDEBAR_CONSTANTS.ICON_SIZE.LARGE} />
343+
) : (
344+
<>
345+
<BsDownload
346+
size={SIDEBAR_CONSTANTS.ICON_SIZE.MEDIUM}
347+
style={{ minWidth: SIDEBAR_CONSTANTS.ICON_SIZE.MEDIUM }}
348+
/>
349+
<Box w="80%">
350+
<Text size="xs" fw="450">
351+
Download App
352+
{showDescription && (
353+
<Text
354+
size="11px"
355+
c="dimmed"
356+
mt={2}
357+
w="100%"
358+
styles={{
359+
root: {
360+
whiteSpace: "nowrap",
361+
overflow: "hidden",
362+
textOverflow: "ellipsis",
363+
},
364+
}}
365+
>
366+
Get the desktop app for the best experience
367+
</Text>
368+
)}
369+
</Text>
370+
</Box>
371+
</>
372+
)}
373+
</Box>
374+
</Box>
375+
)}
334376
<Box
335377
className={cx(classes.navigationItem, {
336378
[classes.selectedNavigationItem]: location.pathname === "/settings",

src/constants/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export const APP_CONFIG = {
2+
PROJECT_URL: "https://github.com/smithg09/devbox",
3+
RELEASES_URL: "https://github.com/smithg09/devbox/releases",
24
PANEL: {
35
sidebar: {
46
defaultSize: 15,

src/pages/ssh/components/KeyDisplay.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ export function KeyDisplay({ keys, handleBack }: KeyDisplayProps) {
6262
<Text fw={600} size="sm" c="red">
6363
Private Key
6464
</Text>
65-
<CopyButton value={keys.privateKey} label="Copy Private Key" />
65+
<CopyButton variant="light" value={keys.privateKey} label="Copy Private Key" />
6666
</Group>
6767
<Textarea
6868
value={keys.privateKey}
6969
readOnly
70-
rows={6}
70+
rows={8}
7171
styles={{
7272
input: {
7373
fontFamily: "monospace",
74-
fontSize: "11px",
74+
fontSize: "13px",
7575
},
7676
}}
7777
/>
@@ -83,16 +83,16 @@ export function KeyDisplay({ keys, handleBack }: KeyDisplayProps) {
8383
<Text fw={600} size="sm" c="green">
8484
Public Key
8585
</Text>
86-
<CopyButton value={keys.publicKey} label="Copy Public Key" />
86+
<CopyButton variant="light" value={keys.publicKey} label="Copy Public Key" />
8787
</Group>
8888
<Textarea
8989
value={keys.publicKey}
9090
readOnly
91-
rows={6}
91+
rows={8}
9292
styles={{
9393
input: {
9494
fontFamily: "monospace",
95-
fontSize: "11px",
95+
fontSize: "13px",
9696
},
9797
}}
9898
/>
@@ -120,7 +120,7 @@ export function KeyDisplay({ keys, handleBack }: KeyDisplayProps) {
120120
<Text size="sm" ff="monospace" c="dark">
121121
{keys.fingerprint.md5}
122122
</Text>
123-
<CopyButton value={keys.fingerprint.md5} label="Copy MD5" />
123+
<CopyButton variant="light" value={keys.fingerprint.md5} label="Copy MD5" />
124124
</Group>
125125
</Box>
126126
<Box>
@@ -131,7 +131,7 @@ export function KeyDisplay({ keys, handleBack }: KeyDisplayProps) {
131131
<Text size="sm" ff="monospace" c="dark">
132132
{keys.fingerprint.sha256}
133133
</Text>
134-
<CopyButton value={keys.fingerprint.sha256} label="Copy SHA256" />
134+
<CopyButton variant="light" value={keys.fingerprint.sha256} label="Copy SHA256" />
135135
</Group>
136136
</Box>
137137
{keys.comment && (

src/pages/timezone/Timezone.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export default function Timezone() {
3333
if (mounted && saved && saved.version === 1) {
3434
setPreferences(saved);
3535
setReference(saved.lastReferenceIso ? new Date(saved.lastReferenceIso) : new Date());
36+
console.log("Loaded timezone prefs", saved);
37+
if (saved.live !== undefined) {
38+
setLive(saved.live);
39+
}
3640
}
3741
})();
3842
return () => {
@@ -43,6 +47,7 @@ export default function Timezone() {
4347
useEffect(() => {
4448
const toSave: TimezonePreferencesV1 = {
4549
...preferences,
50+
live,
4651
lastReferenceIso: reference.toISOString(),
4752
};
4853
settingsStore.update(TIMEZONE_PREFERENCES_KEY, toSave);

src/pages/timezone/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface TimezonePreferencesV1 {
2121
timeFormat: TimeFormat;
2222
lastReferenceIso?: string;
2323
sliderZoom: SliderZoom;
24+
live?: boolean;
2425
}
2526

2627
export const TIMEZONE_PREFERENCES_KEY = "timezone.preferences";

0 commit comments

Comments
 (0)