Merge pull request #14878 from itk-dev/feature/settings-modal-tab-list

Feature: settings modal tab list
This commit is contained in:
Tim Jaeryang Baek 2025-06-11 16:36:06 +04:00 committed by GitHub
commit 9a1d2a1844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 37 additions and 6 deletions

View File

@ -42,7 +42,7 @@
}); });
</script> </script>
<div class="flex flex-col h-full justify-between space-y-3 text-sm mb-6"> <div id="tab-about" class="flex flex-col h-full justify-between space-y-3 text-sm mb-6">
<div class=" space-y-3 overflow-y-scroll max-h-[28rem] lg:max-h-full"> <div class=" space-y-3 overflow-y-scroll max-h-[28rem] lg:max-h-full">
<div> <div>
<div class=" mb-2.5 text-sm font-medium flex space-x-2 items-center"> <div class=" mb-2.5 text-sm font-medium flex space-x-2 items-center">

View File

@ -86,7 +86,7 @@
}); });
</script> </script>
<div class="flex flex-col h-full justify-between text-sm"> <div id="tab-account" class="flex flex-col h-full justify-between text-sm">
<div class=" overflow-y-scroll max-h-[28rem] lg:max-h-full"> <div class=" overflow-y-scroll max-h-[28rem] lg:max-h-full">
<input <input
id="profile-image-input" id="profile-image-input"

View File

@ -154,6 +154,7 @@
</script> </script>
<form <form
id="tab-audio"
class="flex flex-col h-full justify-between space-y-3 text-sm" class="flex flex-col h-full justify-between space-y-3 text-sm"
on:submit|preventDefault={async () => { on:submit|preventDefault={async () => {
saveSettings({ saveSettings({

View File

@ -107,7 +107,7 @@
<ArchivedChatsModal bind:show={showArchivedChatsModal} onUpdate={handleArchivedChatsChange} /> <ArchivedChatsModal bind:show={showArchivedChatsModal} onUpdate={handleArchivedChatsChange} />
<div class="flex flex-col h-full justify-between space-y-3 text-sm"> <div id="tab-chats" class="flex flex-col h-full justify-between space-y-3 text-sm">
<div class=" space-y-2 overflow-y-scroll max-h-[28rem] lg:max-h-full"> <div class=" space-y-2 overflow-y-scroll max-h-[28rem] lg:max-h-full">
<div class="flex flex-col"> <div class="flex flex-col">
<input <input

View File

@ -70,6 +70,7 @@
<AddConnectionModal direct bind:show={showConnectionModal} onSubmit={addConnectionHandler} /> <AddConnectionModal direct bind:show={showConnectionModal} onSubmit={addConnectionHandler} />
<form <form
id="tab-connections"
class="flex flex-col h-full justify-between text-sm" class="flex flex-col h-full justify-between text-sm"
on:submit|preventDefault={() => { on:submit|preventDefault={() => {
updateHandler(); updateHandler();

View File

@ -187,7 +187,7 @@
}; };
</script> </script>
<div class="flex flex-col h-full justify-between text-sm"> <div class="flex flex-col h-full justify-between text-sm" id="tab-general">
<div class=" overflow-y-scroll max-h-[28rem] lg:max-h-full"> <div class=" overflow-y-scroll max-h-[28rem] lg:max-h-full">
<div class=""> <div class="">
<div class=" mb-1 text-sm font-medium">{$i18n.t('WebUI Settings')}</div> <div class=" mb-1 text-sm font-medium">{$i18n.t('WebUI Settings')}</div>

View File

@ -348,6 +348,7 @@
</script> </script>
<form <form
id="tab-interface"
class="flex flex-col h-full justify-between space-y-3 text-sm" class="flex flex-col h-full justify-between space-y-3 text-sm"
on:submit|preventDefault={() => { on:submit|preventDefault={() => {
updateInterfaceHandler(); updateInterfaceHandler();

View File

@ -24,6 +24,7 @@
<ManageModal bind:show={showManageModal} /> <ManageModal bind:show={showManageModal} />
<form <form
id="tab-personalization"
class="flex flex-col h-full justify-between space-y-3 text-sm" class="flex flex-col h-full justify-between space-y-3 text-sm"
on:submit|preventDefault={() => { on:submit|preventDefault={() => {
dispatch('save'); dispatch('save');

View File

@ -42,6 +42,7 @@
<AddServerModal bind:show={showConnectionModal} onSubmit={addConnectionHandler} direct /> <AddServerModal bind:show={showConnectionModal} onSubmit={addConnectionHandler} direct />
<form <form
id="tab-tools"
class="flex flex-col h-full justify-between text-sm" class="flex flex-col h-full justify-between text-sm"
on:submit|preventDefault={() => { on:submit|preventDefault={() => {
updateHandler(); updateHandler();

View File

@ -554,6 +554,7 @@
<div class="flex flex-col md:flex-row w-full px-4 pt-1 pb-4 md:space-x-4"> <div class="flex flex-col md:flex-row w-full px-4 pt-1 pb-4 md:space-x-4">
<div <div
role="tablist"
id="settings-tabs-container" id="settings-tabs-container"
class="tabs flex flex-row overflow-x-auto gap-2.5 md:gap-1 md:flex-col flex-1 md:flex-none md:w-40 md:min-h-[32rem] md:max-h-[32rem] dark:text-gray-200 text-sm font-medium text-left mb-1 md:mb-0 -translate-y-1" class="tabs flex flex-row overflow-x-auto gap-2.5 md:gap-1 md:flex-col flex-1 md:flex-none md:w-40 md:min-h-[32rem] md:max-h-[32rem] dark:text-gray-200 text-sm font-medium text-left mb-1 md:mb-0 -translate-y-1"
> >
@ -574,11 +575,13 @@
placeholder={$i18n.t('Search')} placeholder={$i18n.t('Search')}
/> />
</div> </div>
{#if visibleTabs.length > 0} {#if visibleTabs.length > 0}
{#each visibleTabs as tabId (tabId)} {#each visibleTabs as tabId (tabId)}
{#if tabId === 'general'} {#if tabId === 'general'}
<button <button
role="tab"
aria-controls="tab-general"
aria-selected={selectedTab === 'general'}
class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
${ ${
selectedTab === 'general' selectedTab === 'general'
@ -611,6 +614,9 @@
</button> </button>
{:else if tabId === 'interface'} {:else if tabId === 'interface'}
<button <button
role="tab"
aria-controls="tab-interface"
aria-selected={selectedTab === 'interface'}
class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
${ ${
selectedTab === 'interface' selectedTab === 'interface'
@ -644,6 +650,9 @@
{:else if tabId === 'connections'} {:else if tabId === 'connections'}
{#if $user?.role === 'admin' || ($user?.role === 'user' && $config?.features?.enable_direct_connections)} {#if $user?.role === 'admin' || ($user?.role === 'user' && $config?.features?.enable_direct_connections)}
<button <button
role="tab"
aria-controls="tab-connections"
aria-selected={selectedTab === 'connections'}
class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
${ ${
selectedTab === 'connections' selectedTab === 'connections'
@ -676,6 +685,9 @@
{:else if tabId === 'tools'} {:else if tabId === 'tools'}
{#if $user?.role === 'admin' || ($user?.role === 'user' && $user?.permissions?.features?.direct_tool_servers)} {#if $user?.role === 'admin' || ($user?.role === 'user' && $user?.permissions?.features?.direct_tool_servers)}
<button <button
role="tab"
aria-controls="tab-tools"
aria-selected={selectedTab === 'tools'}
class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
${ ${
selectedTab === 'tools' selectedTab === 'tools'
@ -709,6 +721,9 @@
{/if} {/if}
{:else if tabId === 'personalization'} {:else if tabId === 'personalization'}
<button <button
role="tab"
aria-controls="tab-personalization"
aria-selected={selectedTab === 'personalization'}
class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
${ ${
selectedTab === 'personalization' selectedTab === 'personalization'
@ -730,6 +745,9 @@
</button> </button>
{:else if tabId === 'audio'} {:else if tabId === 'audio'}
<button <button
role="tab"
aria-controls="tab-audio"
aria-selected={selectedTab === 'audio'}
class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
${ ${
selectedTab === 'audio' selectedTab === 'audio'
@ -763,6 +781,9 @@
</button> </button>
{:else if tabId === 'chats'} {:else if tabId === 'chats'}
<button <button
role="tab"
aria-controls="tab-chats"
aria-selected={selectedTab === 'chats'}
class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
${ ${
selectedTab === 'chats' selectedTab === 'chats'
@ -795,6 +816,9 @@
</button> </button>
{:else if tabId === 'account'} {:else if tabId === 'account'}
<button <button
role="tab"
aria-controls="tab-account"
aria-selected={selectedTab === 'account'}
class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
${ ${
selectedTab === 'account' selectedTab === 'account'
@ -827,6 +851,9 @@
</button> </button>
{:else if tabId === 'about'} {:else if tabId === 'about'}
<button <button
role="tab"
aria-controls="tab-about"
aria-selected={selectedTab === 'about'}
class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
${ ${
selectedTab === 'about' selectedTab === 'about'
@ -864,7 +891,6 @@
{$i18n.t('No results found')} {$i18n.t('No results found')}
</div> </div>
{/if} {/if}
{#if $user?.role === 'admin'} {#if $user?.role === 'admin'}
<a <a
href="/admin/settings" href="/admin/settings"