Skip to content

Commit 156c9d1

Browse files
committed
Add ai-tasks experiment
1 parent 0a1b4d6 commit 156c9d1

File tree

6 files changed

+38
-24
lines changed

6 files changed

+38
-24
lines changed

coderd/apidoc/docs.go

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codersdk/deployment.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,6 +3346,7 @@ const (
33463346
ExperimentDynamicParameters Experiment = "dynamic-parameters" // Enables dynamic parameters when creating a workspace.
33473347
ExperimentWorkspacePrebuilds Experiment = "workspace-prebuilds" // Enables the new workspace prebuilds feature.
33483348
ExperimentAgenticChat Experiment = "agentic-chat" // Enables the new agentic AI chat feature.
3349+
ExperimentAITasks Experiment = "ai-tasks" // Enables the new AI tasks feature.
33493350
)
33503351

33513352
// ExperimentsSafe should include all experiments that are safe for

docs/reference/api/schemas.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/typesGenerated.ts

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/modules/dashboard/Navbar/NavbarView.tsx

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { API } from "api/api";
2+
import { experiments } from "api/queries/experiments";
23
import type * as TypesGen from "api/typesGenerated";
34
import { Button } from "components/Button/Button";
45
import { ExternalImage } from "components/ExternalImage/ExternalImage";
56
import { CoderIcon } from "components/Icons/CoderIcon";
67
import type { ProxyContextValue } from "contexts/ProxyContext";
78
import { useAgenticChat } from "contexts/useAgenticChat";
89
import { useWebpushNotifications } from "contexts/useWebpushNotifications";
10+
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
911
import { NotificationsInbox } from "modules/notifications/NotificationsInbox/NotificationsInbox";
1012
import type { FC } from "react";
13+
import { useQuery } from "react-query";
1114
import { NavLink, useLocation } from "react-router-dom";
1215
import { cn } from "utils/cn";
1316
import { DeploymentDropdown } from "./DeploymentDropdown";
@@ -141,6 +144,8 @@ interface NavItemsProps {
141144
const NavItems: FC<NavItemsProps> = ({ className }) => {
142145
const location = useLocation();
143146
const agenticChat = useAgenticChat();
147+
const { metadata } = useEmbeddedMetadata();
148+
const experimentsQuery = useQuery(experiments(metadata.experiments));
144149

145150
return (
146151
<nav className={cn("flex items-center gap-4 h-full", className)}>
@@ -163,26 +168,26 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
163168
>
164169
Templates
165170
</NavLink>
166-
{agenticChat.enabled ? (
167-
<>
168-
<NavLink
169-
className={({ isActive }) => {
170-
return cn(linkStyles.default, isActive ? linkStyles.active : "");
171-
}}
172-
to="/chat"
173-
>
174-
Chat
175-
</NavLink>
176-
<NavLink
177-
className={({ isActive }) => {
178-
return cn(linkStyles.default, isActive ? linkStyles.active : "");
179-
}}
180-
to="/tasks"
181-
>
182-
Tasks
183-
</NavLink>
184-
</>
185-
) : null}
171+
{agenticChat.enabled && (
172+
<NavLink
173+
className={({ isActive }) => {
174+
return cn(linkStyles.default, isActive ? linkStyles.active : "");
175+
}}
176+
to="/chat"
177+
>
178+
Chat
179+
</NavLink>
180+
)}
181+
{experimentsQuery.data?.includes("ai-tasks") && (
182+
<NavLink
183+
className={({ isActive }) => {
184+
return cn(linkStyles.default, isActive ? linkStyles.active : "");
185+
}}
186+
to="/tasks"
187+
>
188+
Tasks
189+
</NavLink>
190+
)}
186191
</nav>
187192
);
188193
};

0 commit comments

Comments
 (0)