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

feat: redesign tasks page to match AI tools#19962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 5 commits intomainfrombq/redesign-tasks-page
Sep 26, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletionsofflinedocs/pages/[[...slug]].tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@ import {
DrawerOverlay,
Flex,
Grid,
GridProps,
typeGridProps,
Heading,
Icon,
Img,
Expand All@@ -28,12 +28,12 @@ import {
import fm from "front-matter";
import { readFileSync } from "fs";
import _ from "lodash";
import { GetStaticPaths, GetStaticProps, NextPage } from "next";
importtype{ GetStaticPaths, GetStaticProps, NextPage } from "next";
import Head from "next/head";
import NextLink from "next/link";
import { useRouter } from "next/router";
import path from "path";
import { ReactNode } from "react";
importtype{ ReactNode } from "react";
import { MdMenu } from "react-icons/md";
import ReactMarkdown from "react-markdown";
import rehypeRaw from "rehype-raw";
Expand Down
2 changes: 1 addition & 1 deletionsite/src/api/api.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -426,7 +426,7 @@ export type GetProvisionerDaemonsParams = {
offline?: boolean;
};

exporttype TasksFilter = {
type TasksFilter = {
username?: string;
};

Expand Down
2 changes: 1 addition & 1 deletionsite/src/components/Select/Select.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ export const SelectTrigger = React.forwardRef<
ref={ref}
id={id}
className={cn(
`flex h-10 w-full font-medium items-center justify-between whitespace-nowrap rounded-md
`gap-2flex h-10 w-full font-medium items-center justify-between whitespace-nowrap rounded-md
border border-border border-solid bg-transparent px-3 py-2 text-sm shadow-sm
ring-offset-background text-content-secondary placeholder:text-content-secondary focus:outline-none,
focus:ring-2 focus:ring-content-link disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1
Expand Down
16 changes: 16 additions & 0 deletionssite/src/modules/tasks/TasksLayout/TasksLayout.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
import type { FC, PropsWithChildren } from "react";
import { Outlet } from "react-router";
import { TasksSidebar } from "../TasksSidebar/TasksSidebar";

const TasksLayout: FC<PropsWithChildren> = () => {
return (
<div className="flex items-stretch h-full">
<TasksSidebar />
<div className="flex flex-col h-full flex-1 overflow-y-auto">
<Outlet />
</div>
</div>
);
};

export default TasksLayout;
5 changes: 4 additions & 1 deletionsite/src/modules/tasks/TasksSidebar/TasksSidebar.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,11 +41,14 @@ export const TasksSidebar: FC = () => {
<div className="flex items-center place-content-between">
{!isCollapsed && (
<Button
asChild
size="icon"
variant="subtle"
className={cn(["size-8 p-0 transition-[margin,opacity]"])}
>
<CoderIcon className="fill-content-primary !size-6 !p-0" />
<RouterLink to="/">
<CoderIcon className="fill-content-primary !size-6 !p-0" />
</RouterLink>
</Button>
)}

Expand Down
31 changes: 7 additions & 24 deletionssite/src/pages/TaskPage/TaskPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,21 +17,14 @@ import { useWorkspaceBuildLogs } from "hooks/useWorkspaceBuildLogs";
import { ArrowLeftIcon, RotateCcwIcon } from "lucide-react";
import { AgentLogs } from "modules/resources/AgentLogs/AgentLogs";
import { useAgentLogs } from "modules/resources/useAgentLogs";
import { TasksSidebar } from "modules/tasks/TasksSidebar/TasksSidebar";
import {
AI_PROMPT_PARAMETER_NAME,
getTaskApps,
type Task,
} from "modules/tasks/tasks";
import { WorkspaceErrorDialog } from "modules/workspaces/ErrorDialog/WorkspaceErrorDialog";
import { WorkspaceBuildLogs } from "modules/workspaces/WorkspaceBuildLogs/WorkspaceBuildLogs";
import {
type FC,
type PropsWithChildren,
type ReactNode,
useLayoutEffect,
useRef,
} from "react";
import { type FC, type ReactNode, useLayoutEffect, useRef } from "react";
import { useMutation, useQuery, useQueryClient } from "react-query";
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
import { Link as RouterLink, useParams } from "react-router";
Expand All@@ -45,15 +38,6 @@ import { TaskAppIFrame } from "./TaskAppIframe";
import { TaskApps } from "./TaskApps";
import { TaskTopbar } from "./TaskTopbar";

const TaskPageLayout: FC<PropsWithChildren> = ({ children }) => {
return (
<div className="flex items-stretch h-full">
<TasksSidebar />
<div className="flex flex-col h-full flex-1">{children}</div>
</div>
);
};

const TaskPage = () => {
const { workspace: workspaceName, username } = useParams() as {
workspace: string;
Expand All@@ -73,7 +57,7 @@ const TaskPage = () => {

if (error) {
return (
<TaskPageLayout>
<>
<title>{pageTitle("Error loading task")}</title>

<div className="w-full min-h-80 flex items-center justify-center">
Expand All@@ -98,16 +82,16 @@ const TaskPage = () => {
</div>
</div>
</div>
</TaskPageLayout>
</>
);
}

if (!task) {
return (
<TaskPageLayout>
<>
<title>{pageTitle("Loading task")}</title>
<Loader className="w-full h-full" />
</TaskPageLayout>
</>
);
}

Expand DownExpand Up@@ -174,12 +158,11 @@ const TaskPage = () => {
}

return (
<TaskPageLayout>
<>
<title>{pageTitle(task.workspace.name)}</title>

<TaskTopbar task={task} />
{content}
</TaskPageLayout>
</>
);
};

Expand Down
111 changes: 51 additions & 60 deletionssite/src/pages/TasksPage/TaskPrompt.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@ import {
} from "components/Tooltip/Tooltip";
import { useAuthenticated } from "hooks/useAuthenticated";
import { useExternalAuth } from "hooks/useExternalAuth";
import {RedoIcon, RotateCcwIcon, SendIcon } from "lucide-react";
import {ArrowUpIcon, RedoIcon, RotateCcwIcon } from "lucide-react";
import { AI_PROMPT_PARAMETER_NAME } from "modules/tasks/tasks";
import { type FC, useEffect, useState } from "react";
import { useMutation, useQuery, useQueryClient } from "react-query";
Expand DownExpand Up@@ -106,8 +106,8 @@ const TaskPromptSkeleton: FC = () => {

{/* Bottom controls skeleton */}
<div className="flex items-center justify-between pt-2">
<Skeleton className="w-[208px] h-8" />
<Skeleton className="w-[96px] h-8" />
<Skeleton className="w-[160px] h-8 rounded-full" />
<Skeleton className="size-8 rounded-full" />
</div>
</div>
</div>
Expand DownExpand Up@@ -160,15 +160,17 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
} = useExternalAuth(selectedTemplate.active_version_id);

// Fetch presets when template changes
const { data: presets, isLoading: isLoadingPresets } = useQuery(
const { data: presets } = useQuery(
templateVersionPresets(selectedTemplate.active_version_id),
);
const defaultPreset = presets?.find((p) => p.Default);

// Handle preset selection when data changes
useEffect(() => {
setSelectedPresetId(defaultPreset?.ID);
}, [defaultPreset?.ID]);
if (presets && presets.length > 0) {
const defaultPreset = presets.find((p) => p.Default) || presets[0];
setSelectedPresetId(defaultPreset.ID);
}
}, [presets]);

// Extract AI prompt from selected preset
const selectedPreset = presets?.find((p) => p.ID === selectedPresetId);
Expand DownExpand Up@@ -225,7 +227,7 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
{externalAuthError && <ErrorAlert error={externalAuthError} />}

<fieldset
className="border border-border border-solid rounded-lg p-4"
className="border border-border border-solid rounded-3xl p-4"
disabled={createTaskMutation.isPending}
>
<label
Expand All@@ -251,23 +253,22 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
}`}
/>
<div className="flex items-center justify-between pt-2">
<div className="flex items-center gap-4">
<div className="flex flex-col gap-1">
<label
htmlFor="templateID"
className="text-xs font-medium text-content-primary"
>
<div className="flex items-center gap-2">
<div>
<label htmlFor="templateID" className="sr-only">
Template
</label>
<Select
name="templateID"
onValueChange={(value) => setSelectedTemplateId(value)}
onValueChange={(value) => {
setSelectedTemplateId(value);
}}
defaultValue={templates[0].id}
required
>
<SelectTrigger
id="templateID"
className="w-80 text-xs [&_svg]:size-icon-xs border-0 bg-surface-secondary h-8 px-3"
className="w-fit text-xs [&_svg]:size-icon-xs border-0 bg-surface-secondary h-8 px-3 rounded-full"
>
<SelectValue placeholder="Select a template" />
</SelectTrigger>
Expand All@@ -285,50 +286,34 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
</Select>
</div>

{isLoadingPresets ? (
<div className="flex flex-col gap-1">
<label
htmlFor="presetID"
className="text-xs font-medium text-content-primary"
>
{selectedPresetId && (
<div>
<label htmlFor="presetID" className="sr-only">
Preset
</label>
<Skeleton className="w-[320px] h-8" />
</div>
) : (
presets &&
presets.length > 0 && (
<div className="flex flex-col gap-1">
<label
htmlFor="presetID"
className="text-xs font-medium text-content-primary"
>
Preset
</label>
<Select
key={`preset-select-${selectedTemplate.active_version_id}`}
name="presetID"
value={selectedPresetId || undefined}
onValueChange={setSelectedPresetId}
<Select
key={`preset-select-${selectedTemplate.active_version_id}`}
name="presetID"
value={selectedPresetId}
onValueChange={setSelectedPresetId}
>
<SelectTrigger
id="presetID"
className="w-fit text-xs [&_svg]:size-icon-xs border-0 bg-surface-secondary h-8 px-3 rounded-full"
>
<SelectTrigger
id="presetID"
className="w-80 text-xs [&_svg]:size-icon-xs border-0 bg-surface-secondary h-8 px-3"
>
<SelectValue placeholder="Select a preset" />
</SelectTrigger>
<SelectContent>
{presets.toSorted(sortByDefault).map((preset) => (
<SelectItem value={preset.ID} key={preset.ID}>
<span className="overflow-hidden text-ellipsis block">
{preset.Name} {preset.Default && "(Default)"}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)
<SelectValue placeholder="Select a preset" />
</SelectTrigger>
<SelectContent>
{presets?.toSorted(sortByDefault).map((preset) => (
<SelectItem value={preset.ID} key={preset.ID}>
<span className="overflow-hidden text-ellipsis block">
{preset.Name} {preset.Default && "(Default)"}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)}
</div>

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

<Button size="sm" type="submit" disabled={isMissingExternalAuth}>
<Button
size="icon"
className="rounded-full"
type="submit"
disabled={isMissingExternalAuth}
>
<Spinner
loading={
isLoadingExternalAuth ||
isPollingExternalAuth ||
createTaskMutation.isPending
}
>
<SendIcon />
<ArrowUpIcon />
</Spinner>
Run task
<span className="sr-only">Run task</span>
</Button>
</div>
</div>
Expand DownExpand Up@@ -380,6 +370,7 @@ const ExternalAuthButtons: FC<ExternalAuthButtonProps> = ({
<div className="flex items-center gap-2" key={auth.id}>
<Button
variant="outline"
className="rounded-full"
size="sm"
disabled={isPollingExternalAuth || auth.authenticated}
onClick={() => {
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp