Browse Source

add aria-controls and ids to connect tabs to content

Sine Jespersen 4 months ago
parent
commit
5dd99a0ea7

+ 1 - 1
src/lib/components/chat/Settings/About.svelte

@@ -42,7 +42,7 @@
 	});
 </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>
 			<div class=" mb-2.5 text-sm font-medium flex space-x-2 items-center">

+ 1 - 1
src/lib/components/chat/Settings/Account.svelte

@@ -86,7 +86,7 @@
 	});
 </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">
 		<input
 			id="profile-image-input"

+ 1 - 0
src/lib/components/chat/Settings/Audio.svelte

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

+ 1 - 1
src/lib/components/chat/Settings/Chats.svelte

@@ -107,7 +107,7 @@
 
 <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="flex flex-col">
 			<input

+ 1 - 0
src/lib/components/chat/Settings/Connections.svelte

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

+ 1 - 1
src/lib/components/chat/Settings/General.svelte

@@ -187,7 +187,7 @@
 	};
 </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="">
 			<div class=" mb-1 text-sm font-medium">{$i18n.t('WebUI Settings')}</div>

+ 1 - 0
src/lib/components/chat/Settings/Interface.svelte

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

+ 1 - 0
src/lib/components/chat/Settings/Personalization.svelte

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

+ 1 - 0
src/lib/components/chat/Settings/Tools.svelte

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

+ 9 - 0
src/lib/components/chat/SettingsModal.svelte

@@ -580,6 +580,7 @@
 						{#if tabId === 'general'}
 							<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
 								${
@@ -614,6 +615,7 @@
 						{:else if tabId === 'interface'}
 							<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
 								${
@@ -649,6 +651,7 @@
 							{#if $user?.role === 'admin' || ($user?.role === 'user' && $config?.features?.enable_direct_connections)}
 								<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
 								${
@@ -683,6 +686,7 @@
 							{#if $user?.role === 'admin' || ($user?.role === 'user' && $user?.permissions?.features?.direct_tool_servers)}
 								<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
 								${
@@ -718,6 +722,7 @@
 						{:else if tabId === 'personalization'}
 							<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
 								${
@@ -741,6 +746,7 @@
 						{:else if tabId === 'audio'}
 							<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
 								${
@@ -776,6 +782,7 @@
 						{:else if tabId === 'chats'}
 							<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
 								${
@@ -810,6 +817,7 @@
 						{:else if tabId === 'account'}
 							<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
 								${
@@ -844,6 +852,7 @@
 						{:else if tabId === 'about'}
 							<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
 								${