From c73dcecb961bb2f2d48f2a8ec9ac982f2ab3c81e Mon Sep 17 00:00:00 2001 From: Yif <877193178@qq.com> Date: Wed, 9 Sep 2026 00:26:36 +0800 Subject: [PATCH] fix(textpreview): say a stat-and-read failure once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A file whose stat and first page both fail — outside the workspace, gone — showed the same line twice: the metadata bar above an identical centred body failure. The bar now stands only over pages already loaded, and the centred retry runs the full reload so one press clears both halves. --- .../src/client/TextPreview.tsx | 8 +++++-- .../tests/text-preview.client.spec.tsx | 21 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/client/ui-sidebar-documentpreview/src/client/TextPreview.tsx b/packages/client/ui-sidebar-documentpreview/src/client/TextPreview.tsx index 9d726e21c7..900d891858 100644 --- a/packages/client/ui-sidebar-documentpreview/src/client/TextPreview.tsx +++ b/packages/client/ui-sidebar-documentpreview/src/client/TextPreview.tsx @@ -186,10 +186,12 @@ export function TextPreview({ } return (
- {meta.failure !== undefined + {meta.failure !== undefined && hasContent ? ( // The file's metadata failed — gone, or its workspace unknown — which // outranks a pending change; the pages already read stay under it. + // With nothing read the body's own failure already says it, so the + // bar would only repeat the same line.

{failureLine(t, meta.failure)}