Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitad748a8

Browse files
committed
display tasks tab conditionally and remove ai-tasks experiment
1 parentc1b35bf commitad748a8

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
ifapi.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-
funcCSPHeaders(experiments codersdk.Experiments,telemetrybool,proxyHostsfunc() []*proxyhealth.ProxyHost,staticAdditionsmap[CSPFetchDirective][]string)func(next http.Handler) http.Handler {
61+
funcCSPHeaders(telemetrybool,proxyHostsfunc() []*proxyhealth.ProxyHost,staticAdditionsmap[CSPFetchDirective][]string)func(next http.Handler) http.Handler {
6362
returnfunc(next http.Handler) http.Handler {
6463
returnhttp.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
iflen(extraConnect)>0 {
125124
for_,extraHost:=rangeextraConnect {
126125
// Allow embedding the app host.
127-
ifexperiments.Enabled(codersdk.ExperimentAITasks) {
128-
cspSrcs.Append(CSPDirectiveFrameSrc,extraHost.AppHost)
129-
}
126+
cspSrcs.Append(CSPDirectiveFrameSrc,extraHost.AppHost)
130127
ifextraHost.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
funcTestCSP(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
returnproxyHosts
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
ExperimentWebPushExperiment="web-push"// Enables web push notifications through the browser.
33703370
ExperimentWorkspacePrebuildsExperiment="workspace-prebuilds"// Enables the new workspace prebuilds feature.
33713371
ExperimentAgenticChatExperiment="agentic-chat"// Enables the new agentic AI chat feature.
3372-
ExperimentAITasksExperiment="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
constlocation=useLocation();
146146
constagenticChat=useAgenticChat();
147147
const{ metadata}=useEmbeddedMetadata();
148-
constexperimentsQuery=useQuery(experiments(metadata.experiments));
149148

150149
return(
151150
<navclassName={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
returncn(linkStyles.default,isActive ?linkStyles.active :"");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp