Skip to content

Commit ad748a8

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

File tree

5 files changed

+4
-13
lines changed

5 files changed

+4
-13
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
145145
const location = useLocation();
146146
const agenticChat = useAgenticChat();
147147
const { metadata } = useEmbeddedMetadata();
148-
const experimentsQuery = useQuery(experiments(metadata.experiments));
149148

150149
return (
151150
<nav className={cn("flex items-center gap-4 h-full", className)}>
@@ -178,7 +177,7 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
178177
Chat
179178
</NavLink>
180179
)}
181-
{experimentsQuery.data?.includes("ai-tasks") && (
180+
{metadata.tasksTabVisible.value && (
182181
<NavLink
183182
className={({ isActive }) => {
184183
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