From 0a6234f93cab555ece2f3002619d4571b98aee9b Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 24 Apr 2026 17:16:05 -0500 Subject: [PATCH] Address file viewer PR review feedback --- server/src/routes/file-resources.ts | 3 ++ ui/src/components/ArtifactFileChip.tsx | 45 ++++++++++++++++++-------- ui/src/components/FileViewerSheet.tsx | 5 ++- ui/src/pages/IssueDetail.test.tsx | 1 + 4 files changed, 38 insertions(+), 16 deletions(-) diff --git a/server/src/routes/file-resources.ts b/server/src/routes/file-resources.ts index f691de5fe38..847d351ed99 100644 --- a/server/src/routes/file-resources.ts +++ b/server/src/routes/file-resources.ts @@ -35,6 +35,9 @@ export function createFileResourceLimiter(opts: { return { acquire(key: string) { const now = Date.now(); + for (const [windowKey, existing] of windowsByKey) { + if (now - existing.startedAt >= windowMs) windowsByKey.delete(windowKey); + } const window = windowsByKey.get(key); if (!window || now - window.startedAt >= windowMs) { windowsByKey.set(key, { startedAt: now, count: 1 }); diff --git a/ui/src/components/ArtifactFileChip.tsx b/ui/src/components/ArtifactFileChip.tsx index e5fe34d902a..8012eb6f39f 100644 --- a/ui/src/components/ArtifactFileChip.tsx +++ b/ui/src/components/ArtifactFileChip.tsx @@ -36,13 +36,23 @@ export function ArtifactFileChip({ ? `Open ${workspaceFileRef.displayPath}${lineSuffix} in the file viewer` : `Workspace file ${workspaceFileRef.displayPath}${lineSuffix}`); - const handleClick = (event: MouseEvent) => { + const classNames = cn( + "paperclip-artifact-file-chip inline-flex items-center gap-1 rounded-sm border border-border bg-muted/60 px-1.5 py-0.5 font-mono text-xs leading-tight text-foreground/90 align-baseline no-underline hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1", + canOpen ? "cursor-pointer" : null, + className, + ); + const content = ( + <> + {showIcon ?