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}
+1
View File
@@ -2446,6 +2446,7 @@ export const ar: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "تطبيق وتنزيل",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2460,6 +2460,7 @@ export const de: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Anwenden & Herunterladen",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2410,6 +2410,7 @@ export const en = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Apply & Download",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2442,6 +2442,7 @@ export const es: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Aplicar y descargar",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2461,6 +2461,7 @@ export const fr: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Appliquer et télécharger",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2443,6 +2443,7 @@ export const hi: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "लागू करें और डाउनलोड करें",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2455,6 +2455,7 @@ export const id: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Terapkan & Unduh",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2454,6 +2454,7 @@ export const it: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Applica e scarica",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2413,6 +2413,7 @@ export const ja: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "適用してダウンロード",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2398,6 +2398,7 @@ export const ko: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "적용 및 다운로드",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2457,6 +2457,7 @@ export const nl: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Toepassen en downloaden",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2458,6 +2458,7 @@ export const pl: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Zastosuj i pobierz",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2454,6 +2454,7 @@ export const ptBR: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Aplicar e baixar",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2456,6 +2456,7 @@ export const ru: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Применить и скачать",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2453,6 +2453,7 @@ export const sv: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Tillämpa och ladda ner",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2435,6 +2435,7 @@ export const th: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "นำไปใช้และดาวน์โหลด",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2458,6 +2458,7 @@ export const tr: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Uygula ve indir",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2456,6 +2456,7 @@ export const uk: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Застосувати та завантажити",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2455,6 +2455,7 @@ export const vi: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "Áp dụng và tải xuống",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2388,6 +2388,7 @@ export const zhCN: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "应用并下载",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",
+1
View File
@@ -2386,6 +2386,7 @@ export const zhTW: TranslationKeys = {
privacyNote: "Files are processed on your server and never leave your network",
applyAndDownload: "套用並下載",
andMore: "and {count} more",
importFromFiles: "Import from Files",
adjustSettings: "Adjust settings",
startOver: "Start over with a new file",
backToTools: "Back to Tools",