Merge branch 'main' into feature/689-dedupe-subtasks

This commit is contained in:
Tao Sun 2025-11-19 22:26:16 +08:00 committed by GitHub
commit a99d56d582
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 19 additions and 11 deletions

View file

@ -400,10 +400,15 @@ function registerIpcHandlers() {
});
ipcMain.handle("read-file-dataurl", async (event, filePath) => {
const file = fs.readFileSync(filePath);
const mimeType = mime.getType(path.extname(filePath)) || "application/octet-stream";
return `data:${mimeType};base64,${file.toString("base64")}`;
});
try {
const file = fs.readFileSync(filePath);
const mimeType = mime.getType(path.extname(filePath)) || "application/octet-stream";
return `data:${mimeType};base64,${file.toString("base64")}`;
} catch (error: any) {
log.error('Failed to read file as data URL:', filePath, error);
throw new Error(`Failed to read file: ${error.message}`);
}
});
// ==================== log export handler ====================
ipcMain.handle('export-log', async () => {

View file

@ -72,6 +72,7 @@
"lottie-web": "^5.13.0",
"lucide-react": "^0.509.0",
"mammoth": "^1.9.1",
"mime": "^4.1.0",
"monaco-editor": "^0.52.2",
"motion": "^12.23.24",
"next-themes": "^0.4.6",
@ -100,6 +101,7 @@
"@types/archiver": "^6.0.3",
"@types/dompurify": "^3.0.5",
"@types/lodash-es": "^4.17.12",
"@types/mime": "^3.0.4",
"@types/papaparse": "^5.3.16",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",

View file

@ -104,7 +104,7 @@ const FileTree: React.FC<FileTreeProps> = ({
{!child.isFolder && <span className="w-4" />}
{child.isFolder ? (
<FolderIcon className="w-5 h-5 mr-2flex-shrink-0 text-yellow-600" />
<FolderIcon className="w-5 h-5 mr-2 flex-shrink-0 text-yellow-600" />
) : child.icon ? (
<child.icon className="w-5 h-5 mr-2 flex-shrink-0" />
) : (

View file

@ -24,7 +24,7 @@ import { Sparkle } from "@/components/animate-ui/icons/sparkle";
import { Button } from "@/components/ui/button";
import { useNavigate } from "react-router-dom";
import SearchInput from "./SearchInput";
import { useEffect, useRef, useState, useMemo } from "react";
import { useEffect, useRef, useState, useLayoutEffect, useMemo } from "react";
import { useGlobalStore } from "@/store/globalStore";
import folderIcon from "@/assets/Folder-1.svg";
import { Progress } from "@/components/ui/progress";
@ -238,7 +238,7 @@ export default function HistorySidebar() {
}
};
useEffect(() => {
useLayoutEffect(() => {
const updateAnchor = () => {
const btn = document.getElementById("active-task-title-btn");
if (btn) {
@ -259,7 +259,8 @@ export default function HistorySidebar() {
return (
<AnimatePresence>
{isOpen && (
{isOpen && anchorStyle && (
<>
{/* alert dialog */}
<AlertDialog
@ -281,7 +282,7 @@ export default function HistorySidebar() {
/>
{/* dropdown-style history panel under title bar */}
<motion.div
initial={{ y: -8, opacity: 0 }}
initial={false}
animate={{ y: 0, opacity: 1 }}
exit={{ y: -8, opacity: 0 }}
transition={{ type: "spring", damping: 22, stiffness: 220 }}
@ -289,8 +290,8 @@ export default function HistorySidebar() {
ref={panelRef}
className="backdrop-blur-xl flex flex-col fixed w-[360px] max-h-[70vh] bg-bg-surface-tertiary rounded-xl p-sm z-50 shadow-perfect overflow-hidden"
style={{
left: anchorStyle ? anchorStyle.left : 0,
top: anchorStyle ? anchorStyle.top : 40,
left: anchorStyle.left,
top: anchorStyle.top,
}}
>
<div className="py-2 pl-2 flex justify-between items-center">