fix: DiffTable colonnes visibles + filtrage lignes parasites dans Sheets
- table-fixed avec colgroup pour éviter que la colonne Ref écrase les autres - overflow-x-auto pour permettre le scroll si nécessaire - parseSheetRows : ignore les refs invalides (< 2 chars, caractères spéciaux, mots réservés) - parseSheetRows : ignore les lignes sans prix valide (séparateurs, notes) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -56,28 +56,33 @@ export function DiffTable({ diff }: DiffTableProps) {
|
||||
{paginated.length === 0 ? (
|
||||
<p className="text-slate-600 text-sm py-4 text-center">Aucun changement dans cette catégorie.</p>
|
||||
) : (
|
||||
<div className="border border-slate-700 rounded-xl overflow-hidden">
|
||||
<table className="w-full text-xs">
|
||||
<div className="border border-slate-700 rounded-xl overflow-x-auto">
|
||||
<table className="w-full text-xs table-fixed">
|
||||
<colgroup>
|
||||
<col className="w-36" />
|
||||
<col className="w-32" />
|
||||
<col />
|
||||
</colgroup>
|
||||
<thead className="bg-slate-800 text-slate-400">
|
||||
<tr>
|
||||
<th className="px-3 py-2 text-left">Ref</th>
|
||||
<th className="px-3 py-2 text-left">Type</th>
|
||||
<th className="px-3 py-2 text-left">Champs modifiés</th>
|
||||
<th className="px-3 py-2 text-left">Détail</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{paginated.map((change) => (
|
||||
<tr key={change.ref} className={`border-t border-slate-800 ${TYPE_CONFIG[change.type].bg}`}>
|
||||
<td className="px-3 py-2 font-mono text-slate-300">{change.ref}</td>
|
||||
<td className={`px-3 py-2 font-semibold ${TYPE_CONFIG[change.type].color}`}>
|
||||
<td className="px-3 py-2 font-mono text-slate-300 truncate max-w-0" title={change.ref}>{change.ref}</td>
|
||||
<td className={`px-3 py-2 font-semibold whitespace-nowrap ${TYPE_CONFIG[change.type].color}`}>
|
||||
{TYPE_CONFIG[change.type].label}
|
||||
</td>
|
||||
<td className="px-3 py-2 text-slate-400">
|
||||
{change.type === 'update' && change.changedFields?.map((f) => (
|
||||
<span key={f.field} className="inline-block mr-2">
|
||||
<span key={f.field} className="inline-block mr-3">
|
||||
<span className="text-slate-500">{f.field} : </span>
|
||||
<span className="line-through text-red-400">{f.from}</span>
|
||||
<span className="text-slate-400"> → </span>
|
||||
<span className="line-through text-red-400 mr-1">{f.from}</span>
|
||||
<span className="text-slate-500 mr-1">→</span>
|
||||
<span className="text-green-400">{f.to}</span>
|
||||
</span>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user