mirror of
https://github.com/markuryy/shark.git
synced 2025-12-12 11:41:02 +00:00
refctor(ui): make tabs layout consistent with the rest of the app in settings and queue
This commit is contained in:
@@ -42,24 +42,39 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="downloads-page">
|
<div class="downloads-wrapper">
|
||||||
<div class="header">
|
<h2 style="padding: 8px">Downloads</h2>
|
||||||
<h2>Downloads</h2>
|
|
||||||
<div class="header-actions">
|
|
||||||
<button onclick={handleClearCompleted} disabled={queueItems.every(i => i.status !== 'completed')}>
|
|
||||||
Clear Completed
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{#if queueItems.length === 0}
|
<section class="downloads-content">
|
||||||
<div class="empty-state">
|
<!--
|
||||||
<p>No downloads in queue</p>
|
svelte-ignore a11y_no_noninteractive_element_to_interactive_role
|
||||||
<p class="help-text">Add tracks, albums, or playlists from services to start downloading</p>
|
Reason: 98.css library requires <menu role="tablist"> for proper tab styling.
|
||||||
</div>
|
-->
|
||||||
{:else}
|
<menu role="tablist">
|
||||||
<div class="sunken-panel" style="overflow: auto; flex: 1;">
|
<li role="tab" aria-selected={true}>
|
||||||
<table class="interactive">
|
<button>Queue</button>
|
||||||
|
</li>
|
||||||
|
</menu>
|
||||||
|
|
||||||
|
<div class="window tab-content" role="tabpanel">
|
||||||
|
<div class="window-body">
|
||||||
|
<div class="tab-header">
|
||||||
|
<h4>{queueItems.length} item{queueItems.length !== 1 ? 's' : ''} in queue</h4>
|
||||||
|
<div class="header-actions">
|
||||||
|
<button onclick={handleClearCompleted} disabled={queueItems.every(i => i.status !== 'completed')}>
|
||||||
|
Clear Completed
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{#if queueItems.length === 0}
|
||||||
|
<div class="empty-state">
|
||||||
|
<p>No downloads in queue</p>
|
||||||
|
<p class="help-text">Add tracks, albums, or playlists from services to start downloading</p>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="sunken-panel table-container">
|
||||||
|
<table class="interactive">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="col-title">Title</th>
|
<th class="col-title">Title</th>
|
||||||
@@ -97,28 +112,62 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.downloads-page {
|
.downloads-wrapper {
|
||||||
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 1.4em;
|
}
|
||||||
|
|
||||||
|
.downloads-content {
|
||||||
|
margin: 0;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-content {
|
||||||
|
margin-top: -2px;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-content .window-body {
|
||||||
|
padding: 0;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8px;
|
||||||
|
border-bottom: 1px solid var(--button-shadow, #808080);
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-header h4 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1em;
|
||||||
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-actions {
|
.header-actions {
|
||||||
@@ -126,13 +175,21 @@
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table-container {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.empty-state {
|
.empty-state {
|
||||||
|
padding: 32px 16px;
|
||||||
|
text-align: center;
|
||||||
|
opacity: 0.6;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: light-dark(#666, #999);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-state p {
|
.empty-state p {
|
||||||
@@ -155,6 +212,9 @@
|
|||||||
|
|
||||||
.col-title {
|
.col-title {
|
||||||
width: auto;
|
width: auto;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.col-artist {
|
.col-artist {
|
||||||
|
|||||||
@@ -141,32 +141,34 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div style="padding: 8px;">
|
<div class="settings-wrapper">
|
||||||
<h2>Settings</h2>
|
<h2 style="padding: 8px">Settings</h2>
|
||||||
<!--
|
|
||||||
svelte-ignore a11y_no_noninteractive_element_to_interactive_role
|
|
||||||
Reason: 98.css library requires <menu role="tablist"> for proper tab styling.
|
|
||||||
The role="tablist" selector is used by 98.css CSS rules (menu[role="tablist"]).
|
|
||||||
The <menu> element IS interactive (contains clickable <button> elements) and the
|
|
||||||
role="tablist" properly describes the semantic purpose to assistive technology.
|
|
||||||
This is the documented pattern from 98.css and matches WAI-ARIA tab widget patterns.
|
|
||||||
-->
|
|
||||||
<menu role="tablist">
|
|
||||||
<li role="tab" aria-selected={activeTab === 'library'}>
|
|
||||||
<a href="#library" onclick={(e) => { e.preventDefault(); activeTab = 'library'; }}>Library</a>
|
|
||||||
</li>
|
|
||||||
<li role="tab" aria-selected={activeTab === 'deezer'}>
|
|
||||||
<a href="#deezer" onclick={(e) => { e.preventDefault(); activeTab = 'deezer'; }}>Deezer</a>
|
|
||||||
</li>
|
|
||||||
<li role="tab" aria-selected={activeTab === 'advanced'}>
|
|
||||||
<a href="#advanced" onclick={(e) => { e.preventDefault(); activeTab = 'advanced'; }}>Advanced</a>
|
|
||||||
</li>
|
|
||||||
</menu>
|
|
||||||
|
|
||||||
<div class="window" role="tabpanel">
|
<section class="settings-content">
|
||||||
<div class="window-body">
|
<!--
|
||||||
|
svelte-ignore a11y_no_noninteractive_element_to_interactive_role
|
||||||
|
Reason: 98.css library requires <menu role="tablist"> for proper tab styling.
|
||||||
|
The role="tablist" selector is used by 98.css CSS rules (menu[role="tablist"]).
|
||||||
|
The <menu> element IS interactive (contains clickable <button> elements) and the
|
||||||
|
role="tablist" properly describes the semantic purpose to assistive technology.
|
||||||
|
This is the documented pattern from 98.css and matches WAI-ARIA tab widget patterns.
|
||||||
|
-->
|
||||||
|
<menu role="tablist">
|
||||||
|
<li role="tab" aria-selected={activeTab === 'library'}>
|
||||||
|
<a href="#library" onclick={(e) => { e.preventDefault(); activeTab = 'library'; }}>Library</a>
|
||||||
|
</li>
|
||||||
|
<li role="tab" aria-selected={activeTab === 'deezer'}>
|
||||||
|
<a href="#deezer" onclick={(e) => { e.preventDefault(); activeTab = 'deezer'; }}>Deezer</a>
|
||||||
|
</li>
|
||||||
|
<li role="tab" aria-selected={activeTab === 'advanced'}>
|
||||||
|
<a href="#advanced" onclick={(e) => { e.preventDefault(); activeTab = 'advanced'; }}>Advanced</a>
|
||||||
|
</li>
|
||||||
|
</menu>
|
||||||
|
|
||||||
|
<div class="window tab-content" role="tabpanel">
|
||||||
|
<div class="window-body">
|
||||||
{#if activeTab === 'library'}
|
{#if activeTab === 'library'}
|
||||||
<section class="tab-content">
|
<section>
|
||||||
<h3>Library Folders</h3>
|
<h3>Library Folders</h3>
|
||||||
<div class="field-row-stacked">
|
<div class="field-row-stacked">
|
||||||
<label for="music-folder">Music Folder</label>
|
<label for="music-folder">Music Folder</label>
|
||||||
@@ -214,7 +216,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{:else if activeTab === 'deezer'}
|
{:else if activeTab === 'deezer'}
|
||||||
<section class="tab-content">
|
<section>
|
||||||
<h3>Deezer Download Settings</h3>
|
<h3>Deezer Download Settings</h3>
|
||||||
|
|
||||||
<div class="field-row-stacked">
|
<div class="field-row-stacked">
|
||||||
@@ -336,7 +338,7 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</section>
|
</section>
|
||||||
{:else if activeTab === 'advanced'}
|
{:else if activeTab === 'advanced'}
|
||||||
<section class="tab-content">
|
<section>
|
||||||
<h3>Advanced Settings</h3>
|
<h3>Advanced Settings</h3>
|
||||||
|
|
||||||
<div class="field-row-stacked">
|
<div class="field-row-stacked">
|
||||||
@@ -364,14 +366,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{/if}
|
{/if}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.settings-wrapper {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin-top: 0;
|
margin: 0;
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@@ -380,12 +388,27 @@
|
|||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu[role="tablist"] {
|
.settings-content {
|
||||||
margin-bottom: 0;
|
margin: 0;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-content {
|
.tab-content {
|
||||||
margin: 0;
|
margin-top: -2px;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-content .window-body {
|
||||||
|
padding: 12px;
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-note {
|
.info-note {
|
||||||
|
|||||||
Reference in New Issue
Block a user