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

refactor: replace task prompt by workspace name in the topbar#19531

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 3 commits intomainfrombq/19524
Aug 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: 1 addition & 5 deletionssite/src/pages/TaskPage/TaskPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,7 +151,7 @@ const TaskPage = () => {
return (
<>
<Helmet>
<title>{pageTitle(ellipsizeText(task.prompt, 64))}</title>
<title>{pageTitle(task.workspace.name)}</title>
</Helmet>

<div className="flex flex-col h-full">
Expand DownExpand Up@@ -265,7 +265,3 @@ export const data = {
} satisfies Task;
},
};

const ellipsizeText = (text: string, maxLength = 80): string => {
return text.length <= maxLength ? text : `${text.slice(0, maxLength - 3)}...`;
};
77 changes: 67 additions & 10 deletionssite/src/pages/TaskPage/TaskTopbar.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,14 @@ import {
TooltipProvider,
TooltipTrigger,
} from "components/Tooltip/Tooltip";
import { ArrowLeftIcon } from "lucide-react";
import { useClipboard } from "hooks";
import {
ArrowLeftIcon,
CheckIcon,
CopyIcon,
LaptopMinimalIcon,
TerminalIcon,
} from "lucide-react";
import type { Task } from "modules/tasks/tasks";
import type { FC } from "react";
import { Link as RouterLink } from "react-router";
Expand All@@ -15,7 +22,7 @@ type TaskTopbarProps = { task: Task };

export const TaskTopbar: FC<TaskTopbarProps> = ({ task }) => {
return (
<header className="flex items-center px-3h-14 border-solid border-border border-0 border-b">
<header className="flex items-center px-3py-4 border-solid border-border border-0 border-b">
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
Expand All@@ -30,21 +37,71 @@ export const TaskTopbar: FC<TaskTopbarProps> = ({ task }) => {
</Tooltip>
</TooltipProvider>

<h1 className="m-0 text-base font-medium truncate">{task.prompt}</h1>
<h1 className="m-0 pl-2 text-base font-medium truncate">
{task.workspace.name}
</h1>

{task.workspace.latest_app_status?.uri && (
<div className="flex items-center gap-2 flex-wrap ml-4">
<TaskStatusLink uri={task.workspace.latest_app_status.uri} />
</div>
)}

<Button asChild size="sm" variant="outline" className="ml-auto">
<RouterLink
to={`/@${task.workspace.owner_name}/${task.workspace.name}`}
>
View workspace
</RouterLink>
</Button>
<div className="ml-auto gap-2 flex items-center">
<TooltipProvider delayDuration={250}>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="outline" size="sm">
<TerminalIcon />
Prompt
</Button>
</TooltipTrigger>
<TooltipContent className="max-w-xs bg-surface-secondary p-4">
<p className="m-0 mb-2 select-all text-sm font-normal text-content-primary leading-snug">
{task.prompt}
</p>
<CopyPromptButton prompt={task.prompt} />
</TooltipContent>
</Tooltip>
</TooltipProvider>

<Button asChild variant="outline" size="sm">
<RouterLink
to={`/@${task.workspace.owner_name}/${task.workspace.name}`}
>
<LaptopMinimalIcon />
Workspace
</RouterLink>
</Button>
</div>
</header>
);
};

type CopyPromptButtonProps = { prompt: string };

const CopyPromptButton: FC<CopyPromptButtonProps> = ({ prompt }) => {
const { copyToClipboard, showCopiedSuccess } = useClipboard({
textToCopy: prompt,
});

return (
<Button
disabled={showCopiedSuccess}
onClick={copyToClipboard}
size="sm"
variant="subtle"
className="p-0 min-w-0"
>
{showCopiedSuccess ? (
<>
<CheckIcon /> Copied!
</>
) : (
<>
<CopyIcon /> Copy
</>
)}
</Button>
);
Comment on lines +88 to +106
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In isolation, I think this is perfectly fine, but do we want to centralize the implementation for this, so we can make sure the UI stays more consistent?

I'm seeing a few other buttons in the codebase that are wired up very similarly (making a call touseClipboard, using theCheckIcon andCopyIcon components), and I'm just worried about them drifting over time

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I agree with you, but I would create a separate issue to investigate that and make it more consistent.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

};
Loading

[8]ページ先頭

©2009-2025 Movatter.jp