Skip to content

Commit 8de5e2d

Browse files
committed
Reworking more of the side menu items
1 parent 2e8435d commit 8de5e2d

13 files changed

Lines changed: 114 additions & 111 deletions

File tree

apps/webapp/app/assets/icons/ChartBarIcon.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ export function ChartBarIcon({ className }: { className?: string }) {
99
xmlns="http://www.w3.org/2000/svg"
1010
>
1111
<path
12-
d="M9 6C9 4.89543 9.89543 4 11 4H13C14.1046 4 15 4.89543 15 6V21H9V6Z"
12+
d="M9 5C9 3.89543 9.89543 3 11 3H13C14.1046 3 15 3.89543 15 5V21H9V5Z"
1313
stroke="currentColor"
1414
strokeWidth="2"
1515
/>
1616
<path
17-
d="M15 12C15 10.8954 15.8954 10 17 10H19C20.1046 10 21 10.8954 21 12V20C21 20.5523 20.5523 21 20 21H15V12Z"
17+
d="M15 13C15 11.8954 15.8954 11 17 11H19C20.1046 11 21 11.8954 21 13V20C21 20.5523 20.5523 21 20 21H15V13Z"
1818
stroke="currentColor"
1919
strokeWidth="2"
2020
/>
2121
<path
22-
d="M3 16C3 14.8954 3.89543 14 5 14H7C8.10457 14 9 14.8954 9 16V21H4C3.44772 21 3 20.5523 3 20V16Z"
22+
d="M3 10C3 8.89543 3.89543 8 5 8H7C8.10457 8 9 8.89543 9 10V21H4C3.44772 21 3 20.5523 3 20V10Z"
2323
stroke="currentColor"
2424
strokeWidth="2"
2525
/>

apps/webapp/app/assets/icons/PadlockIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function PadlockIcon({ className }: { className?: string }) {
1212
<rect x="11" y="13" width="2" height="5" rx="1" fill="currentColor" />
1313
<rect x="10" y="12" width="4" height="4" rx="2" fill="currentColor" />
1414
<path
15-
d="M16 8V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V8"
15+
d="M17 9V8C17 5.23858 14.7614 3 12 3C9.23858 3 7 5.23858 7 8V9"
1616
stroke="currentColor"
1717
strokeWidth="2"
1818
/>

apps/webapp/app/assets/icons/ShieldIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function ShieldIcon({ className }: { className?: string }) {
99
xmlns="http://www.w3.org/2000/svg"
1010
>
1111
<path
12-
d="M11.4199 3.2207C11.7981 3.1061 12.2019 3.1061 12.5801 3.2207L18.5801 5.03906C19.4233 5.29464 20 6.072 20 6.95312V11.4951C20 13.7676 18.8965 15.899 17.041 17.2109L12 20.7754L6.95898 17.2109C5.10346 15.899 4 13.7676 4 11.4951V6.95312C4 6.072 4.57669 5.29464 5.41992 5.03906L11.4199 3.2207Z"
12+
d="M6 3H18C19.1046 3 20 3.89543 20 5V12.0029C20 14.0232 19.1268 15.9452 17.6055 17.2744L14.6318 19.8721C13.1244 21.1891 10.8756 21.1891 9.36816 19.8721L6.39453 17.2744C4.8732 15.9452 4.00005 14.0232 4 12.0029V5L4.01074 4.7959C4.11301 3.78722 4.96435 3 6 3Z"
1313
stroke="currentColor"
1414
strokeWidth="2"
1515
/>

apps/webapp/app/components/navigation/DashboardDialogs.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,30 @@ export function CreateDashboardPageButton({
120120
project,
121121
environment,
122122
shortcut,
123+
children,
123124
}: {
124125
organization: { slug: string };
125126
project: { slug: string };
126127
environment: { slug: string };
127128
shortcut?: ShortcutDefinition;
129+
/** Custom trigger element. When omitted, a default primary button is rendered. */
130+
children?: React.ReactNode;
128131
}) {
129132
const dashboard = useCreateDashboard({ organization, project, environment });
130133

131134
return (
132135
<Dialog open={dashboard.isOpen} onOpenChange={dashboard.setIsOpen}>
133136
<DialogTrigger asChild>
134-
<Button variant="primary/small" LeadingIcon={PlusIcon} shortcut={shortcut} className="pr-2">
135-
Create custom dashboard
136-
</Button>
137+
{children ?? (
138+
<Button
139+
variant="primary/small"
140+
LeadingIcon={PlusIcon}
141+
shortcut={shortcut}
142+
className="pr-2"
143+
>
144+
Create custom dashboard
145+
</Button>
146+
)}
137147
</DialogTrigger>
138148
{dashboard.isAtLimit ? (
139149
<CreateDashboardUpgradeDialog

apps/webapp/app/components/navigation/DashboardList.tsx

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import { RunsIcon } from "~/assets/icons/RunsIcon";
66
import { type MatchedOrganization, useCustomDashboards } from "~/hooks/useOrganizations";
77
import { type UserWithDashboardPreferences } from "~/models/user.server";
88
import { type RenderIcon } from "~/components/primitives/Icon";
9-
import {
10-
v3BuiltInDashboardPath,
11-
v3CustomDashboardPath,
12-
} from "~/utils/pathBuilder";
9+
import { v3BuiltInDashboardPath, v3CustomDashboardPath } from "~/utils/pathBuilder";
1310
import { type SideMenuEnvironment, type SideMenuProject } from "./SideMenu";
1411
import { SideMenuItem } from "./SideMenuItem";
1512
import { TreeConnectorBranch, TreeConnectorEnd } from "./TreeConnectors";
@@ -59,25 +56,27 @@ export function DashboardList({
5956
{
6057
key: "builtin:overview",
6158
kind: "builtin",
62-
label: "Runs",
59+
label: "Run metrics",
6360
path: v3BuiltInDashboardPath(organization, project, environment, "overview"),
6461
collapsedIcon: RunsIcon,
6562
activeColor: "text-runs",
6663
},
6764
{
6865
key: "builtin:llm",
6966
kind: "builtin",
70-
label: "Agents",
67+
label: "AI metrics",
7168
path: v3BuiltInDashboardPath(organization, project, environment, "llm"),
7269
collapsedIcon: AIMetricsIcon,
7370
activeColor: "text-aiMetrics",
7471
},
75-
...customDashboards.map((d): DashboardChild => ({
76-
key: `custom:${d.friendlyId}`,
77-
kind: "custom",
78-
label: d.title,
79-
path: v3CustomDashboardPath(organization, project, environment, d),
80-
})),
72+
...customDashboards.map(
73+
(d): DashboardChild => ({
74+
key: `custom:${d.friendlyId}`,
75+
kind: "custom",
76+
label: d.title,
77+
path: v3CustomDashboardPath(organization, project, environment, d),
78+
})
79+
),
8180
];
8281

8382
const initialOrder =
@@ -171,17 +170,10 @@ function DashboardChildMenuItem({
171170
? item.activeColor
172171
: undefined
173172
: isCollapsed
174-
? "text-customDashboards"
173+
? "text-text-bright"
175174
: undefined;
176175

177-
const inactiveIconColor =
178-
item.kind === "builtin"
179-
? isCollapsed
180-
? item.activeColor
181-
: "text-charcoal-700"
182-
: isCollapsed
183-
? "text-customDashboards"
184-
: "text-charcoal-700";
176+
const inactiveIconColor = isCollapsed ? "text-text-dimmed" : "text-charcoal-700";
185177

186178
return (
187179
<SideMenuItem

apps/webapp/app/components/navigation/SideMenu.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,15 @@ export function SideMenu({
387387
</div>
388388
</div>
389389

390-
<div className="w-full">
390+
<SideMenuSection
391+
title="Tasks"
392+
isSideMenuCollapsed={isCollapsed}
393+
itemSpacingClassName="space-y-0"
394+
initialCollapsed={getSectionCollapsed(user.dashboardPreferences.sideMenu, "tasks")}
395+
onCollapseToggle={handleSectionToggle("tasks")}
396+
>
391397
<SideMenuItem
392-
name="Agent tasks"
398+
name="Agents"
393399
icon={CubeSparkleIcon}
394400
activeIconColor="text-agents"
395401
inactiveIconColor="text-text-dimmed"
@@ -398,7 +404,7 @@ export function SideMenu({
398404
isCollapsed={isCollapsed}
399405
/>
400406
<SideMenuItem
401-
name="Standard tasks"
407+
name="Standard"
402408
icon={TaskIcon}
403409
activeIconColor="text-tasks"
404410
inactiveIconColor="text-text-dimmed"
@@ -407,7 +413,7 @@ export function SideMenu({
407413
isCollapsed={isCollapsed}
408414
/>
409415
<SideMenuItem
410-
name="Scheduled tasks"
416+
name="Schedules"
411417
icon={ClockIcon}
412418
activeIconColor="text-schedules"
413419
inactiveIconColor="text-text-dimmed"
@@ -433,7 +439,7 @@ export function SideMenu({
433439
data-action="sessions"
434440
isCollapsed={isCollapsed}
435441
/>
436-
</div>
442+
</SideMenuSection>
437443

438444
{(user.admin || user.isImpersonating || featureFlags.hasAiAccess) && (
439445
<SideMenuSection

apps/webapp/app/components/navigation/sideMenuTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const SideMenuSectionIdSchema = z.enum([
77
"metrics",
88
"deployments",
99
"project-settings",
10+
"tasks",
1011
]);
1112

1213
// Inferred type from the schema

apps/webapp/app/components/primitives/Headers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { cn } from "~/utils/cn";
22

33
const headerVariants = {
44
header1: {
5-
text: "font-sans text-2xl leading-5 md:leading-6 lg:leading-7 font-semibold",
5+
text: "font-sans text-2xl leading-5 md:leading-6 lg:leading-7 font-semibold tracking-tight",
66
spacing: "mb-2",
77
},
88
header2: {
9-
text: "font-sans text-base leading-6 font-semibold",
9+
text: "font-sans text-base leading-6 font-semibold tracking-tight",
1010
spacing: "mb-2",
1111
},
1212
header3: {

apps/webapp/app/presenters/v3/BuiltInDashboards.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { z } from "zod";
33

44
const overviewDashboard: BuiltInDashboard = {
55
key: "overview",
6-
title: "Metrics",
6+
title: "Run metrics",
77
filters: ["tasks", "queues"],
88
layout: {
99
version: "1",

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.agents._index/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ import { CubeSparkleIcon } from "~/assets/icons/CubeSparkleIcon";
6262
import { PlaygroundIcon } from "~/assets/icons/PlaygroundIcon";
6363

6464
export const meta: MetaFunction = () => {
65-
return [{ title: "Agents | Trigger.dev" }];
65+
return [{ title: "Agent tasks | Trigger.dev" }];
6666
};
6767

6868
export const loader = async ({ request, params }: LoaderFunctionArgs) => {

0 commit comments

Comments
 (0)