| author | |
| committer | |
| log | ce7b24bfb151cc5dfee54d669c3490611e74119e |
| tree | be7dae7b502b08c9cd9b99bae02a2c46dbd6c660 |
| parent | 5c286cab8b87fa5055533c54721cca52ec32050d |
- Replace `shouldOpenProjectFolderPickerImmediately` with direct `isElectron` usage
- Remove obsolete `Sidebar.logic.ts` and its tests3 files changed, 1 insertions(+), 33 deletions(-)
apps/web/src/components/Sidebar.logic.test.ts deleted-24| ... | ... | @@ -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 | }); |
apps/web/src/components/Sidebar.logic.ts deleted-5| ... | ... | @@ -1,5 +0,0 @@ |
| 1 | export function shouldOpenProjectFolderPickerImmediately(input: { | |
| 2 | isElectron: boolean; | |
| 3 | }): boolean { | |
| 4 | return input.isElectron; | |
| 5 | } |
apps/web/src/components/Sidebar.tsx+1-4| ... | ... | @@ -49,7 +49,6 @@ import { |
| 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() { |
| 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>(); |