Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Apply PR review
  • Loading branch information
BrunoQuaresma committed Aug 21, 2025
commit d7306adf3bf7455375f182ae2caf986c7fdb4510
11 changes: 8 additions & 3 deletions site/src/pages/TaskPage/TaskPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Helmet } from "react-helmet-async";
import { useQuery } from "react-query";
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
import { Link as RouterLink, useParams } from "react-router";
import { ellipsizeText } from "utils/ellipsizeText";
import { pageTitle } from "utils/page";
import {
getActiveTransitionStats,
Expand Down Expand Up @@ -152,7 +151,7 @@ const TaskPage = () => {
return (
<>
<Helmet>
<title>{pageTitle(ellipsizeText(task.prompt, 64) ?? "Task")}</title>
<title>{pageTitle(ellipsizeText(task.prompt, 64))}</title>
</Helmet>

<div className="flex flex-col h-full">
Expand All @@ -165,7 +164,9 @@ const TaskPage = () => {

export default TaskPage;

const TaskBuildingWorkspace: FC<{ task: Task }> = ({ task }) => {
type TaskBuildingWorkspaceProps = { task: Task };

const TaskBuildingWorkspace: FC<TaskBuildingWorkspaceProps> = ({ task }) => {
const { data: template } = useQuery(
templateQueryOptions(task.workspace.template_id),
);
Expand Down Expand Up @@ -264,3 +265,7 @@ export const data = {
} satisfies Task;
},
};

const ellipsizeText = (text: string, maxLength = 80): string => {
return text.length <= maxLength ? text : `${text.slice(0, maxLength - 3)}...`;
};
8 changes: 4 additions & 4 deletions site/src/pages/TaskPage/TaskTopbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import type { FC } from "react";
import { Link as RouterLink } from "react-router";
import { TaskStatusLink } from "./TaskStatusLink";

export const TaskTopbar: FC<{ task: Task }> = ({ task }) => {
type TaskTopbarProps = { task: Task };

export const TaskTopbar: FC<TaskTopbarProps> = ({ task }) => {
return (
<header className="flex items-center px-3 h-14 border-solid border-border border-0 border-b">
<TooltipProvider>
Expand All @@ -28,9 +30,7 @@ export const TaskTopbar: FC<{ task: Task }> = ({ task }) => {
</Tooltip>
</TooltipProvider>

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

{task.workspace.latest_app_status?.uri && (
<div className="flex items-center gap-2 flex-wrap ml-4">
Expand Down
21 changes: 0 additions & 21 deletions site/src/utils/ellipsizeText.test.ts

This file was deleted.

14 changes: 0 additions & 14 deletions site/src/utils/ellipsizeText.ts

This file was deleted.

Loading