Clarify markdown preview fallback toast
Co-authored-by: Codex <[email protected]> Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
360747433f
commit
0075ca2bb2
3 files changed
+23
-8
No files matched your search
@@ -1060,9 +1060,12 @@ const MarkdownFileLink = memo(function MarkdownFileLink({
|
||||
const error = squashAtomCommandFailure(result);
|
||||
toastManager.add(
|
||||
stackedThreadToast({
|
||||
type: "error",
|
||||
title: "Unable to open file in browser",
|
||||
description: error instanceof Error ? error.message : "An error occurred.",
|
||||
type: "warning",
|
||||
title: "Unable to open file preview",
|
||||
description:
|
||||
error instanceof Error
|
||||
? `${error.message} Opening the file instead.`
|
||||
: "Opening the file instead.",
|
||||
}),
|
||||
);
|
||||
handleOpenInFilePreview();
|
||||
@@ -1073,9 +1076,12 @@ const MarkdownFileLink = memo(function MarkdownFileLink({
|
||||
);
|
||||
toastManager.add(
|
||||
stackedThreadToast({
|
||||
type: "error",
|
||||
title: "Unable to open file in browser",
|
||||
description: cause instanceof Error ? cause.message : "An error occurred.",
|
||||
type: "warning",
|
||||
title: "Unable to open file preview",
|
||||
description:
|
||||
cause instanceof Error
|
||||
? `${cause.message} Opening the file instead.`
|
||||
: "Opening the file instead.",
|
||||
}),
|
||||
);
|
||||
handleOpenInFilePreview();
|
||||
@@ -1470,6 +1476,7 @@ function ChatMarkdown({
|
||||
threadRef={threadRef}
|
||||
onOpen={openInPreferredEditor}
|
||||
onOpenInBrowser={
|
||||
fileLinkMeta.workspaceRelativePath !== null &&
|
||||
threadRef &&
|
||||
isPreviewSupportedInRuntime() &&
|
||||
isWorkspacePreviewFile(fileLinkMeta.filePath)
|
||||
|
||||
@@ -2776,7 +2776,11 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
createAssetUrl,
|
||||
openPreview,
|
||||
});
|
||||
if (result._tag === "Success" || isAtomCommandInterrupted(result)) {
|
||||
if (result._tag === "Success") {
|
||||
return;
|
||||
}
|
||||
if (isAtomCommandInterrupted(result)) {
|
||||
openFallback();
|
||||
return;
|
||||
}
|
||||
const error = squashAtomCommandFailure(result);
|
||||
|
||||
@@ -503,7 +503,11 @@ export default function DiffPanel({ mode = "inline", composerDraftTarget }: Diff
|
||||
createAssetUrl,
|
||||
openPreview,
|
||||
});
|
||||
if (result._tag === "Success" || isAtomCommandInterrupted(result)) {
|
||||
if (result._tag === "Success") {
|
||||
return;
|
||||
}
|
||||
if (isAtomCommandInterrupted(result)) {
|
||||
openFallback();
|
||||
return;
|
||||
}
|
||||
const error = squashAtomCommandFailure(result);
|
||||
|
||||
Reference in new issue
Block a user