fix(registratura): redesign NAS attachment card to prevent overflow

Replaced two-row layout (short path + full UNC path) with compact
single-row: filename only + NAS badge + Copiaza/Copiat badge.
Full path shown in native tooltip on hover, copied on click.
Uses <button> instead of <div> for proper block formatting.
Removed font-mono (caused no-break overflow), removed shortDisplayPath
import, added pathFileName import, removed unused FolderOpen icon.
This commit is contained in:
AI Assistant
2026-02-28 19:20:13 +02:00
parent ea4f245467
commit 08b7485646
@@ -9,7 +9,6 @@ import {
Copy, Copy,
ExternalLink, ExternalLink,
FileText, FileText,
FolderOpen,
GitBranch, GitBranch,
HardDrive, HardDrive,
Link2, Link2,
@@ -34,7 +33,7 @@ import {
import type { RegistryEntry } from "../types"; import type { RegistryEntry } from "../types";
import { DEFAULT_DOC_TYPE_LABELS } from "../types"; import { DEFAULT_DOC_TYPE_LABELS } from "../types";
import { getOverdueDays } from "../services/registry-service"; import { getOverdueDays } from "../services/registry-service";
import { shortDisplayPath, shareLabelFor } from "@/config/nas-paths"; import { pathFileName, shareLabelFor } from "@/config/nas-paths";
import { cn } from "@/shared/lib/utils"; import { cn } from "@/shared/lib/utils";
import { useState, useCallback } from "react"; import { useState, useCallback } from "react";
@@ -396,38 +395,41 @@ export function RegistryEntryDetail({
<div className="space-y-2"> <div className="space-y-2">
{entry.attachments.map((att) => {entry.attachments.map((att) =>
att.networkPath ? ( att.networkPath ? (
<div <button
type="button"
key={att.id} key={att.id}
className="rounded-md border border-blue-200 dark:border-blue-800 bg-blue-50/50 dark:bg-blue-950/20 px-3 py-2 group cursor-pointer hover:bg-blue-100/50 dark:hover:bg-blue-900/30 transition-colors overflow-hidden" className="w-full text-left rounded-md border border-blue-200 dark:border-blue-800 bg-blue-50/50 dark:bg-blue-950/20 px-3 py-2 group cursor-pointer hover:bg-blue-100/50 dark:hover:bg-blue-900/30 transition-colors"
onClick={() => copyPath(att.networkPath!)} onClick={() => copyPath(att.networkPath!)}
title="Click pentru a copia calea — lipește în Explorer" title={att.networkPath}
> >
<div className="flex items-center gap-2 min-w-0"> <div className="flex items-center gap-2">
<HardDrive className="h-4 w-4 text-blue-600 dark:text-blue-400 shrink-0" /> <HardDrive className="h-4 w-4 text-blue-600 dark:text-blue-400 shrink-0" />
<div className="flex-1 min-w-0 truncate"> <span className="text-sm text-blue-700 dark:text-blue-300 truncate block">
<span className="text-sm text-blue-700 dark:text-blue-300 font-mono"> {pathFileName(att.networkPath)}
<FolderOpen className="mr-1 inline h-3 w-3" /> </span>
{shortDisplayPath(att.networkPath)} <span className="ml-auto flex items-center gap-1.5 shrink-0">
</span> <Badge
</div> variant="outline"
<Badge className="text-[10px] border-blue-300 dark:border-blue-700 text-blue-600 dark:text-blue-400"
variant="outline" >
className="text-[10px] border-blue-300 dark:border-blue-700 text-blue-600 dark:text-blue-400 shrink-0" {shareLabelFor(att.networkPath) ?? "NAS"}
>
{shareLabelFor(att.networkPath) ?? "NAS"}
</Badge>
{copiedPath === att.networkPath ? (
<Badge className="text-[10px] bg-green-600 text-white shrink-0 animate-in fade-in">
Copiat!
</Badge> </Badge>
) : ( {copiedPath === att.networkPath ? (
<Copy className="h-3.5 w-3.5 text-blue-400 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity" /> <Badge className="text-[10px] bg-green-600 text-white animate-in fade-in">
)} Copiat!
</Badge>
) : (
<Badge
variant="outline"
className="text-[10px] border-blue-300 dark:border-blue-700 text-blue-600 dark:text-blue-400 opacity-60 group-hover:opacity-100"
>
<Copy className="mr-1 h-3 w-3" />
Copiază
</Badge>
)}
</span>
</div> </div>
<p className="text-[10px] text-muted-foreground mt-1 pl-6 font-mono truncate"> </button>
{att.networkPath}
</p>
</div>
) : ( ) : (
<div <div
key={att.id} key={att.id}