Inline Electron project picker check in Sidebar
- Replace `shouldOpenProjectFolderPickerImmediately` with direct `isElectron` usage - Remove obsolete `Sidebar.logic.ts` and its tests
This commit is contained in:
1 parent
5c286cab8b
commit
ce7b24bfb1
3 files changed
+1
-33
No files matched your search
@@ -1,24 +0,0 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { shouldOpenProjectFolderPickerImmediately } from "./Sidebar.logic";
|
||||
|
||||
describe("shouldOpenProjectFolderPickerImmediately", () => {
|
||||
it("opens the folder picker immediately in Electron", () => {
|
||||
expect(
|
||||
shouldOpenProjectFolderPickerImmediately({
|
||||
isElectron: true,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("still opens the folder picker immediately for mobile-width Electron layouts", () => {
|
||||
expect(
|
||||
shouldOpenProjectFolderPickerImmediately({
|
||||
isElectron: true,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps manual project entry outside Electron", () => {
|
||||
expect(shouldOpenProjectFolderPickerImmediately({ isElectron: false })).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
export function shouldOpenProjectFolderPickerImmediately(input: {
|
||||
isElectron: boolean;
|
||||
}): boolean {
|
||||
return input.isElectron;
|
||||
}
|
||||
@@ -49,7 +49,6 @@ import {
|
||||
} from "./desktopUpdate.logic";
|
||||
import { Alert, AlertAction, AlertDescription, AlertTitle } from "./ui/alert";
|
||||
import { Button } from "./ui/button";
|
||||
import { shouldOpenProjectFolderPickerImmediately } from "./Sidebar.logic";
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible";
|
||||
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
|
||||
import {
|
||||
@@ -313,9 +312,7 @@ export default function Sidebar() {
|
||||
const renamingCommittedRef = useRef(false);
|
||||
const renamingInputRef = useRef<HTMLInputElement | null>(null);
|
||||
const [desktopUpdateState, setDesktopUpdateState] = useState<DesktopUpdateState | null>(null);
|
||||
const shouldBrowseForProjectImmediately = shouldOpenProjectFolderPickerImmediately({
|
||||
isElectron,
|
||||
});
|
||||
const shouldBrowseForProjectImmediately = isElectron;
|
||||
const shouldShowProjectPathEntry = addingProject && !shouldBrowseForProjectImmediately;
|
||||
const pendingApprovalByThreadId = useMemo(() => {
|
||||
const map = new Map<ThreadId, boolean>();
|
||||
|
||||
Reference in new issue
Block a user