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
This commit is contained in:
Generated
+2
-12
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "openpylon",
|
"name": "openpylon",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "openpylon",
|
"name": "openpylon",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
"@dnd-kit/sortable": "^10.0.0",
|
"@dnd-kit/sortable": "^10.0.0",
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
"@tauri-apps/plugin-fs": "^2.4.5",
|
"@tauri-apps/plugin-fs": "^2.4.5",
|
||||||
"@tauri-apps/plugin-notification": "^2.3.3",
|
"@tauri-apps/plugin-notification": "^2.3.3",
|
||||||
"@tauri-apps/plugin-opener": "^2",
|
"@tauri-apps/plugin-opener": "^2",
|
||||||
"@tauri-apps/plugin-shell": "^2.3.5",
|
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "^1.1.1",
|
"cmdk": "^1.1.1",
|
||||||
@@ -4524,15 +4523,6 @@
|
|||||||
"@tauri-apps/api": "^2.8.0"
|
"@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": {
|
"node_modules/@tootallnate/quickjs-emscripten": {
|
||||||
"version": "0.23.0",
|
"version": "0.23.0",
|
||||||
"resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz",
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
"@tauri-apps/plugin-fs": "^2.4.5",
|
"@tauri-apps/plugin-fs": "^2.4.5",
|
||||||
"@tauri-apps/plugin-notification": "^2.3.3",
|
"@tauri-apps/plugin-notification": "^2.3.3",
|
||||||
"@tauri-apps/plugin-opener": "^2",
|
"@tauri-apps/plugin-opener": "^2",
|
||||||
"@tauri-apps/plugin-shell": "^2.3.5",
|
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "^1.1.1",
|
"cmdk": "^1.1.1",
|
||||||
|
|||||||
Generated
-73
@@ -793,15 +793,6 @@ version = "1.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7"
|
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]]
|
[[package]]
|
||||||
name = "endi"
|
name = "endi"
|
||||||
version = "1.1.1"
|
version = "1.1.1"
|
||||||
@@ -2370,7 +2361,6 @@ dependencies = [
|
|||||||
"tauri-plugin-fs",
|
"tauri-plugin-fs",
|
||||||
"tauri-plugin-notification",
|
"tauri-plugin-notification",
|
||||||
"tauri-plugin-opener",
|
"tauri-plugin-opener",
|
||||||
"tauri-plugin-shell",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2389,16 +2379,6 @@ dependencies = [
|
|||||||
"pin-project-lite",
|
"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]]
|
[[package]]
|
||||||
name = "pango"
|
name = "pango"
|
||||||
version = "0.18.3"
|
version = "0.18.3"
|
||||||
@@ -3343,44 +3323,12 @@ dependencies = [
|
|||||||
"digest",
|
"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]]
|
[[package]]
|
||||||
name = "shlex"
|
name = "shlex"
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
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]]
|
[[package]]
|
||||||
name = "signal-hook-registry"
|
name = "signal-hook-registry"
|
||||||
version = "1.4.8"
|
version = "1.4.8"
|
||||||
@@ -3851,27 +3799,6 @@ dependencies = [
|
|||||||
"zbus",
|
"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]]
|
[[package]]
|
||||||
name = "tauri-runtime"
|
name = "tauri-runtime"
|
||||||
version = "2.10.0"
|
version = "2.10.0"
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ tauri = { version = "2", features = [] }
|
|||||||
tauri-plugin-opener = "2"
|
tauri-plugin-opener = "2"
|
||||||
tauri-plugin-fs = "2"
|
tauri-plugin-fs = "2"
|
||||||
tauri-plugin-dialog = "2"
|
tauri-plugin-dialog = "2"
|
||||||
tauri-plugin-shell = "2"
|
|
||||||
tauri-plugin-notification = "2"
|
tauri-plugin-notification = "2"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
"core:window:allow-set-focus",
|
"core:window:allow-set-focus",
|
||||||
"opener:default",
|
"opener:default",
|
||||||
"dialog:default",
|
"dialog:default",
|
||||||
"shell:default",
|
|
||||||
"fs:default",
|
"fs:default",
|
||||||
"fs:read-all",
|
"fs:read-all",
|
||||||
"fs:write-all",
|
"fs:write-all",
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ pub fn run() {
|
|||||||
.plugin(tauri_plugin_opener::init())
|
.plugin(tauri_plugin_opener::init())
|
||||||
.plugin(tauri_plugin_fs::init())
|
.plugin(tauri_plugin_fs::init())
|
||||||
.plugin(tauri_plugin_dialog::init())
|
.plugin(tauri_plugin_dialog::init())
|
||||||
.plugin(tauri_plugin_shell::init())
|
|
||||||
.plugin(tauri_plugin_notification::init())
|
.plugin(tauri_plugin_notification::init())
|
||||||
.setup(|app| {
|
.setup(|app| {
|
||||||
// Get portable data directory next to the exe
|
// Get portable data directory next to the exe
|
||||||
|
|||||||
+8
-5
@@ -13,7 +13,6 @@ import { SettingsDialog } from "@/components/settings/SettingsDialog";
|
|||||||
import { ToastContainer } from "@/components/toast/ToastContainer";
|
import { ToastContainer } from "@/components/toast/ToastContainer";
|
||||||
import { ShortcutHelpModal } from "@/components/shortcuts/ShortcutHelpModal";
|
import { ShortcutHelpModal } from "@/components/shortcuts/ShortcutHelpModal";
|
||||||
import { useKeyboardShortcuts } from "@/hooks/useKeyboardShortcuts";
|
import { useKeyboardShortcuts } from "@/hooks/useKeyboardShortcuts";
|
||||||
import { useAnnounceStore } from "@/hooks/useAnnounce";
|
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const initialized = useAppStore((s) => s.initialized);
|
const initialized = useAppStore((s) => s.initialized);
|
||||||
@@ -21,7 +20,6 @@ export default function App() {
|
|||||||
const view = useAppStore((s) => s.view);
|
const view = useAppStore((s) => s.view);
|
||||||
const reduceMotion = useAppStore((s) => s.settings.reduceMotion);
|
const reduceMotion = useAppStore((s) => s.settings.reduceMotion);
|
||||||
const boardTitle = useBoardStore((s) => s.board?.title);
|
const boardTitle = useBoardStore((s) => s.board?.title);
|
||||||
const announcement = useAnnounceStore((s) => s.message);
|
|
||||||
|
|
||||||
const [settingsOpen, setSettingsOpen] = useState(false);
|
const [settingsOpen, setSettingsOpen] = useState(false);
|
||||||
const [shortcutHelpOpen, setShortcutHelpOpen] = useState(false);
|
const [shortcutHelpOpen, setShortcutHelpOpen] = useState(false);
|
||||||
@@ -49,8 +47,16 @@ export default function App() {
|
|||||||
useBoardStore.getState().closeBoard();
|
useBoardStore.getState().closeBoard();
|
||||||
}
|
}
|
||||||
window.addEventListener("beforeunload", handleBeforeUnload);
|
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 () => {
|
return () => {
|
||||||
window.removeEventListener("beforeunload", handleBeforeUnload);
|
window.removeEventListener("beforeunload", handleBeforeUnload);
|
||||||
|
unlistenClose.then((fn) => fn());
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -136,9 +142,6 @@ export default function App() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<MotionConfig reducedMotion={reduceMotion ? "always" : "user"}>
|
<MotionConfig reducedMotion={reduceMotion ? "always" : "user"}>
|
||||||
<div aria-live="assertive" aria-atomic="true" className="sr-only">
|
|
||||||
{announcement}
|
|
||||||
</div>
|
|
||||||
<AppShell>
|
<AppShell>
|
||||||
<AnimatePresence mode="wait">
|
<AnimatePresence mode="wait">
|
||||||
{view.type === "board-list" ? (
|
{view.type === "board-list" ? (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useRef, useEffect, useCallback } from "react";
|
import React, { useState, useRef, useEffect, useCallback } from "react";
|
||||||
import { Plus } from "lucide-react";
|
import { Plus } from "lucide-react";
|
||||||
|
import { parse } from "date-fns";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
import { OverlayScrollbarsComponent, type OverlayScrollbarsComponentRef } from "overlayscrollbars-react";
|
import { OverlayScrollbarsComponent, type OverlayScrollbarsComponentRef } from "overlayscrollbars-react";
|
||||||
import { staggerContainer } from "@/lib/motion";
|
import { staggerContainer } from "@/lib/motion";
|
||||||
@@ -96,19 +97,18 @@ export function BoardView() {
|
|||||||
if (filters.dueDate !== "all") {
|
if (filters.dueDate !== "all") {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||||
if (filters.dueDate === "none" && card.dueDate != null) return false;
|
// dueDate is 'yyyy-MM-dd', which new Date() reads as UTC midnight
|
||||||
if (filters.dueDate === "overdue" && (!card.dueDate || new Date(card.dueDate) >= today)) return false;
|
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 (filters.dueDate === "today") {
|
||||||
if (!card.dueDate) return false;
|
if (!due || due.toDateString() !== today.toDateString()) return false;
|
||||||
const d = new Date(card.dueDate);
|
|
||||||
if (d.toDateString() !== today.toDateString()) return false;
|
|
||||||
}
|
}
|
||||||
if (filters.dueDate === "week") {
|
if (filters.dueDate === "week") {
|
||||||
if (!card.dueDate) return false;
|
if (!due) return false;
|
||||||
const d = new Date(card.dueDate);
|
|
||||||
const weekEnd = new Date(today);
|
const weekEnd = new Date(today);
|
||||||
weekEnd.setDate(weekEnd.getDate() + 7);
|
weekEnd.setDate(weekEnd.getDate() + 7);
|
||||||
if (d < today || d > weekEnd) return false;
|
if (due < today || due > weekEnd) return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState, useRef, useEffect } from "react";
|
import { useState, useRef, useEffect } from "react";
|
||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
import { format } from "date-fns";
|
import { format, parse } from "date-fns";
|
||||||
import { motion, useReducedMotion, AnimatePresence } from "framer-motion";
|
import { motion, useReducedMotion, AnimatePresence } from "framer-motion";
|
||||||
import { fadeSlideUp, springs } from "@/lib/motion";
|
import { fadeSlideUp, springs } from "@/lib/motion";
|
||||||
import { useSortable } from "@dnd-kit/sortable";
|
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 {
|
function getDueDateStatus(dueDate: string | null): { color: string; bgColor: string; label: string } | null {
|
||||||
if (!dueDate) return null;
|
if (!dueDate) return null;
|
||||||
const date = new Date(dueDate);
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
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));
|
const diffDays = Math.ceil((dueDay.getTime() - today.getTime()) / (1000 * 60 * 60 * 24));
|
||||||
|
|
||||||
if (diffDays < 0) {
|
if (diffDays < 0) {
|
||||||
|
|||||||
@@ -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<typeof badgeVariants> & { asChild?: boolean }) {
|
|
||||||
const Comp = asChild ? Slot.Root : "span"
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Comp
|
|
||||||
data-slot="badge"
|
|
||||||
data-variant={variant}
|
|
||||||
className={cn(badgeVariants({ variant }), className)}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export { Badge, badgeVariants }
|
|
||||||
@@ -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<typeof ScrollAreaPrimitive.Root>) {
|
|
||||||
return (
|
|
||||||
<ScrollAreaPrimitive.Root
|
|
||||||
data-slot="scroll-area"
|
|
||||||
className={cn("relative", className)}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
<ScrollAreaPrimitive.Viewport
|
|
||||||
data-slot="scroll-area-viewport"
|
|
||||||
className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</ScrollAreaPrimitive.Viewport>
|
|
||||||
<ScrollBar />
|
|
||||||
<ScrollAreaPrimitive.Corner />
|
|
||||||
</ScrollAreaPrimitive.Root>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function ScrollBar({
|
|
||||||
className,
|
|
||||||
orientation = "vertical",
|
|
||||||
...props
|
|
||||||
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
||||||
return (
|
|
||||||
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
||||||
data-slot="scroll-area-scrollbar"
|
|
||||||
orientation={orientation}
|
|
||||||
className={cn(
|
|
||||||
"flex touch-none p-px transition-colors select-none",
|
|
||||||
orientation === "vertical" &&
|
|
||||||
"h-full w-2.5 border-l border-l-transparent",
|
|
||||||
orientation === "horizontal" &&
|
|
||||||
"h-2.5 flex-col border-t border-t-transparent",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
||||||
data-slot="scroll-area-thumb"
|
|
||||||
className="bg-border relative flex-1 rounded-full"
|
|
||||||
/>
|
|
||||||
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export { ScrollArea, ScrollBar }
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import * as React from "react"
|
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
|
||||||
|
|
||||||
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|
||||||
return (
|
|
||||||
<textarea
|
|
||||||
data-slot="textarea"
|
|
||||||
className={cn(
|
|
||||||
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export { Textarea }
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { create } from "zustand";
|
|
||||||
|
|
||||||
interface AnnounceState {
|
|
||||||
message: string;
|
|
||||||
announce: (text: string) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const useAnnounceStore = create<AnnounceState>((set) => ({
|
|
||||||
message: "",
|
|
||||||
announce: (text) => {
|
|
||||||
// Clear first to ensure re-announcement of identical messages
|
|
||||||
set({ message: "" });
|
|
||||||
requestAnimationFrame(() => set({ message: text }));
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
export function useAnnounce() {
|
|
||||||
return useAnnounceStore((s) => s.announce);
|
|
||||||
}
|
|
||||||
@@ -35,13 +35,6 @@ export function useKeyboardShortcuts(): void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Escape: close any open modal/dialog
|
|
||||||
// Note: Radix dialogs handle their own Escape, but this covers custom modals
|
|
||||||
if (e.key === "Escape") {
|
|
||||||
document.dispatchEvent(new CustomEvent("close-all-modals"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e.key === "?" || (e.shiftKey && e.key === "/")) {
|
if (e.key === "?" || (e.shiftKey && e.key === "/")) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
document.dispatchEvent(new CustomEvent("open-shortcut-help"));
|
document.dispatchEvent(new CustomEvent("open-shortcut-help"));
|
||||||
|
|||||||
@@ -17,12 +17,6 @@ export const fadeSlideUp: Variants = {
|
|||||||
exit: { opacity: 0, y: -8 },
|
exit: { opacity: 0, y: -8 },
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fadeSlideDown: Variants = {
|
|
||||||
hidden: { opacity: 0, y: -12 },
|
|
||||||
visible: { opacity: 1, y: 0 },
|
|
||||||
exit: { opacity: 0, y: 8 },
|
|
||||||
};
|
|
||||||
|
|
||||||
export const fadeSlideLeft: Variants = {
|
export const fadeSlideLeft: Variants = {
|
||||||
hidden: { opacity: 0, x: 40 },
|
hidden: { opacity: 0, x: 40 },
|
||||||
visible: { opacity: 1, x: 0 },
|
visible: { opacity: 1, x: 0 },
|
||||||
|
|||||||
+3
-20
@@ -221,24 +221,6 @@ export async function deleteBoard(boardId: string): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Backup restoration
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
export async function restoreFromBackup(boardId: string): Promise<Board> {
|
|
||||||
const boardsDir = await getBoardsDir();
|
|
||||||
const backupPath = await boardBackupPath(boardsDir, boardId);
|
|
||||||
|
|
||||||
const raw = await readTextFile(backupPath);
|
|
||||||
const data = JSON.parse(raw);
|
|
||||||
const board = boardSchema.parse(data) as Board;
|
|
||||||
|
|
||||||
// Save the restored board as the current version
|
|
||||||
await saveBoard(board);
|
|
||||||
|
|
||||||
return board;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Search
|
// Search
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -361,10 +343,11 @@ export async function listBackups(boardId: string): Promise<BackupEntry[]> {
|
|||||||
const raw = await readTextFile(filePath);
|
const raw = await readTextFile(filePath);
|
||||||
const data = JSON.parse(raw);
|
const data = JSON.parse(raw);
|
||||||
const board = boardSchema.parse(data);
|
const board = boardSchema.parse(data);
|
||||||
const isoMatch = entry.name.match(/\d{4}-\d{2}-\d{2}T[\d.]+Z/);
|
// createBackup swaps the colons in the ISO stamp for dashes, so stitch them back
|
||||||
|
const isoMatch = entry.name.match(/(\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2}\.\d+Z)/);
|
||||||
backups.push({
|
backups.push({
|
||||||
filename: entry.name,
|
filename: entry.name,
|
||||||
timestamp: isoMatch ? isoMatch[0].replace(/-(?=\d{2}-\d{2}T)/g, "-") : board.updatedAt,
|
timestamp: isoMatch ? `${isoMatch[1]}:${isoMatch[2]}:${isoMatch[3]}` : board.updatedAt,
|
||||||
cardCount: Object.keys(board.cards).length,
|
cardCount: Object.keys(board.cards).length,
|
||||||
columnCount: board.columns.length,
|
columnCount: board.columns.length,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ export const useBoardStore = create<BoardState & BoardActions>()(
|
|||||||
openBoard: async (boardId: string) => {
|
openBoard: async (boardId: string) => {
|
||||||
const board = await loadBoard(boardId);
|
const board = await loadBoard(boardId);
|
||||||
set({ board, saving: false, lastSaved: null });
|
set({ board, saving: false, lastSaved: null });
|
||||||
|
// Drop history carried over from the previous board, and the set above
|
||||||
|
useBoardStore.temporal.getState().clear();
|
||||||
},
|
},
|
||||||
|
|
||||||
closeBoard: () => {
|
closeBoard: () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user