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

Commit92befc0

Browse files
committed
fix: show task display name in task topbar (#20957)
## DescriptionUpdate task topbar in task page to show display name, instead of taskname.Follow-up PR:#20918Related to internal slack thread:https://codercom.slack.com/archives/C0992H8HGCS/p1764086497375829(cherry picked from commit21efebe)
1 parentdfa25d5 commit92befc0

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import{
22
MockDeletedWorkspace,
3+
MockDisplayNameTasks,
34
MockFailedWorkspace,
45
MockStartingWorkspace,
56
MockStoppedWorkspace,
@@ -561,6 +562,38 @@ export const WorkspaceStartFailureWithDialog: Story = {
561562
},
562563
};
563564

565+
constlongDisplayName=
566+
"Implement comprehensive authentication and authorization system with role-based access control";
567+
exportconstLongDisplayName:Story={
568+
parameters:{
569+
queries:[
570+
{
571+
// Sidebar: uses getTasks() which returns an array
572+
key:["tasks",{owner:MockTask.owner_name}],
573+
data:[
574+
{ ...MockDisplayNameTasks[0],display_name:longDisplayName},
575+
...MockDisplayNameTasks.slice(1),
576+
],
577+
},
578+
{
579+
// TaskTopbar: uses getTask() which returns a single task
580+
key:["tasks",MockTask.owner_name,MockTask.id],
581+
data:{ ...MockDisplayNameTasks[0],display_name:longDisplayName},
582+
},
583+
{
584+
// Workspace data for the task
585+
key:[
586+
"workspace",
587+
MockTask.owner_name,
588+
MockTask.workspace_name,
589+
"settings",
590+
],
591+
data:MockWorkspace,
592+
},
593+
],
594+
},
595+
};
596+
564597
functionmockTaskWithWorkspace(
565598
sidebarApp:WorkspaceApp,
566599
activeApp:WorkspaceApp,

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type TaskTopbarProps = { task: Task; workspace: Workspace };
2323

2424
exportconstTaskTopbar:FC<TaskTopbarProps>=({ task, workspace})=>{
2525
return(
26-
<headerclassName="flex flex-shrink-0 items-center p-3 border-solid border-border border-0 border-b">
26+
<headerclassName="flex flex-shrink-0 items-centergap-2p-3 border-solid border-border border-0 border-b">
2727
<TooltipProvider>
2828
<Tooltip>
2929
<TooltipTriggerasChild>
@@ -38,7 +38,9 @@ export const TaskTopbar: FC<TaskTopbarProps> = ({ task, workspace }) => {
3838
</Tooltip>
3939
</TooltipProvider>
4040

41-
<h1className="m-0 pl-2 text-base font-medium truncate">{task.name}</h1>
41+
<h1className="m-0 pl-2 text-base font-medium max-w-[520px] truncate">
42+
{task.display_name}
43+
</h1>
4244

4345
{task.current_state?.uri&&(
4446
<divclassName="flex items-center gap-2 flex-wrap ml-4">

‎site/src/testHelpers/entities.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4971,8 +4971,8 @@ export const MockAIPromptPresets: TypesGen.Preset[] = [
49714971

49724972
exportconstMockTask={
49734973
id:"test-task",
4974-
name:"wild-test-123",
4975-
display_name:"Task wild test",
4974+
name:"perform-some-task-123",
4975+
display_name:"Perform some task",
49764976
organization_id:MockOrganization.id,
49774977
owner_id:MockUserOwner.id,
49784978
owner_name:MockUserOwner.username,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp