From 05efd525e3f00d2854dc3a3c83698301818c1e54 Mon Sep 17 00:00:00 2001 From: AI Assistant Date: Sat, 28 Feb 2026 17:55:27 +0200 Subject: [PATCH] fix(registratura): NAS links copy to clipboard instead of broken file:/// Browsers block file:/// URLs from web pages for security. Changed: - Detail sheet: click on NAS attachment copies path to clipboard with 'Copiat!' green badge feedback. Full UNC path shown below. - Entry form: NAS link click = copy path (removed window.open fallback) - Removed unused toFileUrl/toFileUrlByIp imports from form - User pastes in Explorer address bar to open the file --- CLAUDE.md | 30 +++---- .../components/registry-entry-detail.tsx | 89 +++++++------------ .../components/registry-entry-form.tsx | 39 ++------ 3 files changed, 53 insertions(+), 105 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index f679eec..38a9dd9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -96,22 +96,22 @@ legacy/ # Original HTML tools for reference ## Implemented Modules (14/14 — zero placeholders) -| # | Module | Route | Version | Key Features | -| --- | ---------------------- | --------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 1 | **Dashboard** | `/` | 0.1.0 | KPI cards (6), activity feed (last 20), module grid, external tools | -| 2 | **Email Signature** | `/email-signature` | 0.1.0 | Multi-company branding, address toggle (BTG/US/SDT), live preview, zoom/copy/download | -| 3 | **Word XML Generator** | `/word-xml` | 0.1.0 | Category-based XML gen, simple/advanced mode, ZIP export | +| # | Module | Route | Version | Key Features | +| --- | ---------------------- | --------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 1 | **Dashboard** | `/` | 0.1.0 | KPI cards (6), activity feed (last 20), module grid, external tools | +| 2 | **Email Signature** | `/email-signature` | 0.1.0 | Multi-company branding, address toggle (BTG/US/SDT), live preview, zoom/copy/download | +| 3 | **Word XML Generator** | `/word-xml` | 0.1.0 | Category-based XML gen, simple/advanced mode, ZIP export | | 4 | **Registratura** | `/registratura` | 0.3.0 | CRUD registry, dynamic doc types, bidirectional Address Book, threads, backdating, **legal deadline tracking**, recipient registration, document expiry, **NAS network path attachments** (A/O/P/T drives, hostname+IP fallback), **detail sheet side panel**, **configurable column visibility** | -| 5 | **Tag Manager** | `/tag-manager` | 0.2.0 | CRUD tags, category/scope/color, US/SDT seeds, mandatory categories, **ManicTime bidirectional sync** | -| 6 | **IT Inventory** | `/it-inventory` | 0.2.0 | Dynamic equipment types, rented status (purple pulse), **42U rack visualization**, type/status/company filters | -| 7 | **Address Book** | `/address-book` | 0.1.0 | CRUD contacts, card grid, vCard export, Registratura reverse lookup, **dynamic types (creatable)** | -| 8 | **Password Vault** | `/password-vault` | 0.3.0 | CRUD credentials, 9 categorii cu iconițe, **WiFi QR code real**, context-aware form, strength meter, company scope, **AES-256-GCM encryption** | -| 9 | **Mini Utilities** | `/mini-utilities` | 0.1.0 | Text case, char counter, percentage, area converter, U→R, artifact cleaner, MDLPA, PDF reducer, OCR | -| 10 | **Prompt Generator** | `/prompt-generator` | 0.2.0 | Template-driven prompt builder, **18 templates** (14 text + 4 image), search bar, target type filter | -| 11 | **Digital Signatures** | `/digital-signatures` | 0.1.0 | CRUD assets, drag-and-drop file upload, tag chips | -| 12 | **Word Templates** | `/word-templates` | 0.1.0 | Template library, 8 categories, version tracking, .docx placeholder auto-detection | -| 13 | **AI Chat** | `/ai-chat` | 0.2.0 | Multi-provider (OpenAI/Claude/Ollama/demo), **project linking via Tag Manager**, provider status badge | -| 14 | **Hot Desk** | `/hot-desk` | 0.1.0 | 4 desks, week-ahead calendar, room layout (window+door), reserve/cancel | +| 5 | **Tag Manager** | `/tag-manager` | 0.2.0 | CRUD tags, category/scope/color, US/SDT seeds, mandatory categories, **ManicTime bidirectional sync** | +| 6 | **IT Inventory** | `/it-inventory` | 0.2.0 | Dynamic equipment types, rented status (purple pulse), **42U rack visualization**, type/status/company filters | +| 7 | **Address Book** | `/address-book` | 0.1.0 | CRUD contacts, card grid, vCard export, Registratura reverse lookup, **dynamic types (creatable)** | +| 8 | **Password Vault** | `/password-vault` | 0.3.0 | CRUD credentials, 9 categorii cu iconițe, **WiFi QR code real**, context-aware form, strength meter, company scope, **AES-256-GCM encryption** | +| 9 | **Mini Utilities** | `/mini-utilities` | 0.1.0 | Text case, char counter, percentage, area converter, U→R, artifact cleaner, MDLPA, PDF reducer, OCR | +| 10 | **Prompt Generator** | `/prompt-generator` | 0.2.0 | Template-driven prompt builder, **18 templates** (14 text + 4 image), search bar, target type filter | +| 11 | **Digital Signatures** | `/digital-signatures` | 0.1.0 | CRUD assets, drag-and-drop file upload, tag chips | +| 12 | **Word Templates** | `/word-templates` | 0.1.0 | Template library, 8 categories, version tracking, .docx placeholder auto-detection | +| 13 | **AI Chat** | `/ai-chat` | 0.2.0 | Multi-provider (OpenAI/Claude/Ollama/demo), **project linking via Tag Manager**, provider status badge | +| 14 | **Hot Desk** | `/hot-desk` | 0.1.0 | 4 desks, week-ahead calendar, room layout (window+door), reserve/cancel | ### Registratura — Legal Deadline Tracking (Termene Legale) diff --git a/src/modules/registratura/components/registry-entry-detail.tsx b/src/modules/registratura/components/registry-entry-detail.tsx index afd58fd..f9fdd8a 100644 --- a/src/modules/registratura/components/registry-entry-detail.tsx +++ b/src/modules/registratura/components/registry-entry-detail.tsx @@ -34,14 +34,9 @@ import { import type { RegistryEntry } from "../types"; import { DEFAULT_DOC_TYPE_LABELS } from "../types"; import { getOverdueDays } from "../services/registry-service"; -import { - toFileUrl, - toFileUrlByIp, - shortDisplayPath, - shareLabelFor, -} from "@/config/nas-paths"; +import { shortDisplayPath, shareLabelFor } from "@/config/nas-paths"; import { cn } from "@/shared/lib/utils"; -import { useState } from "react"; +import { useState, useCallback } from "react"; interface RegistryEntryDetailProps { entry: RegistryEntry | null; @@ -139,6 +134,13 @@ export function RegistryEntryDetail({ const [previewAttachment, setPreviewAttachment] = useState( null, ); + const [copiedPath, setCopiedPath] = useState(null); + + const copyPath = useCallback(async (path: string) => { + await navigator.clipboard.writeText(path); + setCopiedPath(path); + setTimeout(() => setCopiedPath(null), 2000); + }, []); if (!entry) return null; @@ -396,64 +398,35 @@ export function RegistryEntryDetail({ att.networkPath ? (
copyPath(att.networkPath!)} + title="Click pentru a copia calea — lipește în Explorer" > - - -
+
+ +
+ + + {shortDisplayPath(att.networkPath)} + +
{shareLabelFor(att.networkPath) ?? "NAS"} - - + {copiedPath === att.networkPath ? ( + + Copiat! + + ) : ( + + )}
+

+ {att.networkPath} +

) : (
- { - e.preventDefault(); - window.open(toFileUrl(att.networkPath!), "_blank"); + {shareLabelFor(att.networkPath) ?? "NAS"} -