web/settings: add an option to hide the remux tab on mobile

This commit is contained in:
wukko 2025-05-01 00:25:03 +06:00
parent a1e20ccc3e
commit a22e4c3cf9
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2
5 changed files with 27 additions and 3 deletions

View File

@ -144,5 +144,9 @@
"local.webcodecs": "webcodecs",
"local.webcodecs.title": "use webcodecs for on-device processing",
"local.webcodecs.description": "when decoding or encoding files, cobalt will try to use webcodecs. this feature allows for GPU-accelerated processing of media files, meaning that all decoding & encoding will be way faster.\n\navailability and stability of this feature depends on your device's and browser's capabilities. stuff might break or not work properly."
"local.webcodecs.description": "when decoding or encoding files, cobalt will try to use webcodecs. this feature allows for GPU-accelerated processing of media files, meaning that all decoding & encoding will be way faster.\n\navailability and stability of this feature depends on your device's and browser's capabilities. stuff might break or not work properly.",
"tabs": "navigation",
"tabs.hide_remux": "hide the remux tab",
"tabs.hide_remux.description": "if you don't use the remux tool, you can hide it from the navigation bar."
}

View File

@ -1,4 +1,6 @@
<script lang="ts">
import settings from "$lib/state/settings";
import { t } from "$lib/i18n/translations";
import { defaultNavPage } from "$lib/subnav";
@ -30,7 +32,9 @@
<div id="sidebar-tabs" role="tablist">
<div id="sidebar-actions" class="sidebar-inner-container">
<SidebarTab name="save" path="/" icon={IconDownload} />
<SidebarTab name="remux" path="/remux" icon={IconRepeat} beta />
{#if !$settings.appearance.hideRemuxTab}
<SidebarTab name="remux" path="/remux" icon={IconRepeat} beta />
{/if}
</div>
<div id="sidebar-info" class="sidebar-inner-container">
<SidebarTab name="settings" path={settingsLink} icon={IconSettings} />

View File

@ -12,6 +12,7 @@ const defaultSettings: CobaltSettings = {
theme: "auto",
language: defaultLocale,
autoLanguage: true,
hideRemuxTab: false,
},
accessibility: {
reduceMotion: false,

View File

@ -2,7 +2,9 @@ import { type CobaltSettingsV4 } from "$lib/types/settings/v4";
export type CobaltSettingsV5 = Omit<CobaltSettingsV4, 'schemaVersion' | 'advanced' | 'save' | 'privacy' | 'appearance'> & {
schemaVersion: 5,
appearance: Omit<CobaltSettingsV4['appearance'], 'reduceMotion' | 'reduceTransparency'>,
appearance: Omit<CobaltSettingsV4['appearance'], 'reduceMotion' | 'reduceTransparency'> & {
hideRemuxTab: boolean,
},
accessibility: {
reduceMotion: boolean;
reduceTransparency: boolean;

View File

@ -1,5 +1,7 @@
<script lang="ts">
import settings from "$lib/state/settings";
import { device } from "$lib/device";
import { themeOptions } from "$lib/types/settings";
import { t, locales } from "$lib/i18n/translations";
@ -52,3 +54,14 @@
disabled={$settings.appearance.autoLanguage}
/>
</SettingsCategory>
{#if device.is.mobile}
<SettingsCategory sectionId="tabs" title={$t("settings.tabs")}>
<SettingsToggle
settingContext="appearance"
settingId="hideRemuxTab"
title={$t("settings.tabs.hide_remux")}
description={$t("settings.tabs.hide_remux.description")}
/>
</SettingsCategory>
{/if}