Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
5b8008ff
Commit
5b8008ff
authored
Dec 02, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:常见问题鼠标悬浮效果&&关闭页签后按钮高亮逻辑
parent
1f2aae8c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
src/components/ChatEditor/index.tsx
+14
-1
src/pages/Home/components/QuestionList/QuestionList.tsx
+7
-1
No files found.
src/components/ChatEditor/index.tsx
View file @
5b8008ff
...
...
@@ -97,6 +97,19 @@ const ChatEditorBase: React.FC<ChatEditorProps & WithAuthProps> = ({ checkAuth,
// 根据 currentToolId 以及 sessionStorage 中的记录决定高亮逻辑
useEffect
(()
=>
{
// 场景:项目作为三方后台的子菜单时,外层可能清空了 sessionStorage,
// 但重新打开时仍使用带有 ?toolId=xxx 的旧 URL。
// 如果此时 Redux 和 sessionStorage 中都没有 currentToolId,则认为 URL 中的 toolId 已失效,
// 主动移除该查询参数并强制回到「通用模式」,避免错误高亮到上一次的工具模式。
if
(
!
currentToolId
&&
!
sessionToolId
&&
toolIdFromUrl
)
{
const
newSearchParams
=
new
URLSearchParams
(
searchParams
)
newSearchParams
.
delete
(
'toolId'
)
setSearchParams
(
newSearchParams
,
{
replace
:
true
})
setSelectedToolId
(
null
)
setIsToolBtnActive
(
true
)
return
}
// 只有当 sessionStorage 或 URL 中还能找到 toolId 时,才认为 Redux 中的 currentToolId 仍然有效
const
hasPersistentToolSource
=
Boolean
(
sessionToolId
||
toolIdFromUrl
)
...
...
@@ -121,7 +134,7 @@ const ChatEditorBase: React.FC<ChatEditorProps & WithAuthProps> = ({ checkAuth,
setSelectedToolId
(
null
)
setIsToolBtnActive
(
true
)
}
},
[
currentToolId
,
sessionToolId
,
toolIdFromUrl
])
},
[
currentToolId
,
sessionToolId
,
toolIdFromUrl
,
searchParams
,
setSearchParams
])
// 监听 sessionStorage 中的 currentToolId(历史点击时写入)来辅助高亮逻辑
useEffect
(()
=>
{
...
...
src/pages/Home/components/QuestionList/QuestionList.tsx
View file @
5b8008ff
...
...
@@ -183,7 +183,13 @@ const QuestionListBase: React.FC<QuestionListProps & WithAuthProps> = ({
layout
className=
"w-full"
>
<
Tooltip
color=
"foreground"
content=
{
item
}
placement=
"top"
>
<
Tooltip
color=
"foreground"
content=
{
item
}
placement=
"top"
// 鼠标移出后尽快关闭 Tooltip,避免停留过长
closeDelay=
{
0
}
>
<
button
type=
"button"
onClick=
{
()
=>
handleClick
(
item
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment