Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qjclaw-dmg
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AI-甘富林
qjclaw-dmg
Commits
ef2f3d16
Commit
ef2f3d16
authored
May 20, 2026
by
edy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ui): default automation tasks to general assistant
parent
c8f6b1df
Pipeline
#18476
failed
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
AutomationTasksView.tsx
apps/ui/src/features/automation/AutomationTasksView.tsx
+8
-8
automationTasksSource.test.ts
apps/ui/test/automationTasksSource.test.ts
+14
-0
No files found.
apps/ui/src/features/automation/AutomationTasksView.tsx
View file @
ef2f3d16
...
@@ -46,12 +46,12 @@ function toDateTimeLocalValue(date: Date) {
...
@@ -46,12 +46,12 @@ function toDateTimeLocalValue(date: Date) {
return
`
${
year
}
-
${
month
}
-
${
day
}
T
${
hour
}
:
${
minute
}
`
return
`
${
year
}
-
${
month
}
-
${
day
}
T
${
hour
}
:
${
minute
}
`
}
}
function
createDefaultForm
(
projects
:
ProjectSummary
[]
):
AutomationTaskFormState
{
function
createDefaultForm
():
AutomationTaskFormState
{
const
nextHour
=
new
Date
(
Date
.
now
()
+
60
*
60
*
1000
)
const
nextHour
=
new
Date
(
Date
.
now
()
+
60
*
60
*
1000
)
return
{
return
{
title
:
""
,
title
:
""
,
prompt
:
""
,
prompt
:
""
,
expertId
:
projects
[
0
]?.
id
??
""
,
expertId
:
""
,
enabled
:
true
,
enabled
:
true
,
scheduleKind
:
"daily"
,
scheduleKind
:
"daily"
,
runAt
:
toDateTimeLocalValue
(
nextHour
),
runAt
:
toDateTimeLocalValue
(
nextHour
),
...
@@ -61,7 +61,7 @@ function createDefaultForm(projects: ProjectSummary[]): AutomationTaskFormState
...
@@ -61,7 +61,7 @@ function createDefaultForm(projects: ProjectSummary[]): AutomationTaskFormState
}
}
function
formFromTask
(
task
:
AutomationTask
):
AutomationTaskFormState
{
function
formFromTask
(
task
:
AutomationTask
):
AutomationTaskFormState
{
const
base
=
createDefaultForm
(
[]
)
const
base
=
createDefaultForm
()
const
schedule
=
task
.
schedule
const
schedule
=
task
.
schedule
return
{
return
{
id
:
task
.
id
,
id
:
task
.
id
,
...
@@ -193,10 +193,6 @@ export function AutomationTasksView({ projects }: AutomationTasksViewProps) {
...
@@ -193,10 +193,6 @@ export function AutomationTasksView({ projects }: AutomationTasksViewProps) {
}))
}))
],
[
projects
])
],
[
projects
])
const
selectedTask
=
useMemo
(
()
=>
tasks
.
find
((
task
)
=>
task
.
id
===
selectedTaskId
)
??
tasks
[
0
],
[
selectedTaskId
,
tasks
]
)
const
filteredTasks
=
useMemo
(()
=>
tasks
.
filter
((
task
)
=>
{
const
filteredTasks
=
useMemo
(()
=>
tasks
.
filter
((
task
)
=>
{
if
(
filterMode
===
"enabled"
)
{
if
(
filterMode
===
"enabled"
)
{
return
task
.
enabled
return
task
.
enabled
...
@@ -206,6 +202,10 @@ export function AutomationTasksView({ projects }: AutomationTasksViewProps) {
...
@@ -206,6 +202,10 @@ export function AutomationTasksView({ projects }: AutomationTasksViewProps) {
}
}
return
true
return
true
}),
[
filterMode
,
tasks
])
}),
[
filterMode
,
tasks
])
const
selectedTask
=
useMemo
(
()
=>
filteredTasks
.
find
((
task
)
=>
task
.
id
===
selectedTaskId
)
??
filteredTasks
[
0
],
[
selectedTaskId
,
filteredTasks
]
)
useEffect
(()
=>
{
useEffect
(()
=>
{
selectedTaskIdRef
.
current
=
selectedTask
?.
id
??
""
selectedTaskIdRef
.
current
=
selectedTask
?.
id
??
""
...
@@ -252,7 +252,7 @@ export function AutomationTasksView({ projects }: AutomationTasksViewProps) {
...
@@ -252,7 +252,7 @@ export function AutomationTasksView({ projects }: AutomationTasksViewProps) {
},
[
loadSelectedTaskRuns
])
},
[
loadSelectedTaskRuns
])
const
startCreate
=
()
=>
{
const
startCreate
=
()
=>
{
setForm
(
createDefaultForm
(
projects
))
setForm
(
createDefaultForm
())
}
}
const
startEdit
=
(
task
:
AutomationTask
)
=>
{
const
startEdit
=
(
task
:
AutomationTask
)
=>
{
...
...
apps/ui/test/automationTasksSource.test.ts
View file @
ef2f3d16
...
@@ -61,6 +61,14 @@ test("automation task edit can clear the selected expert", () => {
...
@@ -61,6 +61,14 @@ test("automation task edit can clear the selected expert", () => {
assert
.
match
(
automationViewSource
,
/const expertName = form
\.
expertId
\?
selectedExpert
\?\.
label :
\(
form
\.
id
\?
null : undefined
\)
/
)
assert
.
match
(
automationViewSource
,
/const expertName = form
\.
expertId
\?
selectedExpert
\?\.
label :
\(
form
\.
id
\?
null : undefined
\)
/
)
})
})
test
(
"automation task default expert is labeled as the general assistant"
,
()
=>
{
assert
.
match
(
automationViewSource
,
/expertId: "",/
)
assert
.
match
(
automationViewSource
,
/
\{
id: "", label: "通用助手"
\}
/
)
assert
.
match
(
automationViewSource
,
/<span className="automation-kicker">
\{
selectedTask
\.
expertName
\|\|
"通用助手"
\}
<
\/
span>/
)
assert
.
doesNotMatch
(
automationViewSource
,
/千匠问天/
)
assert
.
doesNotMatch
(
mockApiSource
,
/expertName:
\s
*"千匠问天"/
)
})
test
(
"automation run replies use shared markdown rendering"
,
()
=>
{
test
(
"automation run replies use shared markdown rendering"
,
()
=>
{
assert
.
match
(
automationViewSource
,
/renderChatMessageContent/
)
assert
.
match
(
automationViewSource
,
/renderChatMessageContent/
)
assert
.
match
(
automationViewSource
,
/markdown-body automation-run-markdown/
)
assert
.
match
(
automationViewSource
,
/markdown-body automation-run-markdown/
)
...
@@ -127,6 +135,12 @@ test("run-now button derives selected task running state from optimistic state o
...
@@ -127,6 +135,12 @@ test("run-now button derives selected task running state from optimistic state o
assert
.
match
(
automationViewSource
,
/disabled=
\{
saving
\|\|
isRunningSelectedTask
\}
/
)
assert
.
match
(
automationViewSource
,
/disabled=
\{
saving
\|\|
isRunningSelectedTask
\}
/
)
})
})
test
(
"automation detail selection follows the filtered task list"
,
()
=>
{
assert
.
match
(
automationViewSource
,
/const selectedTask = useMemo
\(\s
*
\(\)
=> filteredTasks
\.
find
\(\(
task
\)
=> task
\.
id === selectedTaskId
\)
\?\?
filteredTasks
\[
0
\]
/
s
)
assert
.
match
(
automationViewSource
,
/
\[
selectedTaskId, filteredTasks
\]
/
)
assert
.
doesNotMatch
(
automationViewSource
,
/tasks
\.
find
\(\(
task
\)
=> task
\.
id === selectedTaskId
\)
\?\?
tasks
\[
0
\]
/
)
})
test
(
"automation task runs poll while a selected task has optimistic state or active run records"
,
()
=>
{
test
(
"automation task runs poll while a selected task has optimistic state or active run records"
,
()
=>
{
assert
.
match
(
automationViewSource
,
/const loadSelectedTaskRuns = useCallback/
)
assert
.
match
(
automationViewSource
,
/const loadSelectedTaskRuns = useCallback/
)
assert
.
match
(
automationViewSource
,
/const selectedTaskIdRef = useRef
\(
""
\)
/
)
assert
.
match
(
automationViewSource
,
/const selectedTaskIdRef = useRef
\(
""
\)
/
)
...
...
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