Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
40132ec5
提交
40132ec5
authored
4月 21, 2025
作者:
Will Chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix posthog callsites
上级
0e48d02a
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
6 行增加
和
10 行删除
+6
-10
app-sidebar.tsx
src/components/app-sidebar.tsx
+0
-3
ChatInput.tsx
src/components/chat/ChatInput.tsx
+4
-4
HomeChatInput.tsx
src/components/chat/HomeChatInput.tsx
+0
-1
home.tsx
src/pages/home.tsx
+2
-2
没有找到文件。
src/components/app-sidebar.tsx
浏览文件 @
40132ec5
...
...
@@ -18,7 +18,6 @@ import {
import
{
ChatList
}
from
"./ChatList"
;
import
{
AppList
}
from
"./AppList"
;
import
{
HelpDialog
}
from
"./HelpDialog"
;
// Import the new dialog
import
{
usePostHog
}
from
"posthog-js/react"
;
// Menu items.
const
items
=
[
...
...
@@ -146,8 +145,6 @@ function AppIcons({
}:
{
onHoverChange
:
(
state
:
HoverState
)
=>
void
;
})
{
const
{
capture
}
=
usePostHog
();
const
routerState
=
useRouterState
();
const
pathname
=
routerState
.
location
.
pathname
;
...
...
src/components/chat/ChatInput.tsx
浏览文件 @
40132ec5
...
...
@@ -38,7 +38,7 @@ import { useRunApp } from "@/hooks/useRunApp";
import
{
AutoApproveSwitch
}
from
"../AutoApproveSwitch"
;
import
{
usePostHog
}
from
"posthog-js/react"
;
export
function
ChatInput
({
chatId
}:
{
chatId
?:
number
})
{
const
{
capture
}
=
usePostHog
();
const
posthog
=
usePostHog
();
const
[
inputValue
,
setInputValue
]
=
useAtom
(
chatInputValueAtom
);
const
textareaRef
=
useRef
<
HTMLTextAreaElement
>
(
null
);
const
{
settings
,
updateSettings
,
isAnyProviderSetup
}
=
useSettings
();
...
...
@@ -105,7 +105,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
const
currentInput
=
inputValue
;
setInputValue
(
""
);
await
streamMessage
({
prompt
:
currentInput
,
chatId
});
capture
(
"chat:submit"
);
posthog
.
capture
(
"chat:submit"
);
};
const
handleCancel
=
()
=>
{
...
...
@@ -126,7 +126,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
`Approving proposal for chatId:
${
chatId
}
, messageId:
${
messageId
}
`
);
setIsApproving
(
true
);
capture
(
"chat:approve"
);
posthog
.
capture
(
"chat:approve"
);
try
{
const
result
=
await
IpcClient
.
getInstance
().
approveProposal
({
chatId
,
...
...
@@ -160,7 +160,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
`Rejecting proposal for chatId:
${
chatId
}
, messageId:
${
messageId
}
`
);
setIsRejecting
(
true
);
capture
(
"chat:reject"
);
posthog
.
capture
(
"chat:reject"
);
try
{
const
result
=
await
IpcClient
.
getInstance
().
rejectProposal
({
chatId
,
...
...
src/components/chat/HomeChatInput.tsx
浏览文件 @
40132ec5
...
...
@@ -6,7 +6,6 @@ import { useSettings } from "@/hooks/useSettings";
import
{
homeChatInputValueAtom
}
from
"@/atoms/chatAtoms"
;
// Use a different atom for home input
import
{
useAtom
}
from
"jotai"
;
import
{
useStreamChat
}
from
"@/hooks/useStreamChat"
;
import
{
usePostHog
}
from
"posthog-js/react"
;
export
function
HomeChatInput
({
onSubmit
}:
{
onSubmit
:
()
=>
void
})
{
const
[
inputValue
,
setInputValue
]
=
useAtom
(
homeChatInputValueAtom
);
...
...
src/pages/home.tsx
浏览文件 @
40132ec5
...
...
@@ -24,7 +24,7 @@ export default function HomePage() {
const
setIsPreviewOpen
=
useSetAtom
(
isPreviewOpenAtom
);
const
[
isLoading
,
setIsLoading
]
=
useState
(
false
);
const
{
streamMessage
}
=
useStreamChat
({
hasChatId
:
false
});
const
{
capture
}
=
usePostHog
();
const
posthog
=
usePostHog
();
// Get the appId from search params
const
appId
=
search
.
appId
?
Number
(
search
.
appId
)
:
null
;
...
...
@@ -53,7 +53,7 @@ export default function HomePage() {
setSelectedAppId
(
result
.
app
.
id
);
setIsPreviewOpen
(
false
);
await
refreshApps
();
// Ensure refreshApps is awaited if it's async
capture
(
"home:chat-submit"
);
posthog
.
capture
(
"home:chat-submit"
);
navigate
({
to
:
"/chat"
,
search
:
{
id
:
result
.
chatId
}
});
}
catch
(
error
)
{
console
.
error
(
"Failed to create chat:"
,
error
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论