Merge pull request #2114 from langbot-app/fix/duplicate-close

Fix/duplicate close
This commit is contained in:
Guanchao Wang
2026-04-08 15:03:58 +08:00
committed by GitHub
7 changed files with 3035 additions and 1048 deletions
Generated
+4 -4
View File
@@ -1937,7 +1937,7 @@ requires-dist = [
{ name = "ebooklib", specifier = ">=0.18" }, { name = "ebooklib", specifier = ">=0.18" },
{ name = "gewechat-client", specifier = ">=0.1.5" }, { name = "gewechat-client", specifier = ">=0.1.5" },
{ name = "html2text", specifier = ">=2024.2.26" }, { name = "html2text", specifier = ">=2024.2.26" },
{ name = "langbot-plugin", specifier = "==0.3.6" }, { name = "langbot-plugin", specifier = "==0.3.7" },
{ name = "langchain", specifier = ">=0.2.0" }, { name = "langchain", specifier = ">=0.2.0" },
{ name = "langchain-text-splitters", specifier = ">=0.0.1" }, { name = "langchain-text-splitters", specifier = ">=0.0.1" },
{ name = "lark-oapi", specifier = ">=1.4.15" }, { name = "lark-oapi", specifier = ">=1.4.15" },
@@ -1993,7 +1993,7 @@ dev = [
[[package]] [[package]]
name = "langbot-plugin" name = "langbot-plugin"
version = "0.3.6" version = "0.3.7"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "aiofiles" }, { name = "aiofiles" },
@@ -2011,9 +2011,9 @@ dependencies = [
{ name = "watchdog" }, { name = "watchdog" },
{ name = "websockets" }, { name = "websockets" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/ff/f0/e5561bd1ebda0b9345ad6b98718b5f002bb3ca79b5ec294dc77cc10957b9/langbot_plugin-0.3.6.tar.gz", hash = "sha256:20db981e416a640f22246e54517abc2a095d8ccf5e69e06c2674fb8a443f5dbe", size = 179266, upload-time = "2026-03-30T15:58:58.523Z" } sdist = { url = "https://files.pythonhosted.org/packages/12/31/8dc7106cb65004a01e363308343c5a95e35f1722f26c87853e6e12c6fee1/langbot_plugin-0.3.7.tar.gz", hash = "sha256:bc0dea6b1c515d9fc8c3ab14af74bdf3e006d7e20c097b6cb5034f5af4a73cc9", size = 179764, upload-time = "2026-04-03T09:43:17.343Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/a3/f5/ac424c2620e1be98a54a0b8ec0ed256a9c06cea7cd32a30732a1aea5fdc5/langbot_plugin-0.3.6-py3-none-any.whl", hash = "sha256:3238448436c41d50a0a0cf37438d845f0a1371159d440af3411a984e3d4e9eb7", size = 156752, upload-time = "2026-03-30T15:59:00.229Z" }, { url = "https://files.pythonhosted.org/packages/a9/51/1982c199bd4efbfa3c327c95cca7e4ab502610251567000b348c72bca1b1/langbot_plugin-0.3.7-py3-none-any.whl", hash = "sha256:2e2b9e99163ceb14da28b8ce7c4cbc6990dea15684ec78976bc015e5378feea2", size = 157324, upload-time = "2026-04-03T09:43:15.782Z" },
] ]
[[package]] [[package]]
+5 -2
View File
@@ -1,10 +1,13 @@
<!DOCTYPE html> <!doctype html>
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LangBot</title> <title>LangBot</title>
<meta name="description" content="Production-grade platform for building agentic IM bots" /> <meta
name="description"
content="Production-grade platform for building agentic IM bots"
/>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
+2999 -1020
View File
File diff suppressed because it is too large Load Diff
+2 -4
View File
@@ -1,5 +1,5 @@
@import "tailwindcss"; @import 'tailwindcss';
@import "tw-animate-css"; @import 'tw-animate-css';
:root { :root {
/* 适用于 Firefox 的滚动条 */ /* 适用于 Firefox 的滚动条 */
scrollbar-color: rgba(0, 0, 0, 0.2) transparent; /* 滑块颜色 + 轨道颜色 */ scrollbar-color: rgba(0, 0, 0, 0.2) transparent; /* 滑块颜色 + 轨道颜色 */
@@ -74,8 +74,6 @@
} }
} }
@custom-variant dark (&:is(.dark *)); @custom-variant dark (&:is(.dark *));
@theme inline { @theme inline {
@@ -405,7 +405,10 @@ export default function PluginInstallProgressDialog() {
return ( return (
<Dialog open={open} onOpenChange={(o) => !o && handleClose()}> <Dialog open={open} onOpenChange={(o) => !o && handleClose()}>
<DialogContent className="w-[460px] max-h-[80vh] p-6 bg-white dark:bg-[#1a1a1e] overflow-y-auto"> <DialogContent
className="w-[460px] max-h-[80vh] p-6 bg-white dark:bg-[#1a1a1e] overflow-y-auto"
hideCloseButton
>
<DialogHeader> <DialogHeader>
<DialogTitle className="flex items-center gap-3"> <DialogTitle className="flex items-center gap-3">
<Download className="size-5" /> <Download className="size-5" />
@@ -422,14 +425,16 @@ export default function PluginInstallProgressDialog() {
{selectedTask && <TaskProgressContent task={selectedTask} />} {selectedTask && <TaskProgressContent task={selectedTask} />}
<div className="flex justify-end gap-2 mt-2"> <div className="flex justify-end gap-2 mt-2">
{selectedTask && <Button
(selectedTask.stage === InstallStage.DONE || variant="default"
selectedTask.stage === InstallStage.ERROR) && ( size="sm"
<Button variant="outline" size="sm" onClick={handleDismiss}> onClick={
{t('plugins.installProgress.dismiss')} selectedTask?.stage === InstallStage.DONE ||
</Button> selectedTask?.stage === InstallStage.ERROR
)} ? handleDismiss
<Button variant="default" size="sm" onClick={handleClose}> : handleClose
}
>
{selectedTask?.stage === InstallStage.DONE || {selectedTask?.stage === InstallStage.DONE ||
selectedTask?.stage === InstallStage.ERROR selectedTask?.stage === InstallStage.ERROR
? t('common.close') ? t('common.close')
+10 -5
View File
@@ -109,8 +109,11 @@ function DialogOverlay({
function DialogContent({ function DialogContent({
className, className,
children, children,
hideCloseButton = false,
...props ...props
}: React.ComponentProps<typeof DialogPrimitive.Content>) { }: React.ComponentProps<typeof DialogPrimitive.Content> & {
hideCloseButton?: boolean;
}) {
return ( return (
<DialogPortal data-slot="dialog-portal"> <DialogPortal data-slot="dialog-portal">
<DialogOverlay /> <DialogOverlay />
@@ -123,10 +126,12 @@ function DialogContent({
{...props} {...props}
> >
{children} {children}
<DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"> {!hideCloseButton && (
<XIcon /> <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
<span className="sr-only">Close</span> <XIcon />
</DialogPrimitive.Close> <span className="sr-only">Close</span>
</DialogPrimitive.Close>
)}
</DialogPrimitive.Content> </DialogPrimitive.Content>
</DialogPortal> </DialogPortal>
); );
+1 -4
View File
@@ -17,9 +17,6 @@
"@/*": ["./src/*"] "@/*": ["./src/*"]
} }
}, },
"include": [ "include": ["**/*.ts", "**/*.tsx"],
"**/*.ts",
"**/*.tsx"
],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }