fix: only fall back to the admin terminal display default when unset

The backend treated any value other than 'inline' or 'sidebar' as unset and fell back to the admin default, while the frontend (src/routes/+layout.svelte) does a plain equality check against 'inline'. Nothing validates UserSettings.ui, so a stored value like 'Inline' or true rendered inline on the backend-managed tool path and sidebar in the browser for the same user. Falling back only on None matches the frontend for every storable value and keeps the fallback for the absent key, which strip_default_interface_settings creates whenever the user's value equals the admin default.
This commit is contained in:
Classic298 2026-08-31 03:38:31 +02:00
parent 8f5d760515
commit b7c8082965

View file

@ -303,7 +303,7 @@ async def is_terminal_file_display_inline(user: UserModel) -> bool:
ui_settings = user.settings.ui if isinstance(user.settings, UserSettings) else None
value = (ui_settings or {}).get('terminalFileDisplay')
if value not in ('inline', 'sidebar'):
if value is None:
default_interface_settings = await Config.get('ui.default_interface_settings')
if isinstance(default_interface_settings, dict):
value = default_interface_settings.get('terminalFileDisplay')