Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
11629846
提交
11629846
authored
4月 21, 2025
作者:
Will Chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a help button + dialog
上级
e2a489e1
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
90 行增加
和
1 行删除
+90
-1
HelpDialog.tsx
src/components/HelpDialog.tsx
+67
-0
app-sidebar.tsx
src/components/app-sidebar.tsx
+23
-1
没有找到文件。
src/components/HelpDialog.tsx
0 → 100644
浏览文件 @
11629846
import
{
Dialog
,
DialogContent
,
DialogDescription
,
DialogHeader
,
DialogTitle
,
DialogFooter
,
}
from
"@/components/ui/dialog"
;
import
{
Button
}
from
"@/components/ui/button"
;
import
{
BookOpenIcon
,
BugIcon
}
from
"lucide-react"
;
import
{
IpcClient
}
from
"@/ipc/ipc_client"
;
interface
HelpDialogProps
{
isOpen
:
boolean
;
onClose
:
()
=>
void
;
}
export
function
HelpDialog
({
isOpen
,
onClose
}:
HelpDialogProps
)
{
return
(
<
Dialog
open=
{
isOpen
}
onOpenChange=
{
onClose
}
>
<
DialogContent
>
<
DialogHeader
>
<
DialogTitle
>
Need help with Dyad?
</
DialogTitle
>
</
DialogHeader
>
<
DialogDescription
className=
""
>
If you need assistance or want to report an issue, here are some
resources:
</
DialogDescription
>
<
div
className=
"flex flex-col space-y-4 w-full"
>
<
div
className=
"flex flex-col space-y-2"
>
<
Button
variant=
"outline"
onClick=
{
()
=>
{
IpcClient
.
getInstance
().
openExternalUrl
(
"https://www.dyad.sh/docs"
);
}
}
className=
"w-full py-6 bg-(--background-lightest)"
>
<
BookOpenIcon
className=
"mr-2 h-5 w-5"
/>
Open Docs
</
Button
>
<
p
className=
"text-sm text-muted-foreground px-2"
>
Get help with common questions and issues.
</
p
>
</
div
>
<
div
className=
"flex flex-col space-y-2"
>
<
Button
variant=
"outline"
onClick=
{
()
=>
IpcClient
.
getInstance
().
openExternalUrl
(
"https://github.com/dyad-sh/dyad/issues/new"
)
}
className=
"w-full py-6 bg-(--background-lightest)"
>
<
BugIcon
className=
"mr-2 h-5 w-5"
/>
Report a Bug
</
Button
>
<
p
className=
"text-sm text-muted-foreground px-2"
>
We’ll auto-fill your report with system info and logs. You can
review it for any sensitive info before submitting.
</
p
>
</
div
>
</
div
>
</
DialogContent
>
</
Dialog
>
);
}
src/components/app-sidebar.tsx
浏览文件 @
11629846
import
{
Home
,
Inbox
,
Settings
}
from
"lucide-react"
;
import
{
Home
,
Inbox
,
Settings
,
HelpCircle
}
from
"lucide-react"
;
import
{
Link
,
useRouterState
}
from
"@tanstack/react-router"
;
import
{
Link
,
useRouterState
}
from
"@tanstack/react-router"
;
import
{
useSidebar
}
from
"@/components/ui/sidebar"
;
// import useSidebar hook
import
{
useSidebar
}
from
"@/components/ui/sidebar"
;
// import useSidebar hook
import
{
useEffect
,
useState
,
useRef
}
from
"react"
;
import
{
useEffect
,
useState
,
useRef
}
from
"react"
;
...
@@ -17,6 +17,7 @@ import {
...
@@ -17,6 +17,7 @@ import {
}
from
"@/components/ui/sidebar"
;
}
from
"@/components/ui/sidebar"
;
import
{
ChatList
}
from
"./ChatList"
;
import
{
ChatList
}
from
"./ChatList"
;
import
{
AppList
}
from
"./AppList"
;
import
{
AppList
}
from
"./AppList"
;
import
{
HelpDialog
}
from
"./HelpDialog"
;
// Import the new dialog
import
{
usePostHog
}
from
"posthog-js/react"
;
import
{
usePostHog
}
from
"posthog-js/react"
;
// Menu items.
// Menu items.
...
@@ -49,6 +50,7 @@ export function AppSidebar() {
...
@@ -49,6 +50,7 @@ export function AppSidebar() {
const
{
state
,
toggleSidebar
}
=
useSidebar
();
// retrieve current sidebar state
const
{
state
,
toggleSidebar
}
=
useSidebar
();
// retrieve current sidebar state
const
[
hoverState
,
setHoverState
]
=
useState
<
HoverState
>
(
"no-hover"
);
const
[
hoverState
,
setHoverState
]
=
useState
<
HoverState
>
(
"no-hover"
);
const
expandedByHover
=
useRef
(
false
);
const
expandedByHover
=
useRef
(
false
);
const
[
isHelpDialogOpen
,
setIsHelpDialogOpen
]
=
useState
(
false
);
// State for dialog
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
if
(
...
@@ -114,6 +116,26 @@ export function AppSidebar() {
...
@@ -114,6 +116,26 @@ export function AppSidebar() {
</
div
>
</
div
>
</
SidebarContent
>
</
SidebarContent
>
<
SidebarFooter
>
<
SidebarMenu
>
<
SidebarMenuItem
>
{
/* Change button to open dialog instead of linking */
}
<
SidebarMenuButton
size=
"sm"
className=
"font-medium w-14 flex flex-col items-center gap-1 h-14 mb-2 rounded-2xl"
onClick=
{
()
=>
setIsHelpDialogOpen
(
true
)
}
// Open dialog on click
>
<
HelpCircle
className=
"h-5 w-5"
/>
<
span
className=
{
"text-xs"
}
>
Help
</
span
>
</
SidebarMenuButton
>
<
HelpDialog
isOpen=
{
isHelpDialogOpen
}
onClose=
{
()
=>
setIsHelpDialogOpen
(
false
)
}
/>
</
SidebarMenuItem
>
</
SidebarMenu
>
</
SidebarFooter
>
<
SidebarRail
/>
<
SidebarRail
/>
</
Sidebar
>
</
Sidebar
>
);
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论