Skip to content

Commit 622fa79

Browse files
authored
fix(webapp): restore header docs buttons when the dashboard agent is unavailable (#4592)
Restores the page-header docs buttons removed in #4529 / #4418, shown only when the dashboard agent is unavailable (feature flag off, or pages outside the environment layout). The buttons are restored verbatim at their original spots — 22 sites across 21 files — wrapped in a small `WhenAgentUnavailable` gate that reads the agent context (SSR-safe, no hydration flicker). Also: in the light theme, the query editor's Format/Clear/Copy toolbar gets a translucent white background (`light:bg-white/80`) instead of transparent, so it no longer blends into the code behind it. <img width="1215" height="133" alt="Screenshot 2026-08-12 at 17 26 02" src="https://github.com/user-attachments/assets/4bdba825-9cbd-4df4-b6ca-0ea6691a534b" />
1 parent 442702e commit 622fa79

26 files changed

Lines changed: 309 additions & 28 deletions

File tree

  • .server-changes
  • apps/webapp/app
    • components
    • routes
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.agents.$agentParam
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.apikeys
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.batches
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dev-branches
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.limits
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.prompts._index
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.sessions.$sessionParam
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.sessions._index
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.tokens
      • _app.orgs.$organizationSlug.settings.private-connections.new
      • account.tokens
    • utils

.server-changes/dashboard-agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Meet the dashboard agent: a chat in every environment that answers questions abo
77

88
**Watch…** on a run, queue, error or the health report tells you when things change: a run finishes, a queue clears or grows past a number you pick, an error comes back, an environment recovers. The answer arrives in the chat and, if you want, by email, Slack or webhook — and the agent can look into bad news on its own. A watch reaches you on any browser you sign in from, without opening the chat first.
99

10-
A sample of conversations is scored automatically so the agent keeps getting better; only the score and a one-line summary are kept, never your messages, data or code, and we can switch it off for your organization on request. The Docs button is gone from page headers — ask the agent instead, or open Documentation from Help & Feedback. Separately, a queue's wait times, peak depth, throughput and throttling can now be read from the API.
10+
A sample of conversations is scored automatically so the agent keeps getting better; only the score and a one-line summary are kept, never your messages, data or code, and we can switch it off for your organization on request. Ask the agent instead of the Docs buttons in page headers — they stay there when the agent isn't available to you. Separately, a queue's wait times, peak depth, throughput and throttling can now be read from the API.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
In the light theme, the Format, Clear and Copy buttons on the query editor no longer blend into the query text behind them.

apps/webapp/app/components/code/TSQLEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export function TSQLEditor(opts: TSQLEditorProps) {
284284
}}
285285
/>
286286
{showButtons && (
287-
<div className="absolute right-0 top-0 z-10 flex items-center justify-end bg-background-deep/80 light:bg-transparent p-1.5">
287+
<div className="absolute right-0 top-0 z-10 flex items-center justify-end bg-background-deep/80 light:bg-white/80 p-1.5">
288288
{additionalActions && additionalActions}
289289
{showFormatButton && (
290290
<Button
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { useDashboardAgent } from "./dashboardAgentLauncher";
2+
3+
export function WhenAgentUnavailable({ children }: { children: React.ReactNode }) {
4+
const agent = useDashboardAgent();
5+
if (agent) {
6+
return null;
7+
}
8+
9+
return <>{children}</>;
10+
}

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ExclamationTriangleIcon } from "@heroicons/react/20/solid";
1+
import { BookOpenIcon, ExclamationTriangleIcon } from "@heroicons/react/20/solid";
22
import { json } from "@remix-run/node";
33

44
import { useFetcher, useRevalidator } from "@remix-run/react";
@@ -92,6 +92,7 @@ import { requireUserId } from "~/services/session.server";
9292
import { cn } from "~/utils/cn";
9393
import { formatNumberCompact } from "~/utils/numberFormatter";
9494
import {
95+
docsPath,
9596
EnvironmentParamSchema,
9697
v3AgentTaskPath,
9798
v3PlaygroundAgentPath,
@@ -102,6 +103,7 @@ import {
102103
v3TestTaskPath,
103104
} from "~/utils/pathBuilder";
104105
import { sectionAgentPageContext } from "~/components/dashboard-agent/suggested-prompts";
106+
import { WhenAgentUnavailable } from "~/components/dashboard-agent/WhenAgentUnavailable";
105107
import type { Handle } from "~/utils/handle";
106108

107109
export const handle: Handle = {
@@ -286,6 +288,15 @@ export default function Page() {
286288
<PageTitle title="Tasks" accessory={<TasksHelpTooltip />} />
287289
<PageAccessories>
288290
<AdminDebugTooltip />
291+
<WhenAgentUnavailable>
292+
<LinkButton
293+
variant={"docs/small"}
294+
LeadingIcon={BookOpenIcon}
295+
to={docsPath("/tasks/overview")}
296+
>
297+
Task docs
298+
</LinkButton>
299+
</WhenAgentUnavailable>
289300
</PageAccessories>
290301
</NavBar>
291302
<PageBody scrollable={false}>

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { BookOpenIcon } from "@heroicons/react/24/solid";
12
import { type LoaderFunctionArgs } from "@remix-run/server-runtime";
23
import { Suspense, useMemo, useState } from "react";
34
import { TypedAwait, typeddefer, useTypedLoaderData } from "remix-typedjson";
@@ -16,7 +17,7 @@ import { statusColor } from "~/components/primitives/charts/statusColors";
1617
import { CopyableText } from "~/components/primitives/CopyableText";
1718
import { DateTime } from "~/components/primitives/DateTime";
1819
import { Header2 } from "~/components/primitives/Headers";
19-
import { NavBar, PageTitle } from "~/components/primitives/PageHeader";
20+
import { NavBar, PageAccessories, PageTitle } from "~/components/primitives/PageHeader";
2021
import { Paragraph } from "~/components/primitives/Paragraph";
2122
import * as Property from "~/components/primitives/PropertyTable";
2223
import { Spinner } from "~/components/primitives/Spinner";
@@ -42,12 +43,14 @@ import { clickhouseFactory } from "~/services/clickhouse/clickhouseFactoryInstan
4243
import { getResizableSnapshot } from "~/services/resizablePanel.server";
4344
import { requireUser } from "~/services/session.server";
4445
import {
46+
docsPath,
4547
EnvironmentParamSchema,
4648
v3EnvironmentPath,
4749
v3PlaygroundAgentPath,
4850
} from "~/utils/pathBuilder";
4951
import { parseFiniteInt } from "~/utils/searchParams";
5052
import { agentsAgentPageContext } from "~/components/dashboard-agent/suggested-prompts";
53+
import { WhenAgentUnavailable } from "~/components/dashboard-agent/WhenAgentUnavailable";
5154
import type { Handle } from "~/utils/handle";
5255

5356
export const handle: Handle = {
@@ -227,6 +230,17 @@ export default function Page() {
227230
</span>
228231
}
229232
/>
233+
<PageAccessories>
234+
<WhenAgentUnavailable>
235+
<LinkButton
236+
variant="docs/small"
237+
LeadingIcon={BookOpenIcon}
238+
to={docsPath("ai-chat/overview")}
239+
>
240+
Agents docs
241+
</LinkButton>
242+
</WhenAgentUnavailable>
243+
</PageAccessories>
230244
</NavBar>
231245
<MetricsLayout.Root>
232246
<MetricsLayout.Filters>

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { parseWithZod } from "@conform-to/zod";
44
import {
55
BellAlertIcon,
66
BellSlashIcon,
7+
BookOpenIcon,
78
EnvelopeIcon,
89
LockClosedIcon,
910
PlusIcon,
@@ -24,7 +25,7 @@ import { Button, LinkButton } from "~/components/primitives/Buttons";
2425
import { ClipboardField } from "~/components/primitives/ClipboardField";
2526
import { DetailCell } from "~/components/primitives/DetailCell";
2627
import { Header2, Header3 } from "~/components/primitives/Headers";
27-
import { NavBar, PageTitle } from "~/components/primitives/PageHeader";
28+
import { NavBar, PageAccessories, PageTitle } from "~/components/primitives/PageHeader";
2829
import { Paragraph } from "~/components/primitives/Paragraph";
2930
import {
3031
Table,
@@ -59,12 +60,14 @@ import { requireUserId } from "~/services/session.server";
5960
import { cn } from "~/utils/cn";
6061
import {
6162
EnvironmentParamSchema,
63+
docsPath,
6264
v3BillingPath,
6365
v3NewProjectAlertPath,
6466
v3ProjectAlertsPath,
6567
} from "~/utils/pathBuilder";
6668
import { alertsWorker } from "~/v3/alertsWorker.server";
6769
import { alertsAgentPageContext } from "~/components/dashboard-agent/suggested-prompts";
70+
import { WhenAgentUnavailable } from "~/components/dashboard-agent/WhenAgentUnavailable";
6871
import type { Handle } from "~/utils/handle";
6972

7073
export const handle: Handle = {
@@ -190,6 +193,17 @@ export default function Page() {
190193
<PageContainer>
191194
<NavBar>
192195
<PageTitle title="Alerts" />
196+
<PageAccessories>
197+
<WhenAgentUnavailable>
198+
<LinkButton
199+
LeadingIcon={BookOpenIcon}
200+
to={docsPath("v3/troubleshooting-alerts")}
201+
variant="docs/small"
202+
>
203+
Alerts docs
204+
</LinkButton>
205+
</WhenAgentUnavailable>
206+
</PageAccessories>
193207
</NavBar>
194208
<PageBody scrollable={false}>
195209
{alertChannels.length > 0 ? (

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
BookOpenIcon,
23
CheckCircleIcon,
34
ExclamationTriangleIcon,
45
KeyIcon,
@@ -74,8 +75,9 @@ import {
7475
import { rbac } from "~/services/rbac.server";
7576
import { dashboardAction, dashboardLoader } from "~/services/routeBuilders/dashboardBuilder";
7677
import { cn } from "~/utils/cn";
77-
import { EnvironmentParamSchema, v3BillingPath } from "~/utils/pathBuilder";
78+
import { docsPath, EnvironmentParamSchema, v3BillingPath } from "~/utils/pathBuilder";
7879
import { sectionAgentPageContext } from "~/components/dashboard-agent/suggested-prompts";
80+
import { WhenAgentUnavailable } from "~/components/dashboard-agent/WhenAgentUnavailable";
7981
import type { Handle } from "~/utils/handle";
8082

8183
export const handle: Handle = {
@@ -340,6 +342,16 @@ export default function Page() {
340342
</Property.Item>
341343
</Property.Table>
342344
</AdminDebugTooltip>
345+
346+
<WhenAgentUnavailable>
347+
<LinkButton
348+
variant="docs/small"
349+
LeadingIcon={BookOpenIcon}
350+
to={docsPath("/v3/apikeys")}
351+
>
352+
API keys docs
353+
</LinkButton>
354+
</WhenAgentUnavailable>
343355
</PageAccessories>
344356
</NavBar>
345357
<PageBody scrollable={false}>

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ExclamationCircleIcon } from "@heroicons/react/20/solid";
2+
import { BookOpenIcon } from "@heroicons/react/24/solid";
23
import { Outlet, useLocation, useNavigation, useParams } from "@remix-run/react";
34

45
import { type LoaderFunctionArgs } from "@remix-run/server-runtime";
@@ -55,9 +56,15 @@ import {
5556
runOpsSplitReadEnabled,
5657
type PrismaClientOrTransaction,
5758
} from "~/db.server";
58-
import { EnvironmentParamSchema, v3BatchPath, v3BatchRunsPath } from "~/utils/pathBuilder";
59+
import {
60+
docsPath,
61+
EnvironmentParamSchema,
62+
v3BatchPath,
63+
v3BatchRunsPath,
64+
} from "~/utils/pathBuilder";
5965
import { throwNotFound } from "~/utils/httpErrors";
6066
import { batchesAgentPageContext } from "~/components/dashboard-agent/suggested-prompts";
67+
import { WhenAgentUnavailable } from "~/components/dashboard-agent/WhenAgentUnavailable";
6168
import type { Handle } from "~/utils/handle";
6269

6370
export const handle: Handle = {
@@ -122,6 +129,15 @@ export default function Page() {
122129
<PageTitle title="Batches" />
123130
<PageAccessories>
124131
<AdminDebugTooltip />
132+
<WhenAgentUnavailable>
133+
<LinkButton
134+
variant={"docs/small"}
135+
LeadingIcon={BookOpenIcon}
136+
to={docsPath("/triggering")}
137+
>
138+
Batches docs
139+
</LinkButton>
140+
</WhenAgentUnavailable>
125141
</PageAccessories>
126142
</NavBar>
127143
<PageBody scrollable={false}>

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getFormProps, getInputProps, useForm } from "@conform-to/react";
22
import { parseWithZod } from "@conform-to/zod";
33
import { ArrowUpCircleIcon, CheckIcon, EnvelopeIcon, PlusIcon } from "@heroicons/react/20/solid";
4+
import { BookOpenIcon } from "@heroicons/react/24/solid";
45
import { DialogClose } from "@radix-ui/react-dialog";
56
import { useFetcher, useSearchParams } from "@remix-run/react";
67
import { type ActionFunctionArgs, json, type LoaderFunctionArgs } from "@remix-run/server-runtime";
@@ -66,6 +67,7 @@ import { requireUserId } from "~/services/session.server";
6667
import { cn } from "~/utils/cn";
6768
import {
6869
branchesPath,
70+
docsPath,
6971
EnvironmentParamSchema,
7072
ProjectParamSchema,
7173
v3BillingPath,
@@ -78,6 +80,7 @@ import { NewBranchPanel } from "~/routes/resources.branches.create";
7880
import { BranchesOptions } from "~/utils/branches";
7981
import { IconArrowBearRight2 } from "@tabler/icons-react";
8082
import { branchesAgentPageContext } from "~/components/dashboard-agent/suggested-prompts";
83+
import { WhenAgentUnavailable } from "~/components/dashboard-agent/WhenAgentUnavailable";
8184
import type { Handle } from "~/utils/handle";
8285
import { pageMeta } from "~/utils/pageTitle";
8386

@@ -256,6 +259,17 @@ export default function Page() {
256259
))}
257260
</Property.Table>
258261
</AdminDebugTooltip>
262+
263+
<WhenAgentUnavailable>
264+
<LinkButton
265+
variant={"docs/small"}
266+
LeadingIcon={BookOpenIcon}
267+
to={docsPath("deployment/preview-branches")}
268+
>
269+
Branches docs
270+
</LinkButton>
271+
</WhenAgentUnavailable>
272+
259273
{limits.isAtLimit ? (
260274
<UpgradePanel
261275
limits={limits}

0 commit comments

Comments
 (0)