Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf2f4ed1

Browse files
chore: revert redesign tasks page to match AI tools (#20013)
Reverts#19962
1 parent98b9adc commitf2f4ed1

File tree

13 files changed

+782
-114
lines changed

13 files changed

+782
-114
lines changed

‎offlinedocs/pages/[[...slug]].tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
DrawerOverlay,
1010
Flex,
1111
Grid,
12-
typeGridProps,
12+
GridProps,
1313
Heading,
1414
Icon,
1515
Img,
@@ -28,12 +28,12 @@ import {
2828
importfmfrom"front-matter";
2929
import{readFileSync}from"fs";
3030
import_from"lodash";
31-
importtype{GetStaticPaths,GetStaticProps,NextPage}from"next";
31+
import{GetStaticPaths,GetStaticProps,NextPage}from"next";
3232
importHeadfrom"next/head";
3333
importNextLinkfrom"next/link";
3434
import{useRouter}from"next/router";
3535
importpathfrom"path";
36-
importtype{ReactNode}from"react";
36+
import{ReactNode}from"react";
3737
import{MdMenu}from"react-icons/md";
3838
importReactMarkdownfrom"react-markdown";
3939
importrehypeRawfrom"rehype-raw";

‎site/src/api/api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ export type GetProvisionerDaemonsParams = {
426426
offline?:boolean;
427427
};
428428

429-
typeTasksFilter={
429+
exporttypeTasksFilter={
430430
username?:string;
431431
};
432432

‎site/src/components/Select/Select.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const SelectTrigger = React.forwardRef<
2323
ref={ref}
2424
id={id}
2525
className={cn(
26-
`gap-2flex h-10 w-full font-medium items-center justify-between whitespace-nowrap rounded-md
26+
`flex h-10 w-full font-medium items-center justify-between whitespace-nowrap rounded-md
2727
border border-border border-solid bg-transparent px-3 py-2 text-sm shadow-sm
2828
ring-offset-background text-content-secondary placeholder:text-content-secondary focus:outline-none,
2929
focus:ring-2 focus:ring-content-link disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1

‎site/src/modules/tasks/TasksLayout/TasksLayout.tsx‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎site/src/modules/tasks/TasksSidebar/TasksSidebar.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ export const TasksSidebar: FC = () => {
4141
<divclassName="flex items-center place-content-between">
4242
{!isCollapsed&&(
4343
<Button
44-
asChild
4544
size="icon"
4645
variant="subtle"
4746
className={cn(["size-8 p-0 transition-[margin,opacity]"])}
4847
>
49-
<RouterLinkto="/">
50-
<CoderIconclassName="fill-content-primary !size-6 !p-0"/>
51-
</RouterLink>
48+
<CoderIconclassName="fill-content-primary !size-6 !p-0"/>
5249
</Button>
5350
)}
5451

‎site/src/pages/TaskPage/TaskPage.tsx‎

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,21 @@ import { useWorkspaceBuildLogs } from "hooks/useWorkspaceBuildLogs";
1717
import{ArrowLeftIcon,RotateCcwIcon}from"lucide-react";
1818
import{AgentLogs}from"modules/resources/AgentLogs/AgentLogs";
1919
import{useAgentLogs}from"modules/resources/useAgentLogs";
20+
import{TasksSidebar}from"modules/tasks/TasksSidebar/TasksSidebar";
2021
import{
2122
AI_PROMPT_PARAMETER_NAME,
2223
getTaskApps,
2324
typeTask,
2425
}from"modules/tasks/tasks";
2526
import{WorkspaceErrorDialog}from"modules/workspaces/ErrorDialog/WorkspaceErrorDialog";
2627
import{WorkspaceBuildLogs}from"modules/workspaces/WorkspaceBuildLogs/WorkspaceBuildLogs";
27-
import{typeFC,typeReactNode,useLayoutEffect,useRef}from"react";
28+
import{
29+
typeFC,
30+
typePropsWithChildren,
31+
typeReactNode,
32+
useLayoutEffect,
33+
useRef,
34+
}from"react";
2835
import{useMutation,useQuery,useQueryClient}from"react-query";
2936
import{Panel,PanelGroup,PanelResizeHandle}from"react-resizable-panels";
3037
import{LinkasRouterLink,useParams}from"react-router";
@@ -38,6 +45,15 @@ import { TaskAppIFrame } from "./TaskAppIframe";
3845
import{TaskApps}from"./TaskApps";
3946
import{TaskTopbar}from"./TaskTopbar";
4047

48+
constTaskPageLayout:FC<PropsWithChildren>=({ children})=>{
49+
return(
50+
<divclassName="flex items-stretch h-full">
51+
<TasksSidebar/>
52+
<divclassName="flex flex-col h-full flex-1">{children}</div>
53+
</div>
54+
);
55+
};
56+
4157
constTaskPage=()=>{
4258
const{workspace:workspaceName, username}=useParams()as{
4359
workspace:string;
@@ -57,7 +73,7 @@ const TaskPage = () => {
5773

5874
if(error){
5975
return(
60-
<>
76+
<TaskPageLayout>
6177
<title>{pageTitle("Error loading task")}</title>
6278

6379
<divclassName="w-full min-h-80 flex items-center justify-center">
@@ -82,16 +98,16 @@ const TaskPage = () => {
8298
</div>
8399
</div>
84100
</div>
85-
</>
101+
</TaskPageLayout>
86102
);
87103
}
88104

89105
if(!task){
90106
return(
91-
<>
107+
<TaskPageLayout>
92108
<title>{pageTitle("Loading task")}</title>
93109
<LoaderclassName="w-full h-full"/>
94-
</>
110+
</TaskPageLayout>
95111
);
96112
}
97113

@@ -158,11 +174,12 @@ const TaskPage = () => {
158174
}
159175

160176
return(
161-
<>
177+
<TaskPageLayout>
162178
<title>{pageTitle(task.workspace.name)}</title>
179+
163180
<TaskTopbartask={task}/>
164181
{content}
165-
</>
182+
</TaskPageLayout>
166183
);
167184
};
168185

‎site/src/pages/TasksPage/TaskPrompt.tsx‎

Lines changed: 60 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
}from"components/Tooltip/Tooltip";
3030
import{useAuthenticated}from"hooks/useAuthenticated";
3131
import{useExternalAuth}from"hooks/useExternalAuth";
32-
import{ArrowUpIcon,RedoIcon,RotateCcwIcon}from"lucide-react";
32+
import{RedoIcon,RotateCcwIcon,SendIcon}from"lucide-react";
3333
import{AI_PROMPT_PARAMETER_NAME}from"modules/tasks/tasks";
3434
import{typeFC,useEffect,useState}from"react";
3535
import{useMutation,useQuery,useQueryClient}from"react-query";
@@ -106,8 +106,8 @@ const TaskPromptSkeleton: FC = () => {
106106

107107
{/* Bottom controls skeleton */}
108108
<divclassName="flex items-center justify-between pt-2">
109-
<SkeletonclassName="w-[160px] h-8 rounded-full"/>
110-
<SkeletonclassName="size-8 rounded-full"/>
109+
<SkeletonclassName="w-[208px] h-8"/>
110+
<SkeletonclassName="w-[96px] h-8"/>
111111
</div>
112112
</div>
113113
</div>
@@ -160,17 +160,15 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
160160
}=useExternalAuth(selectedTemplate.active_version_id);
161161

162162
// Fetch presets when template changes
163-
const{data:presets}=useQuery(
163+
const{data:presets,isLoading:isLoadingPresets}=useQuery(
164164
templateVersionPresets(selectedTemplate.active_version_id),
165165
);
166+
constdefaultPreset=presets?.find((p)=>p.Default);
166167

167168
// Handle preset selection when data changes
168169
useEffect(()=>{
169-
if(presets&&presets.length>0){
170-
constdefaultPreset=presets.find((p)=>p.Default)||presets[0];
171-
setSelectedPresetId(defaultPreset.ID);
172-
}
173-
},[presets]);
170+
setSelectedPresetId(defaultPreset?.ID);
171+
},[defaultPreset?.ID]);
174172

175173
// Extract AI prompt from selected preset
176174
constselectedPreset=presets?.find((p)=>p.ID===selectedPresetId);
@@ -227,7 +225,7 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
227225
{externalAuthError&&<ErrorAlerterror={externalAuthError}/>}
228226

229227
<fieldset
230-
className="border border-border border-solid rounded-3xl p-4"
228+
className="border border-border border-solid rounded-lg p-4"
231229
disabled={createTaskMutation.isPending}
232230
>
233231
<label
@@ -253,22 +251,23 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
253251
}`}
254252
/>
255253
<divclassName="flex items-center justify-between pt-2">
256-
<divclassName="flex items-center gap-2">
257-
<div>
258-
<labelhtmlFor="templateID"className="sr-only">
254+
<divclassName="flex items-center gap-4">
255+
<divclassName="flex flex-col gap-1">
256+
<label
257+
htmlFor="templateID"
258+
className="text-xs font-medium text-content-primary"
259+
>
259260
Template
260261
</label>
261262
<Select
262263
name="templateID"
263-
onValueChange={(value)=>{
264-
setSelectedTemplateId(value);
265-
}}
264+
onValueChange={(value)=>setSelectedTemplateId(value)}
266265
defaultValue={templates[0].id}
267266
required
268267
>
269268
<SelectTrigger
270269
id="templateID"
271-
className="w-fit text-xs [&_svg]:size-icon-xs border-0 bg-surface-secondary h-8 px-3 rounded-full"
270+
className="w-80 text-xs [&_svg]:size-icon-xs border-0 bg-surface-secondary h-8 px-3"
272271
>
273272
<SelectValueplaceholder="Select a template"/>
274273
</SelectTrigger>
@@ -286,34 +285,50 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
286285
</Select>
287286
</div>
288287

289-
{selectedPresetId&&(
290-
<div>
291-
<labelhtmlFor="presetID"className="sr-only">
288+
{isLoadingPresets ?(
289+
<divclassName="flex flex-col gap-1">
290+
<label
291+
htmlFor="presetID"
292+
className="text-xs font-medium text-content-primary"
293+
>
292294
Preset
293295
</label>
294-
<Select
295-
key={`preset-select-${selectedTemplate.active_version_id}`}
296-
name="presetID"
297-
value={selectedPresetId}
298-
onValueChange={setSelectedPresetId}
299-
>
300-
<SelectTrigger
301-
id="presetID"
302-
className="w-fit text-xs [&_svg]:size-icon-xs border-0 bg-surface-secondary h-8 px-3 rounded-full"
303-
>
304-
<SelectValueplaceholder="Select a preset"/>
305-
</SelectTrigger>
306-
<SelectContent>
307-
{presets?.toSorted(sortByDefault).map((preset)=>(
308-
<SelectItemvalue={preset.ID}key={preset.ID}>
309-
<spanclassName="overflow-hidden text-ellipsis block">
310-
{preset.Name}{preset.Default&&"(Default)"}
311-
</span>
312-
</SelectItem>
313-
))}
314-
</SelectContent>
315-
</Select>
296+
<SkeletonclassName="w-[320px] h-8"/>
316297
</div>
298+
) :(
299+
presets&&
300+
presets.length>0&&(
301+
<divclassName="flex flex-col gap-1">
302+
<label
303+
htmlFor="presetID"
304+
className="text-xs font-medium text-content-primary"
305+
>
306+
Preset
307+
</label>
308+
<Select
309+
key={`preset-select-${selectedTemplate.active_version_id}`}
310+
name="presetID"
311+
value={selectedPresetId||undefined}
312+
onValueChange={setSelectedPresetId}
313+
>
314+
<SelectTrigger
315+
id="presetID"
316+
className="w-80 text-xs [&_svg]:size-icon-xs border-0 bg-surface-secondary h-8 px-3"
317+
>
318+
<SelectValueplaceholder="Select a preset"/>
319+
</SelectTrigger>
320+
<SelectContent>
321+
{presets.toSorted(sortByDefault).map((preset)=>(
322+
<SelectItemvalue={preset.ID}key={preset.ID}>
323+
<spanclassName="overflow-hidden text-ellipsis block">
324+
{preset.Name}{preset.Default&&"(Default)"}
325+
</span>
326+
</SelectItem>
327+
))}
328+
</SelectContent>
329+
</Select>
330+
</div>
331+
)
317332
)}
318333
</div>
319334

@@ -325,22 +340,17 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
325340
/>
326341
)}
327342

328-
<Button
329-
size="icon"
330-
className="rounded-full"
331-
type="submit"
332-
disabled={isMissingExternalAuth}
333-
>
343+
<Buttonsize="sm"type="submit"disabled={isMissingExternalAuth}>
334344
<Spinner
335345
loading={
336346
isLoadingExternalAuth||
337347
isPollingExternalAuth||
338348
createTaskMutation.isPending
339349
}
340350
>
341-
<ArrowUpIcon/>
351+
<SendIcon/>
342352
</Spinner>
343-
<spanclassName="sr-only">Run task</span>
353+
Run task
344354
</Button>
345355
</div>
346356
</div>
@@ -370,7 +380,6 @@ const ExternalAuthButtons: FC<ExternalAuthButtonProps> = ({
370380
<divclassName="flex items-center gap-2"key={auth.id}>
371381
<Button
372382
variant="outline"
373-
className="rounded-full"
374383
size="sm"
375384
disabled={isPollingExternalAuth||auth.authenticated}
376385
onClick={()=>{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp