Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState } from "react";
import RefreshCw from "lucide-react/dist/esm/icons/refresh-cw";
import { RefreshCw } from "lucide-react";
import "./styles/base.css";
import "./styles/ds-tokens.css";
import "./styles/ds-modal.css";
Expand Down Expand Up @@ -2166,7 +2166,7 @@ function MainApp() {
isLoadingLocalUsage,
localUsageError,
onRefreshLocalUsage: () => {
refreshLocalUsage()?.catch(() => {});
refreshLocalUsage()?.catch((err) => console.debug("refreshLocalUsage failed", err));
},
usageMetric,
onUsageMetricChange: setUsageMetric,
Expand Down
2 changes: 1 addition & 1 deletion src/features/app/components/LaunchScriptButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Play from "lucide-react/dist/esm/icons/play";
import { Play } from "lucide-react";
import type { LaunchScriptIconId } from "../../../types";
import { PopoverSurface } from "../../design-system/components/popover/PopoverPrimitives";
import { useMenuController } from "../hooks/useMenuController";
Expand Down
4 changes: 1 addition & 3 deletions src/features/app/components/MainHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useEffect, useMemo, useRef, useState } from "react";
import Check from "lucide-react/dist/esm/icons/check";
import Copy from "lucide-react/dist/esm/icons/copy";
import Terminal from "lucide-react/dist/esm/icons/terminal";
import { Check, Copy, Terminal } from "lucide-react";
import { revealItemInDir } from "@tauri-apps/plugin-opener";
import type { BranchInfo, OpenAppTarget, WorkspaceInfo } from "../../../types";
import type { ReactNode } from "react";
Expand Down
3 changes: 1 addition & 2 deletions src/features/app/components/MainHeaderActions.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { memo } from "react";
import AlignLeft from "lucide-react/dist/esm/icons/align-left";
import Columns2 from "lucide-react/dist/esm/icons/columns-2";
import { AlignLeft, Columns2 } from "lucide-react";
import type { SidebarToggleProps } from "../../layout/components/SidebarToggleControls";
import {
RightPanelCollapseButton,
Expand Down
2 changes: 1 addition & 1 deletion src/features/app/components/OpenAppMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from "react";
import ChevronDown from "lucide-react/dist/esm/icons/chevron-down";
import { ChevronDown } from "lucide-react";
import { revealItemInDir } from "@tauri-apps/plugin-opener";
import * as Sentry from "@sentry/react";
import { openWorkspaceIn } from "../../../services/tauri";
Expand Down
6 changes: 1 addition & 5 deletions src/features/app/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import type {
import { createPortal } from "react-dom";
import { memo, useCallback, useEffect, useMemo, useState } from "react";
import type { MouseEvent, RefObject } from "react";
import { FolderOpen } from "lucide-react";
import Copy from "lucide-react/dist/esm/icons/copy";
import GitBranch from "lucide-react/dist/esm/icons/git-branch";
import Plus from "lucide-react/dist/esm/icons/plus";
import X from "lucide-react/dist/esm/icons/x";
import { Copy, FolderOpen, GitBranch, Plus, X } from "lucide-react";
import {
PopoverMenuItem,
PopoverSurface,
Expand Down
5 changes: 1 addition & 4 deletions src/features/app/components/SidebarCornerActions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import ScrollText from "lucide-react/dist/esm/icons/scroll-text";
import Settings from "lucide-react/dist/esm/icons/settings";
import User from "lucide-react/dist/esm/icons/user";
import X from "lucide-react/dist/esm/icons/x";
import { ScrollText, Settings, User, X } from "lucide-react";
import { useEffect } from "react";
import {
MenuTrigger,
Expand Down
10 changes: 1 addition & 9 deletions src/features/app/components/SidebarHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import ArrowDownUp from "lucide-react/dist/esm/icons/arrow-down-up";
import BetweenHorizontalStart from "lucide-react/dist/esm/icons/between-horizontal-start";
import Calendar from "lucide-react/dist/esm/icons/calendar";
import FolderPlus from "lucide-react/dist/esm/icons/folder-plus";
import FolderTree from "lucide-react/dist/esm/icons/folder-tree";
import ListFilter from "lucide-react/dist/esm/icons/list-filter";
import ListTree from "lucide-react/dist/esm/icons/list-tree";
import RefreshCw from "lucide-react/dist/esm/icons/refresh-cw";
import Search from "lucide-react/dist/esm/icons/search";
import { ArrowDownUp, BetweenHorizontalStart, Calendar, FolderPlus, FolderTree, ListFilter, ListTree, RefreshCw, Search } from "lucide-react";
import { useCallback, useEffect, useRef, useState } from "react";
import type { ThreadListOrganizeMode, ThreadListSortKey } from "../../../types";
import {
Expand Down
6 changes: 1 addition & 5 deletions src/features/app/components/TabBar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import type { ReactNode } from "react";
import FolderKanban from "lucide-react/dist/esm/icons/folder-kanban";
import GitBranch from "lucide-react/dist/esm/icons/git-branch";
import House from "lucide-react/dist/esm/icons/house";
import MessagesSquare from "lucide-react/dist/esm/icons/messages-square";
import TerminalSquare from "lucide-react/dist/esm/icons/terminal-square";
import { FolderKanban, GitBranch, House, MessagesSquare, TerminalSquare } from "lucide-react";

type TabKey = "home" | "projects" | "codex" | "git" | "log";

Expand Down
4 changes: 1 addition & 3 deletions src/features/app/components/TabletNav.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { ReactNode } from "react";
import GitBranch from "lucide-react/dist/esm/icons/git-branch";
import MessagesSquare from "lucide-react/dist/esm/icons/messages-square";
import TerminalSquare from "lucide-react/dist/esm/icons/terminal-square";
import { GitBranch, MessagesSquare, TerminalSquare } from "lucide-react";

type TabletNavTab = "codex" | "git" | "log";

Expand Down
2 changes: 1 addition & 1 deletion src/features/app/components/WorktreeSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Layers from "lucide-react/dist/esm/icons/layers";
import { Layers } from "lucide-react";
import type { MouseEvent, ReactNode } from "react";

import type { ThreadSummary, WorkspaceInfo } from "../../../types";
Expand Down
15 changes: 1 addition & 14 deletions src/features/app/utils/launchScriptIcons.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
import type { LucideIcon } from "lucide-react";
import type { LaunchScriptIconId } from "../../../types";
export type { LaunchScriptIconId } from "../../../types";
import Play from "lucide-react/dist/esm/icons/play";
import Hammer from "lucide-react/dist/esm/icons/hammer";
import Bug from "lucide-react/dist/esm/icons/bug";
import Wrench from "lucide-react/dist/esm/icons/wrench";
import TerminalSquare from "lucide-react/dist/esm/icons/terminal-square";
import Code2 from "lucide-react/dist/esm/icons/code-2";
import Server from "lucide-react/dist/esm/icons/server";
import Database from "lucide-react/dist/esm/icons/database";
import Package from "lucide-react/dist/esm/icons/package";
import TestTube2 from "lucide-react/dist/esm/icons/test-tube-2";
import RefreshCw from "lucide-react/dist/esm/icons/refresh-cw";
import GitBranch from "lucide-react/dist/esm/icons/git-branch";
import Settings from "lucide-react/dist/esm/icons/settings";
import Search from "lucide-react/dist/esm/icons/search";
import { Bug, Code2, Database, GitBranch, Hammer, Package, Play, RefreshCw, Search, Server, Settings, TerminalSquare, TestTube2, Wrench } from "lucide-react";

export const DEFAULT_LAUNCH_SCRIPT_ICON: LaunchScriptIconId = "play";

Expand Down
46 changes: 25 additions & 21 deletions src/features/collaboration/hooks/useCollaborationModes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,29 @@ export function useCollaborationModes({
const workspaceId = activeWorkspace?.id ?? null;
const isConnected = Boolean(activeWorkspace?.connected);

const extractModeList = useCallback((response: any): any[] => {
const extractModeList = useCallback((response: unknown): unknown[] => {
const res = response as Record<string, unknown> | null | undefined;
const candidates = [
response?.result?.data,
response?.result?.modes,
response?.result,
response?.data,
response?.modes,
(res?.result as Record<string, unknown> | undefined)?.data,
(res?.result as Record<string, unknown> | undefined)?.modes,
res?.result,
res?.data,
res?.modes,
response,
];
for (const candidate of candidates) {
if (Array.isArray(candidate)) {
return candidate;
}
if (candidate && typeof candidate === "object") {
const nested = (candidate as any).data ?? (candidate as any).modes;
const rec = candidate as Record<string, unknown>;
const nested = rec.data ?? rec.modes;
if (Array.isArray(nested)) {
return nested;
}
if (nested && typeof nested === "object") {
const deep = (nested as any).data ?? (nested as any).modes;
const nestedRec = nested as Record<string, unknown>;
const deep = nestedRec.data ?? nestedRec.modes;
if (Array.isArray(deep)) {
return deep;
}
Expand Down Expand Up @@ -110,25 +113,26 @@ export function useCollaborationModes({
});
const rawData = extractModeList(response);
const data: CollaborationModeOption[] = rawData
.map((item: any) => {
.map((item: unknown) => {
if (!item || typeof item !== "object") {
return null;
}
const modeId = String(item.mode ?? item.name ?? "").trim();
const rec = item as Record<string, unknown>;
const modeId = String(rec.mode ?? rec.name ?? "").trim();
if (!modeId) {
return null;
}

const settings =
item.settings && typeof item.settings === "object"
? item.settings
rec.settings && typeof rec.settings === "object"
? (rec.settings as Record<string, unknown>)
: {
model: item.model ?? null,
model: rec.model ?? null,
reasoning_effort:
item.reasoning_effort ?? item.reasoningEffort ?? null,
rec.reasoning_effort ?? rec.reasoningEffort ?? null,
developer_instructions:
item.developer_instructions ??
item.developerInstructions ??
rec.developer_instructions ??
rec.developerInstructions ??
null,
};

Expand All @@ -137,10 +141,10 @@ export function useCollaborationModes({
const developerInstructions = settings.developer_instructions ?? null;

const labelSource =
typeof item.label === "string" && item.label.trim()
? item.label
: typeof item.name === "string" && item.name.trim()
? item.name
typeof rec.label === "string" && rec.label.trim()
? rec.label
: typeof rec.name === "string" && rec.name.trim()
? rec.name
: modeId;

const option: CollaborationModeOption = {
Expand All @@ -152,7 +156,7 @@ export function useCollaborationModes({
developerInstructions: developerInstructions
? String(developerInstructions)
: null,
value: item as Record<string, unknown>,
value: rec as Record<string, unknown>,
};
return option;
})
Expand Down
3 changes: 1 addition & 2 deletions src/features/composer/components/ComposerAttachments.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { convertFileSrc } from "@tauri-apps/api/core";
import Image from "lucide-react/dist/esm/icons/image";
import X from "lucide-react/dist/esm/icons/x";
import { Image, X } from "lucide-react";

type ComposerAttachmentsProps = {
attachments: string[];
Expand Down
17 changes: 1 addition & 16 deletions src/features/composer/components/ComposerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,7 @@ import type {
SyntheticEvent,
} from "react";
import type { AutocompleteItem } from "../hooks/useComposerAutocomplete";
import ImagePlus from "lucide-react/dist/esm/icons/image-plus";
import ChevronDown from "lucide-react/dist/esm/icons/chevron-down";
import ChevronUp from "lucide-react/dist/esm/icons/chevron-up";
import Mic from "lucide-react/dist/esm/icons/mic";
import Square from "lucide-react/dist/esm/icons/square";
import X from "lucide-react/dist/esm/icons/x";
import Brain from "lucide-react/dist/esm/icons/brain";
import GitFork from "lucide-react/dist/esm/icons/git-fork";
import PlusCircle from "lucide-react/dist/esm/icons/plus-circle";
import Plus from "lucide-react/dist/esm/icons/plus";
import Info from "lucide-react/dist/esm/icons/info";
import RotateCcw from "lucide-react/dist/esm/icons/rotate-ccw";
import ScrollText from "lucide-react/dist/esm/icons/scroll-text";
import Wrench from "lucide-react/dist/esm/icons/wrench";
import FileText from "lucide-react/dist/esm/icons/file-text";
import Plug from "lucide-react/dist/esm/icons/plug";
import { Brain, ChevronDown, ChevronUp, FileText, GitFork, ImagePlus, Info, Mic, Plug, Plus, PlusCircle, RotateCcw, ScrollText, Square, Wrench, X } from "lucide-react";
import { useComposerImageDrop } from "../hooks/useComposerImageDrop";
import {
PopoverMenuItem,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ComponentPropsWithoutRef, ReactNode } from "react";
import ChevronRight from "lucide-react/dist/esm/icons/chevron-right";
import { ChevronRight } from "lucide-react";
import { joinClassNames } from "../classNames";

type PanelFrameProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/features/files/components/FilePreviewPopover.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo } from "react";
import type { CSSProperties, MouseEvent } from "react";
import X from "lucide-react/dist/esm/icons/x";
import { X } from "lucide-react";
import { highlightLine, languageFromPath } from "../../../utils/syntax";
import { OpenAppMenu } from "../../app/components/OpenAppMenu";
import { PopoverSurface } from "../../design-system/components/popover/PopoverPrimitives";
Expand Down
7 changes: 1 addition & 6 deletions src/features/files/components/FileTreePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import { Menu, MenuItem } from "@tauri-apps/api/menu";
import { LogicalPosition } from "@tauri-apps/api/dpi";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { revealItemInDir } from "@tauri-apps/plugin-opener";
import Plus from "lucide-react/dist/esm/icons/plus";
import ChevronsUpDown from "lucide-react/dist/esm/icons/chevrons-up-down";
import File from "lucide-react/dist/esm/icons/file";
import Folder from "lucide-react/dist/esm/icons/folder";
import GitBranch from "lucide-react/dist/esm/icons/git-branch";
import Search from "lucide-react/dist/esm/icons/search";
import { ChevronsUpDown, File, Folder, GitBranch, Plus, Search } from "lucide-react";
import type { PanelTabId } from "../../layout/components/PanelTabs";
import { PanelShell } from "../../layout/components/PanelShell";
import {
Expand Down
5 changes: 1 addition & 4 deletions src/features/git/components/GitDiffPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { LogicalPosition } from "@tauri-apps/api/dpi";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { ask } from "@tauri-apps/plugin-dialog";
import { openUrl } from "@tauri-apps/plugin-opener";
import FileText from "lucide-react/dist/esm/icons/file-text";
import GitBranch from "lucide-react/dist/esm/icons/git-branch";
import ScrollText from "lucide-react/dist/esm/icons/scroll-text";
import Search from "lucide-react/dist/esm/icons/search";
import { FileText, GitBranch, ScrollText, Search } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
import type { PanelTabId } from "../../layout/components/PanelTabs";
import { PanelShell } from "../../layout/components/PanelShell";
Expand Down
8 changes: 1 addition & 7 deletions src/features/git/components/GitDiffPanelModeContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ import type { GitHubIssue, GitHubPullRequest, GitLogEntry } from "../../../types
import type { MouseEvent as ReactMouseEvent } from "react";
import { useCallback, useEffect, useState } from "react";
import { openUrl } from "@tauri-apps/plugin-opener";
import ArrowLeftRight from "lucide-react/dist/esm/icons/arrow-left-right";
import ChevronDown from "lucide-react/dist/esm/icons/chevron-down";
import ChevronRight from "lucide-react/dist/esm/icons/chevron-right";
import Download from "lucide-react/dist/esm/icons/download";
import RotateCcw from "lucide-react/dist/esm/icons/rotate-ccw";
import RotateCw from "lucide-react/dist/esm/icons/rotate-cw";
import Upload from "lucide-react/dist/esm/icons/upload";
import { ArrowLeftRight, ChevronDown, ChevronRight, Download, RotateCcw, RotateCw, Upload } from "lucide-react";
import { formatRelativeTime } from "../../../utils/time";
import {
MagicSparkleIcon,
Expand Down
7 changes: 1 addition & 6 deletions src/features/git/components/GitDiffPanelShared.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import type { GitLogEntry } from "../../../types";
import type { MouseEvent as ReactMouseEvent } from "react";
import Check from "lucide-react/dist/esm/icons/check";
import Minus from "lucide-react/dist/esm/icons/minus";
import Plus from "lucide-react/dist/esm/icons/plus";
import RotateCcw from "lucide-react/dist/esm/icons/rotate-ccw";
import Upload from "lucide-react/dist/esm/icons/upload";
import X from "lucide-react/dist/esm/icons/x";
import { Check, Minus, Plus, RotateCcw, Upload, X } from "lucide-react";
import { MagicSparkleIcon } from "../../shared/components/MagicSparkleIcon";
import { formatRelativeTime } from "../../../utils/time";
import {
Expand Down
3 changes: 1 addition & 2 deletions src/features/git/components/GitDiffViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { ask } from "@tauri-apps/plugin-dialog";
import { useVirtualizer } from "@tanstack/react-virtual";
import type { SelectedLineRange } from "@pierre/diffs";
import { WorkerPoolContextProvider } from "@pierre/diffs/react";
import GitCommitHorizontal from "lucide-react/dist/esm/icons/git-commit-horizontal";
import RotateCcw from "lucide-react/dist/esm/icons/rotate-ccw";
import { GitCommitHorizontal, RotateCcw } from "lucide-react";
import type { ParsedDiffLine } from "../../../utils/diff";
import { workerFactory } from "../../../utils/diffsWorker";
import type {
Expand Down
2 changes: 1 addition & 1 deletion src/features/git/components/GitDiffViewerDiffCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
type SelectedLineRange,
} from "@pierre/diffs";
import { FileDiff } from "@pierre/diffs/react";
import RotateCcw from "lucide-react/dist/esm/icons/rotate-ccw";
import { RotateCcw } from "lucide-react";
import type {
PullRequestReviewAction,
PullRequestReviewIntent,
Expand Down
3 changes: 1 addition & 2 deletions src/features/git/components/ImageDiffCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { memo, useMemo } from "react";
import ImageOff from "lucide-react/dist/esm/icons/image-off";
import RotateCcw from "lucide-react/dist/esm/icons/rotate-ccw";
import { ImageOff, RotateCcw } from "lucide-react";
import { splitPath } from "./GitDiffPanel.utils";

type ImageDiffCardProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/features/git/hooks/useGitLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function useGitLog(
}
void refresh();
const interval = window.setInterval(() => {
refresh().catch(() => {});
refresh().catch((err) => console.debug("git log refresh failed", err));
}, REFRESH_INTERVAL_MS);
return () => {
window.clearInterval(interval);
Expand Down
2 changes: 1 addition & 1 deletion src/features/git/hooks/useGitRemote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function useGitRemote(activeWorkspace: WorkspaceInfo | null) {
return;
}

refresh()?.catch(() => {});
refresh()?.catch((err) => console.debug("git remote refresh failed", err));
}, [refresh, workspaceId]);

return { ...state, refresh };
Expand Down
2 changes: 1 addition & 1 deletion src/features/git/hooks/useGitStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function useGitStatus(activeWorkspace: WorkspaceInfo | null) {
}

const fetchStatus = () => {
refresh()?.catch(() => {});
refresh()?.catch((err) => console.debug("git status refresh failed", err));
};

fetchStatus();
Expand Down
2 changes: 1 addition & 1 deletion src/features/home/components/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import RefreshCw from "lucide-react/dist/esm/icons/refresh-cw";
import { RefreshCw } from "lucide-react";
import type { LocalUsageSnapshot } from "../../../types";
import { formatRelativeTime } from "../../../utils/time";

Expand Down
4 changes: 2 additions & 2 deletions src/features/home/hooks/useLocalUsage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export function useLocalUsage(enabled: boolean, workspacePath: string | null) {
if (!enabled) {
return;
}
refresh()?.catch(() => {});
refresh()?.catch((err) => console.debug("local usage refresh failed", err));
const interval = window.setInterval(() => {
refresh()?.catch(() => {});
refresh()?.catch((err) => console.debug("local usage refresh failed", err));
}, REFRESH_INTERVAL_MS);
return () => {
window.clearInterval(interval);
Expand Down
Loading