From a8145df12d1d2b865ac495c8fa8872a52db16dad Mon Sep 17 00:00:00 2001 From: hugocasa Date: Wed, 26 Aug 2026 12:12:09 +0200 Subject: [PATCH] fix: trim the origins tooltip and relabel the toggle when a default exists Co-Authored-By: Claude Opus 5 --- .../triggers/http/RouteCorsOption.svelte | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/frontend/src/lib/components/triggers/http/RouteCorsOption.svelte b/frontend/src/lib/components/triggers/http/RouteCorsOption.svelte index f66a3c0c69..792f223831 100644 --- a/frontend/src/lib/components/triggers/http/RouteCorsOption.svelte +++ b/frontend/src/lib/components/triggers/http/RouteCorsOption.svelte @@ -48,11 +48,14 @@ return undefined } + // Independent of the toggle: it decides what the toggle is called, which must + // not change as it is flipped. + let hasInstanceDefault = $derived( + instanceDefaultOrigins.length > 0 && !instanceDefaultOrigins.includes('*') + ) // Without this the toggle reading "off" would look like "callable from // anywhere" on an instance that has narrowed the default. - let inheritsInstanceDefault = $derived( - !restricted && instanceDefaultOrigins.length > 0 && !instanceDefaultOrigins.includes('*') - ) + let inheritsInstanceDefault = $derived(!restricted && hasInstanceDefault) let origins = $derived(parse(raw)) // Split from `error` so an entry that is merely still empty reads as a hint @@ -91,22 +94,18 @@ }) - +