- Replace `shouldOpenProjectFolderPickerImmediately` with direct `isElectron` usage - Remove obsolete `Sidebar.logic.ts` and its tests
Unified · Split
| @@ -1,24 +0,0 @@ | ||
| 1 | −import { describe, expect, it } from "vitest"; | |
| 2 | −import { shouldOpenProjectFolderPickerImmediately } from "./Sidebar.logic"; | |
| 3 | − | |
| 4 | −describe("shouldOpenProjectFolderPickerImmediately", () => { | |
| 5 | − it("opens the folder picker immediately in Electron", () => { | |
| 6 | − expect( | |
| 7 | − shouldOpenProjectFolderPickerImmediately({ | |
| 8 | − isElectron: true, | |
| 9 | − }), | |
| 10 | − ).toBe(true); | |
| 11 | − }); | |
| 12 | − | |
| 13 | − it("still opens the folder picker immediately for mobile-width Electron layouts", () => { | |
| 14 | − expect( | |
| 15 | − shouldOpenProjectFolderPickerImmediately({ | |
| 16 | − isElectron: true, | |
| 17 | − }), | |
| 18 | − ).toBe(true); | |
| 19 | − }); | |
| 20 | − | |
| 21 | − it("keeps manual project entry outside Electron", () => { | |
| 22 | − expect(shouldOpenProjectFolderPickerImmediately({ isElectron: false })).toBe(false); | |
| 23 | − }); | |
| 24 | −}); | |
| @@ -1,5 +0,0 @@ | ||
| 1 | −export function shouldOpenProjectFolderPickerImmediately(input: { | |
| 2 | − isElectron: boolean; | |
| 3 | −}): boolean { | |
| 4 | − return input.isElectron; | |
| 5 | −} | |
| @@ -49,7 +49,6 @@ import { · 48 unmodified lines | ||
| 49 | 49 | } from "./desktopUpdate.logic"; |
| 50 | 50 | import { Alert, AlertAction, AlertDescription, AlertTitle } from "./ui/alert"; |
| 51 | 51 | import { Button } from "./ui/button"; |
| 52 | −import { shouldOpenProjectFolderPickerImmediately } from "./Sidebar.logic"; | |
| 53 | 52 | import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible"; |
| 54 | 53 | import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; |
| 55 | 54 | import { |
| @@ -313,9 +312,7 @@ export default function Sidebar() { · 257 unmodified lines | ||
| 313 | 312 | const renamingCommittedRef = useRef(false); |
| 314 | 313 | const renamingInputRef = useRef<HTMLInputElement | null>(null); |
| 315 | 314 | const [desktopUpdateState, setDesktopUpdateState] = useState<DesktopUpdateState | null>(null); |
| 316 | − const shouldBrowseForProjectImmediately = shouldOpenProjectFolderPickerImmediately({ | |
| 317 | − isElectron, | |
| 318 | − }); | |
| 315 | + const shouldBrowseForProjectImmediately = isElectron; | |
| 319 | 316 | const shouldShowProjectPathEntry = addingProject && !shouldBrowseForProjectImmediately; |
| 320 | 317 | const pendingApprovalByThreadId = useMemo(() => { |
| 321 | 318 | const map = new Map<ThreadId, boolean>(); |