feat: clean tool page nav, add Import from Files on dropzone

- Removed Automate/Editor/Files links from top nav on tool pages,
  keeping only the breadcrumb + help + avatar for a cleaner look
- Added "Import from Files" link on the tool dropzone that navigates
  to the file library, letting users import previously processed files
This commit is contained in:
SnapOtter
2026-06-14 21:37:15 +08:00
parent f32b3bd51f
commit b5eef644e3
23 changed files with 33 additions and 24 deletions
@@ -1,6 +1,7 @@
import type { Tool } from "@snapotter/shared";
import { FileImage } from "lucide-react";
import { FileImage, FolderOpen } from "lucide-react";
import { useMemo } from "react";
import { Link } from "react-router-dom";
import { useTranslation } from "@/contexts/i18n-context";
import { format } from "@/lib/format";
import { ICON_MAP } from "@/lib/icon-map";
@@ -71,6 +72,15 @@ export function ToolDropzone({
acceptDescription={formatsDisplay ?? undefined}
/>
{/* Import from library */}
<Link
to="/files"
state={{ selectForTool: tool.id }}
className="inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors"
>
<FolderOpen className="h-4 w-4" />
{t.toolPage.importFromFiles}
</Link>
</div>
);
}
+1 -23
View File
@@ -195,30 +195,8 @@ export function TopNav({
{/* Spacer */}
<div className="flex-1" />
{/* Right: Contextual nav links (when breadcrumb) + help + avatar */}
{/* Right: help + avatar */}
<div className="flex items-center gap-1">
{breadcrumb && (
<>
{navLinks
.filter((link) => link.href !== "/")
.map((link) => (
<Link
key={link.href}
to={link.href}
className={cn(
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors",
isDark
? "text-[#aaa] hover:text-[#e0e0e0] hover:bg-[#333]"
: "text-muted-foreground hover:text-foreground hover:bg-muted",
)}
>
{link.label}
</Link>
))}
<div className={cn("w-px h-5 mx-1", isDark ? "bg-[#444]" : "bg-border")} />
</>
)}
<button
type="button"
onClick={onHelpClick}