Skip to content

Commit 1eeb4a6

Browse files
committed
fix(web): providers settings no longer imply a project scope
Signed-off-by: Yordis Prieto <[email protected]>
1 parent 50647de commit 1eeb4a6

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎apps/web/src/components/settings/SettingsScopeSentence.tsx‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export const SETTINGS_DEVICE_ONLY_PATHS: ReadonlySet<string> = new Set([
3636
"/settings/connections",
3737
]);
3838

39+
/** Pages saved per environment that ignore the project, so only the environment is a target. */
40+
export const SETTINGS_ENVIRONMENT_ONLY_PATHS: ReadonlySet<string> = new Set([
41+
"/settings/providers",
42+
]);
43+
3944
interface SettingsScopeMenuProps {
4045
readonly value: SettingsScopeSearch;
4146
readonly groups: readonly SidebarProjectSnapshot[];
@@ -62,6 +67,17 @@ export function SettingsScopeSentence() {
6267
environments,
6368
onChange: scope.selectScope,
6469
};
70+
if (SETTINGS_ENVIRONMENT_ONLY_PATHS.has(pathname)) {
71+
return (
72+
<p className="flex min-w-0 items-center gap-1.5 px-3 text-base text-muted-foreground sm:px-4">
73+
<span className="shrink-0">Applying settings on</span>
74+
<EnvironmentScopeMenu
75+
{...props}
76+
onChange={(next) => scope.selectScope(next.machine ? { machine: next.machine } : {})}
77+
/>
78+
</p>
79+
);
80+
}
6581
return (
6682
<p className="flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1 px-3 text-base text-muted-foreground sm:px-4">
6783
{/* Each connective stays with its picker so a wrap never strands "on". */}

0 commit comments

Comments
 (0)