From 3b327eb3f334ef7b36a09b323ca8dcd24317f3c7 Mon Sep 17 00:00:00 2001 From: xCyanGrizzly Date: Fri, 22 May 2026 23:08:08 +0200 Subject: [PATCH] feat(app): show attempt count column on the Skipped Packages tab attemptCount goes through SkippedPackageItem and SkippedRow into a new column on the data table. Badge color cues: - outline (1) first failure, will auto-retry next cycle - secondary (2-4) has retried but still below cap - destructive (>=5) hit the cap; will not auto-retry until reset The "Skipped" column is renamed to "Last Skipped" since the timestamp now reflects the most recent attempt, not the first. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../(app)/stls/_components/skipped-columns.tsx | 16 +++++++++++++++- src/lib/telegram/queries.ts | 1 + src/lib/telegram/types.ts | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/app/(app)/stls/_components/skipped-columns.tsx b/src/app/(app)/stls/_components/skipped-columns.tsx index 9181847..5644d56 100644 --- a/src/app/(app)/stls/_components/skipped-columns.tsx +++ b/src/app/(app)/stls/_components/skipped-columns.tsx @@ -20,6 +20,7 @@ export interface SkippedRow { sourceChannel: { id: string; title: string }; isMultipart: boolean; partCount: number; + attemptCount: number; createdAt: string; } @@ -107,9 +108,22 @@ export function getSkippedColumns({ ), accessorFn: (row) => row.sourceChannel.title, }, + { + accessorKey: "attemptCount", + header: ({ column }) => , + cell: ({ row }) => { + const count = row.original.attemptCount; + const variant = count >= 5 ? "destructive" : count > 1 ? "secondary" : "outline"; + return ( + + {count} + + ); + }, + }, { accessorKey: "createdAt", - header: ({ column }) => , + header: ({ column }) => , cell: ({ row }) => ( {new Date(row.original.createdAt).toLocaleDateString()} diff --git a/src/lib/telegram/queries.ts b/src/lib/telegram/queries.ts index 6ece96a..898a016 100644 --- a/src/lib/telegram/queries.ts +++ b/src/lib/telegram/queries.ts @@ -589,6 +589,7 @@ export async function listSkippedPackages(options: { sourceMessageId: s.sourceMessageId.toString(), isMultipart: s.isMultipart, partCount: s.partCount, + attemptCount: s.attemptCount, createdAt: s.createdAt.toISOString(), })); diff --git a/src/lib/telegram/types.ts b/src/lib/telegram/types.ts index b49f1ab..c36185c 100644 --- a/src/lib/telegram/types.ts +++ b/src/lib/telegram/types.ts @@ -55,6 +55,8 @@ export interface SkippedPackageItem { sourceMessageId: string; isMultipart: boolean; partCount: number; + /** How many times the worker has tried this source message across cycles. */ + attemptCount: number; createdAt: string; }