Skip to content

Commit d2ce956

Browse files
committed
display tasks tab conditionally and remove ai-tasks experiment
1 parent c1b35bf commit d2ce956

File tree

5 files changed

+4
-15
lines changed

5 files changed

+4
-15
lines changed

coderd/coderd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,6 @@ func New(options *Options) *API {
15361536
// Add CSP headers to all static assets and pages. CSP headers only affect
15371537
// browsers, so these don't make sense on api routes.
15381538
cspMW := httpmw.CSPHeaders(
1539-
api.Experiments,
15401539
options.Telemetry.Enabled(), func() []*proxyhealth.ProxyHost {
15411540
if api.DeploymentValues.Dangerous.AllowAllCors {
15421541
// In this mode, allow all external requests.

coderd/httpmw/csp.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"strings"
77

88
"github.com/coder/coder/v2/coderd/proxyhealth"
9-
"github.com/coder/coder/v2/codersdk"
109
)
1110

1211
// cspDirectives is a map of all csp fetch directives to their values.
@@ -59,7 +58,7 @@ const (
5958
// Example: https://github.com/coder/coder/issues/15118
6059
//
6160
//nolint:revive
62-
func CSPHeaders(experiments codersdk.Experiments, telemetry bool, proxyHosts func() []*proxyhealth.ProxyHost, staticAdditions map[CSPFetchDirective][]string) func(next http.Handler) http.Handler {
61+
func CSPHeaders(telemetry bool, proxyHosts func() []*proxyhealth.ProxyHost, staticAdditions map[CSPFetchDirective][]string) func(next http.Handler) http.Handler {
6362
return func(next http.Handler) http.Handler {
6463
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
6564
// Content-Security-Policy disables loading certain content types and can prevent XSS injections.
@@ -124,9 +123,7 @@ func CSPHeaders(experiments codersdk.Experiments, telemetry bool, proxyHosts fun
124123
if len(extraConnect) > 0 {
125124
for _, extraHost := range extraConnect {
126125
// Allow embedding the app host.
127-
if experiments.Enabled(codersdk.ExperimentAITasks) {
128-
cspSrcs.Append(CSPDirectiveFrameSrc, extraHost.AppHost)
129-
}
126+
cspSrcs.Append(CSPDirectiveFrameSrc, extraHost.AppHost)
130127
if extraHost.Host == "*" {
131128
// '*' means all
132129
cspSrcs.Append(CSPDirectiveConnectSrc, "*")

coderd/httpmw/csp_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/coder/coder/v2/coderd/httpmw"
1212
"github.com/coder/coder/v2/coderd/proxyhealth"
13-
"github.com/coder/coder/v2/codersdk"
1413
)
1514

1615
func TestCSP(t *testing.T) {
@@ -50,9 +49,7 @@ func TestCSP(t *testing.T) {
5049
r := httptest.NewRequest(http.MethodGet, "/", nil)
5150
rw := httptest.NewRecorder()
5251

53-
httpmw.CSPHeaders(codersdk.Experiments{
54-
codersdk.ExperimentAITasks,
55-
}, false, func() []*proxyhealth.ProxyHost {
52+
httpmw.CSPHeaders(false, func() []*proxyhealth.ProxyHost {
5653
return proxyHosts
5754
}, map[httpmw.CSPFetchDirective][]string{
5855
httpmw.CSPDirectiveMediaSrc: expectedMedia,

codersdk/deployment.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3369,7 +3369,6 @@ const (
33693369
ExperimentWebPush Experiment = "web-push" // Enables web push notifications through the browser.
33703370
ExperimentWorkspacePrebuilds Experiment = "workspace-prebuilds" // Enables the new workspace prebuilds feature.
33713371
ExperimentAgenticChat Experiment = "agentic-chat" // Enables the new agentic AI chat feature.
3372-
ExperimentAITasks Experiment = "ai-tasks" // Enables the new AI tasks feature.
33733372
)
33743373

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

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { API } from "api/api";
2-
import { experiments } from "api/queries/experiments";
32
import type * as TypesGen from "api/typesGenerated";
43
import { Button } from "components/Button/Button";
54
import { ExternalImage } from "components/ExternalImage/ExternalImage";
@@ -10,7 +9,6 @@ import { useWebpushNotifications } from "contexts/useWebpushNotifications";
109
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
1110
import { NotificationsInbox } from "modules/notifications/NotificationsInbox/NotificationsInbox";
1211
import type { FC } from "react";
13-
import { useQuery } from "react-query";
1412
import { NavLink, useLocation } from "react-router-dom";
1513
import { cn } from "utils/cn";
1614
import { DeploymentDropdown } from "./DeploymentDropdown";
@@ -145,7 +143,6 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
145143
const location = useLocation();
146144
const agenticChat = useAgenticChat();
147145
const { metadata } = useEmbeddedMetadata();
148-
const experimentsQuery = useQuery(experiments(metadata.experiments));
149146

150147
return (
151148
<nav className={cn("flex items-center gap-4 h-full", className)}>
@@ -178,7 +175,7 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
178175
Chat
179176
</NavLink>
180177
)}
181-
{experimentsQuery.data?.includes("ai-tasks") && (
178+
{metadata.tasksTabVisible.value && (
182179
<NavLink
183180
className={({ isActive }) => {
184181
return cn(linkStyles.default, isActive ? linkStyles.active : "");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy