mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix(site): show Agents tab on dev builds without page refresh (#23512)
This commit is contained in:
@@ -15,6 +15,7 @@ const meta: Meta<typeof NavbarView> = {
|
||||
parameters: {
|
||||
chromatic: chromaticWithTablet,
|
||||
layout: "fullscreen",
|
||||
experiments: ["agents"],
|
||||
queries: [
|
||||
{
|
||||
key: ["tasks", tasksFilter],
|
||||
|
||||
@@ -2,10 +2,12 @@ import { API } from "api/api";
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import type { ProxyContextValue } from "contexts/ProxyContext";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
import { useDashboard } from "modules/dashboard/useDashboard";
|
||||
import { NotificationsInbox } from "modules/notifications/NotificationsInbox/NotificationsInbox";
|
||||
import type { FC } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { NavLink, useLocation } from "react-router";
|
||||
import { isDevBuild } from "utils/buildInfo";
|
||||
import { cn } from "utils/cn";
|
||||
import { Badge } from "#/components/Badge/Badge";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
@@ -230,12 +232,8 @@ function idleTasksLabel(count: number) {
|
||||
}
|
||||
|
||||
const AgentsNavItem: FC = () => {
|
||||
const { metadata } = useEmbeddedMetadata();
|
||||
const canSeeAgents = Boolean(
|
||||
metadata["agents-tab-visible"].value ||
|
||||
process.env.NODE_ENV === "development" ||
|
||||
process.env.STORYBOOK,
|
||||
);
|
||||
const { experiments, buildInfo } = useDashboard();
|
||||
const canSeeAgents = experiments.includes("agents") || isDevBuild(buildInfo);
|
||||
|
||||
if (!canSeeAgents) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user