feat: let everyone who can use a model pick its model controls (#32860)

Picking a model control option, such as a Thinking level, needed both the Allow Chat Controls and Allow Chat Params permissions, so admins had to hand out the Advanced Parameters panel just to let people pick a preset. Model control picks now work for anyone with access to the model and are saved per model to their account. Allow Chat Controls still hides the Chat Controls panel and Allow Chat Params still hides the Advanced Parameters panel, in the chat and in personal Settings. Parameters a person saves to their account are no longer filtered by these two permissions, since any chat message could already set any parameter without them.

Fixes #32626
This commit is contained in:
Classic298 authored and GitHub committed 2026-10-22 04:44:53 +09:00
1 parent dc45e3960d
commit db5b874944
3 files changed
+2 -21

No files matched your search

@@ -1,6 +1,6 @@
<script lang="ts">
import { getContext, tick } from 'svelte';
import { models, user, mobile, settings, type Model } from '$lib/stores';
import { models, mobile, settings, type Model } from '$lib/stores';
import Dropdown from '$lib/components/common/Dropdown.svelte';
import DropdownMenu from '$lib/components/common/DropdownMenu.svelte';
import DropdownSub from '$lib/components/common/DropdownSub.svelte';
@@ -40,9 +40,6 @@
!('pipe' in model && model.pipe) &&
Object.keys(model.info?.params?.model_controls ?? {}).length > 0
);
$: permitted =
$user?.role === 'admin' ||
(($user?.permissions?.chat?.controls ?? true) && ($user?.permissions?.chat?.params ?? true));
$: rowClass = `focus-ring flex h-[1.6875rem] w-full cursor-pointer select-none items-center gap-2 rounded-xl px-2 text-left text-[0.8125rem] font-normal text-gray-700 outline-hidden transition-colors duration-75 dark:text-gray-100 ${$settings?.highContrastMode ? 'hover:bg-gray-200! dark:hover:bg-gray-800!' : 'hover:bg-gray-50/40! dark:hover:bg-gray-800/40!'}`;
$: selectedClass = $settings?.highContrastMode
? 'bg-gray-200 dark:bg-gray-800'
@@ -117,7 +114,7 @@
{/each}
{/snippet}
{#if permitted && available.length}
{#if available.length}
<Dropdown align="end" visualViewportAware onOpenChange={() => (active = null)}>
<Tooltip content={$i18n.t('Model controls')} placement="top">
<button