From 26c66c55554b0d024cd684e964cbdcb7568d6658 Mon Sep 17 00:00:00 2001 From: lashman Date: Mon, 16 Nov 2026 18:52:16 +0200 Subject: [PATCH] fix backup ordering, undo bleed across boards, close flush, due dates drops the unused announce hook, three unimported ui components, fadeSlideDown, restoreFromBackup and the close-all-modals event, plus the shell plugin from npm and cargo --- package-lock.json | 14 +---- package.json | 1 - src-tauri/Cargo.lock | 73 -------------------------- src-tauri/Cargo.toml | 1 - src-tauri/capabilities/default.json | 1 - src-tauri/src/lib.rs | 1 - src/App.tsx | 13 +++-- src/components/board/BoardView.tsx | 16 +++--- src/components/board/CardThumbnail.tsx | 6 +-- src/components/ui/badge.tsx | 48 ----------------- src/components/ui/scroll-area.tsx | 58 -------------------- src/components/ui/textarea.tsx | 18 ------- src/hooks/useAnnounce.ts | 19 ------- src/hooks/useKeyboardShortcuts.ts | 7 --- src/lib/motion.ts | 6 --- src/lib/storage.ts | 23 ++------ src/stores/board-store.ts | 2 + 17 files changed, 26 insertions(+), 281 deletions(-) delete mode 100644 src/components/ui/badge.tsx delete mode 100644 src/components/ui/scroll-area.tsx delete mode 100644 src/components/ui/textarea.tsx delete mode 100644 src/hooks/useAnnounce.ts diff --git a/package-lock.json b/package-lock.json index 7cb9c7b..93b60d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "openpylon", - "version": "1.0.0", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openpylon", - "version": "1.0.0", + "version": "1.1.0", "dependencies": { "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", @@ -17,7 +17,6 @@ "@tauri-apps/plugin-fs": "^2.4.5", "@tauri-apps/plugin-notification": "^2.3.3", "@tauri-apps/plugin-opener": "^2", - "@tauri-apps/plugin-shell": "^2.3.5", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.1.1", @@ -4524,15 +4523,6 @@ "@tauri-apps/api": "^2.8.0" } }, - "node_modules/@tauri-apps/plugin-shell": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-shell/-/plugin-shell-2.3.5.tgz", - "integrity": "sha512-jewtULhiQ7lI7+owCKAjc8tYLJr92U16bPOeAa472LHJdgaibLP83NcfAF2e+wkEcA53FxKQAZ7byDzs2eeizg==", - "license": "MIT OR Apache-2.0", - "dependencies": { - "@tauri-apps/api": "^2.10.1" - } - }, "node_modules/@tootallnate/quickjs-emscripten": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", diff --git a/package.json b/package.json index 2aaf281..d7eb21e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "@tauri-apps/plugin-fs": "^2.4.5", "@tauri-apps/plugin-notification": "^2.3.3", "@tauri-apps/plugin-opener": "^2", - "@tauri-apps/plugin-shell": "^2.3.5", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.1.1", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 0a679a3..a1ea171 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -793,15 +793,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - [[package]] name = "endi" version = "1.1.1" @@ -2370,7 +2361,6 @@ dependencies = [ "tauri-plugin-fs", "tauri-plugin-notification", "tauri-plugin-opener", - "tauri-plugin-shell", ] [[package]] @@ -2389,16 +2379,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "os_pipe" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - [[package]] name = "pango" version = "0.18.3" @@ -3343,44 +3323,12 @@ dependencies = [ "digest", ] -[[package]] -name = "shared_child" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7" -dependencies = [ - "libc", - "sigchld", - "windows-sys 0.60.2", -] - [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "sigchld" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47106eded3c154e70176fc83df9737335c94ce22f821c32d17ed1db1f83badb1" -dependencies = [ - "libc", - "os_pipe", - "signal-hook", -] - -[[package]] -name = "signal-hook" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" version = "1.4.8" @@ -3851,27 +3799,6 @@ dependencies = [ "zbus", ] -[[package]] -name = "tauri-plugin-shell" -version = "2.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8457dbf9e2bab1edd8df22bb2c20857a59a9868e79cb3eac5ed639eec4d0c73b" -dependencies = [ - "encoding_rs", - "log", - "open", - "os_pipe", - "regex", - "schemars 0.8.22", - "serde", - "serde_json", - "shared_child", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", - "tokio", -] - [[package]] name = "tauri-runtime" version = "2.10.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 0ab46aa..a1f2bdf 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -22,7 +22,6 @@ tauri = { version = "2", features = [] } tauri-plugin-opener = "2" tauri-plugin-fs = "2" tauri-plugin-dialog = "2" -tauri-plugin-shell = "2" tauri-plugin-notification = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 6b7310a..adb29e2 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -15,7 +15,6 @@ "core:window:allow-set-focus", "opener:default", "dialog:default", - "shell:default", "fs:default", "fs:read-all", "fs:write-all", diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 825188f..e627e3e 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -16,7 +16,6 @@ pub fn run() { .plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_fs::init()) .plugin(tauri_plugin_dialog::init()) - .plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_notification::init()) .setup(|app| { // Get portable data directory next to the exe diff --git a/src/App.tsx b/src/App.tsx index 37b6ee6..afc395f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,7 +13,6 @@ import { SettingsDialog } from "@/components/settings/SettingsDialog"; import { ToastContainer } from "@/components/toast/ToastContainer"; import { ShortcutHelpModal } from "@/components/shortcuts/ShortcutHelpModal"; import { useKeyboardShortcuts } from "@/hooks/useKeyboardShortcuts"; -import { useAnnounceStore } from "@/hooks/useAnnounce"; export default function App() { const initialized = useAppStore((s) => s.initialized); @@ -21,7 +20,6 @@ export default function App() { const view = useAppStore((s) => s.view); const reduceMotion = useAppStore((s) => s.settings.reduceMotion); const boardTitle = useBoardStore((s) => s.board?.title); - const announcement = useAnnounceStore((s) => s.message); const [settingsOpen, setSettingsOpen] = useState(false); const [shortcutHelpOpen, setShortcutHelpOpen] = useState(false); @@ -49,8 +47,16 @@ export default function App() { useBoardStore.getState().closeBoard(); } window.addEventListener("beforeunload", handleBeforeUnload); + + // The title bar close button skips beforeunload on some platforms + const appWindow = getCurrentWindow(); + const unlistenClose = appWindow.onCloseRequested(() => { + useBoardStore.getState().closeBoard(); + }); + return () => { window.removeEventListener("beforeunload", handleBeforeUnload); + unlistenClose.then((fn) => fn()); }; }, []); @@ -136,9 +142,6 @@ export default function App() { return ( -
- {announcement} -
{view.type === "board-list" ? ( diff --git a/src/components/board/BoardView.tsx b/src/components/board/BoardView.tsx index 41a4798..cdb0bbb 100644 --- a/src/components/board/BoardView.tsx +++ b/src/components/board/BoardView.tsx @@ -1,5 +1,6 @@ import React, { useState, useRef, useEffect, useCallback } from "react"; import { Plus } from "lucide-react"; +import { parse } from "date-fns"; import { AnimatePresence, motion } from "framer-motion"; import { OverlayScrollbarsComponent, type OverlayScrollbarsComponentRef } from "overlayscrollbars-react"; import { staggerContainer } from "@/lib/motion"; @@ -96,19 +97,18 @@ export function BoardView() { if (filters.dueDate !== "all") { const now = new Date(); const today = new Date(now.getFullYear(), now.getMonth(), now.getDate()); - if (filters.dueDate === "none" && card.dueDate != null) return false; - if (filters.dueDate === "overdue" && (!card.dueDate || new Date(card.dueDate) >= today)) return false; + // dueDate is 'yyyy-MM-dd', which new Date() reads as UTC midnight + const due = card.dueDate ? parse(card.dueDate, "yyyy-MM-dd", now) : null; + if (filters.dueDate === "none" && due != null) return false; + if (filters.dueDate === "overdue" && (!due || due >= today)) return false; if (filters.dueDate === "today") { - if (!card.dueDate) return false; - const d = new Date(card.dueDate); - if (d.toDateString() !== today.toDateString()) return false; + if (!due || due.toDateString() !== today.toDateString()) return false; } if (filters.dueDate === "week") { - if (!card.dueDate) return false; - const d = new Date(card.dueDate); + if (!due) return false; const weekEnd = new Date(today); weekEnd.setDate(weekEnd.getDate() + 7); - if (d < today || d > weekEnd) return false; + if (due < today || due > weekEnd) return false; } } return true; diff --git a/src/components/board/CardThumbnail.tsx b/src/components/board/CardThumbnail.tsx index c96623a..3467dbf 100644 --- a/src/components/board/CardThumbnail.tsx +++ b/src/components/board/CardThumbnail.tsx @@ -1,6 +1,6 @@ import { useState, useRef, useEffect } from "react"; import { createPortal } from "react-dom"; -import { format } from "date-fns"; +import { format, parse } from "date-fns"; import { motion, useReducedMotion, AnimatePresence } from "framer-motion"; import { fadeSlideUp, springs } from "@/lib/motion"; import { useSortable } from "@dnd-kit/sortable"; @@ -26,10 +26,10 @@ import { useBoardStore } from "@/stores/board-store"; function getDueDateStatus(dueDate: string | null): { color: string; bgColor: string; label: string } | null { if (!dueDate) return null; - const date = new Date(dueDate); const now = new Date(); const today = new Date(now.getFullYear(), now.getMonth(), now.getDate()); - const dueDay = new Date(date.getFullYear(), date.getMonth(), date.getDate()); + // dueDate is 'yyyy-MM-dd', which new Date() reads as UTC midnight + const dueDay = parse(dueDate, "yyyy-MM-dd", now); const diffDays = Math.ceil((dueDay.getTime() - today.getTime()) / (1000 * 60 * 60 * 24)); if (diffDays < 0) { diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx deleted file mode 100644 index beb56ed..0000000 --- a/src/components/ui/badge.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import * as React from "react" -import { cva, type VariantProps } from "class-variance-authority" -import { Slot } from "radix-ui" - -import { cn } from "@/lib/utils" - -const badgeVariants = cva( - "inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", - { - variants: { - variant: { - default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90", - secondary: - "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90", - destructive: - "bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", - outline: - "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground", - ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground", - link: "text-primary underline-offset-4 [a&]:hover:underline", - }, - }, - defaultVariants: { - variant: "default", - }, - } -) - -function Badge({ - className, - variant = "default", - asChild = false, - ...props -}: React.ComponentProps<"span"> & - VariantProps & { asChild?: boolean }) { - const Comp = asChild ? Slot.Root : "span" - - return ( - - ) -} - -export { Badge, badgeVariants } diff --git a/src/components/ui/scroll-area.tsx b/src/components/ui/scroll-area.tsx deleted file mode 100644 index 0f873dc..0000000 --- a/src/components/ui/scroll-area.tsx +++ /dev/null @@ -1,58 +0,0 @@ -"use client" - -import * as React from "react" -import { ScrollArea as ScrollAreaPrimitive } from "radix-ui" - -import { cn } from "@/lib/utils" - -function ScrollArea({ - className, - children, - ...props -}: React.ComponentProps) { - return ( - - - {children} - - - - - ) -} - -function ScrollBar({ - className, - orientation = "vertical", - ...props -}: React.ComponentProps) { - return ( - - - - ) -} - -export { ScrollArea, ScrollBar } diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx deleted file mode 100644 index c5c86a9..0000000 --- a/src/components/ui/textarea.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import * as React from "react" - -import { cn } from "@/lib/utils" - -function Textarea({ className, ...props }: React.ComponentProps<"textarea">) { - return ( -