Skip to content

Commit 8601f1d

Browse files
committed
chores
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
1 parent d2ad450 commit 8601f1d

File tree

3 files changed

+53
-214
lines changed

3 files changed

+53
-214
lines changed

apps/desktop/src/settings/general/storage.tsx renamed to apps/desktop/src/settings/general/storage/index.tsx

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
type LucideIcon,
77
Settings2Icon,
88
} from "lucide-react";
9-
import { type ReactNode } from "react";
9+
import { type ReactNode, useEffect } from "react";
1010
import { useState } from "react";
1111

1212
import { commands as fsSyncCommands } from "@hypr/plugin-fs-sync";
@@ -162,11 +162,16 @@ function ChangeContentPathDialog({
162162
},
163163
});
164164

165+
useEffect(() => {
166+
if (isNewPathEmpty !== undefined) {
167+
setCopyVault(isNewPathEmpty);
168+
}
169+
}, [isNewPathEmpty, setCopyVault]);
170+
165171
const disabledReason = (() => {
166172
if (!selectedPath || selectedPath === currentPath)
167173
return "Select a different folder";
168174
if (isCheckingNewPath) return "Checking folder...";
169-
if (isNewPathEmpty === false) return "Folder must be empty";
170175
return null;
171176
})();
172177

@@ -220,15 +225,8 @@ function ChangeContentPathDialog({
220225
: "Select a folder"}
221226
</p>
222227
{isNewPathChosen && isNewPathEmpty !== undefined && (
223-
<p
224-
className={cn([
225-
"mt-1 text-xs",
226-
isNewPathEmpty ? "text-neutral-400" : "text-amber-600",
227-
])}
228-
>
229-
{isNewPathEmpty
230-
? "Empty folder"
231-
: "Not empty — must be empty"}
228+
<p className="mt-1 text-xs text-neutral-400">
229+
{isNewPathEmpty ? "Empty folder" : "Not empty"}
232230
</p>
233231
)}
234232
</div>
@@ -244,44 +242,52 @@ function ChangeContentPathDialog({
244242
</div>
245243
</div>
246244

247-
{isNewPathChosen && !disabledReason && (
248-
<label className="flex cursor-pointer items-center gap-2">
249-
<Checkbox
250-
checked={copyVault}
251-
onCheckedChange={(v) => setCopyVault(v === true)}
252-
/>
253-
<span className="text-sm text-neutral-600">
254-
Copy existing sessions to new location
255-
</span>
256-
</label>
257-
)}
258-
259245
{error && <p className="text-sm text-red-500">{error.message}</p>}
260246

261-
<DialogFooter>
262-
<Tooltip>
263-
<TooltipTrigger asChild>
264-
<span
265-
className={cn([
266-
disabledReason ? "cursor-not-allowed" : "cursor-pointer",
267-
])}
268-
>
269-
<Button
270-
onClick={apply}
271-
disabled={!!disabledReason || isPending}
272-
className={cn([disabledReason ? "pointer-events-none" : ""])}
273-
>
274-
{isPending ? "Applying..." : "Apply and Restart"}
275-
</Button>
276-
</span>
277-
</TooltipTrigger>
278-
{disabledReason && (
279-
<TooltipContent>
280-
<p className="text-xs">{disabledReason}</p>
281-
</TooltipContent>
247+
{isNewPathChosen && (
248+
<DialogFooter className="items-center">
249+
{!disabledReason && (
250+
<label className="mr-auto flex cursor-pointer items-center gap-2">
251+
<Checkbox
252+
checked={copyVault}
253+
onCheckedChange={(v) => setCopyVault(v === true)}
254+
/>
255+
<div className="flex flex-row gap-1">
256+
<span className="text-sm font-semibold text-neutral-600">
257+
Copy
258+
</span>
259+
<span className="text-sm text-neutral-600">
260+
existing data to new location
261+
</span>
262+
</div>
263+
</label>
282264
)}
283-
</Tooltip>
284-
</DialogFooter>
265+
<Tooltip>
266+
<TooltipTrigger asChild>
267+
<span
268+
className={cn([
269+
disabledReason ? "cursor-not-allowed" : "cursor-pointer",
270+
])}
271+
>
272+
<Button
273+
onClick={apply}
274+
disabled={!!disabledReason || isPending}
275+
className={cn([
276+
disabledReason ? "pointer-events-none" : "",
277+
])}
278+
>
279+
{isPending ? "Applying..." : "Apply and Restart"}
280+
</Button>
281+
</span>
282+
</TooltipTrigger>
283+
{disabledReason && (
284+
<TooltipContent>
285+
<p className="text-xs">{disabledReason}</p>
286+
</TooltipContent>
287+
)}
288+
</Tooltip>
289+
</DialogFooter>
290+
)}
285291
</DialogContent>
286292
</Dialog>
287293
);
@@ -341,7 +347,7 @@ function StoragePathRow({
341347
</Tooltip>
342348
<button
343349
onClick={() => path && openerCommands.openPath(path, null)}
344-
className="min-w-0 flex-1 cursor-pointer truncate text-sm text-neutral-500 hover:underline"
350+
className="min-w-0 flex-1 cursor-pointer truncate text-left text-sm text-neutral-500 hover:underline"
345351
>
346352
{path && home
347353
? shortenPath(tildify(path, home))

apps/desktop/src/settings/general/use-storage-wizard.ts renamed to apps/desktop/src/settings/general/storage/use-storage-wizard.ts

File renamed without changes.

crates/listener-core/examples/cli.rs

Lines changed: 0 additions & 167 deletions
This file was deleted.

0 commit comments

Comments
 (0)