|
791 | 791 |
|
792 | 792 | <div class="section"> |
793 | 793 | <div class="section-header"> |
794 | | - <h2>Completed ({filteredCompletedDownloads.length})</h2> |
795 | | - <button |
796 | | - class="btn btn-sm" |
797 | | - class:btn-primary={selectionMode} |
798 | | - class:btn-secondary={!selectionMode} |
799 | | - onclick={() => { if (selectionMode) exitSelectionMode(); else selectionMode = true; }} |
800 | | - > |
801 | | - {selectionMode ? 'Cancel' : 'Select'} |
802 | | - </button> |
803 | | - <div class="tabs completed-filter"> |
| 794 | + <div class="section-header-left"> |
| 795 | + <h2>Completed ({filteredCompletedDownloads.length})</h2> |
804 | 796 | <button |
805 | | - class="tab" |
806 | | - class:active={completedFilter === 'all'} |
807 | | - onclick={() => (completedFilter = 'all')} |
808 | | - > |
809 | | - All |
810 | | - </button> |
811 | | - <button |
812 | | - class="tab" |
813 | | - class:active={completedFilter === 'cache'} |
814 | | - onclick={() => (completedFilter = 'cache')} |
815 | | - > |
816 | | - Cache |
817 | | - </button> |
818 | | - <button |
819 | | - class="tab" |
820 | | - class:active={completedFilter === 'library'} |
821 | | - onclick={() => (completedFilter = 'library')} |
| 797 | + class="channel-dropdown-trigger" |
| 798 | + class:active={selectionMode} |
| 799 | + onclick={() => { if (selectionMode) exitSelectionMode(); else selectionMode = true; }} |
822 | 800 | > |
823 | | - Library |
| 801 | + {selectionMode ? 'Cancel' : 'Select'} |
824 | 802 | </button> |
825 | 803 | </div> |
826 | | - {#if availableChannels.length > 1} |
827 | | - <!-- svelte-ignore a11y_no_static_element_interactions --> |
828 | | - <div |
829 | | - class="channel-dropdown" |
830 | | - onkeydown={(e) => { if (e.key === 'Escape') channelDropdownOpen = false; }} |
831 | | - > |
| 804 | + <div class="section-header-right"> |
| 805 | + <div class="tabs completed-filter"> |
832 | 806 | <button |
833 | | - class="channel-dropdown-trigger" |
834 | | - onclick={() => { channelDropdownOpen = !channelDropdownOpen; channelSearch = ''; }} |
| 807 | + class="tab" |
| 808 | + class:active={completedFilter === 'all'} |
| 809 | + onclick={() => (completedFilter = 'all')} |
835 | 810 | > |
836 | | - <span class="channel-dropdown-label">{channelFilter === 'all' ? 'All channels' : channelFilter}</span> |
837 | | - <svg width="12" height="12" viewBox="0 0 12 12" fill="none" class="channel-dropdown-chevron" class:open={channelDropdownOpen}> |
838 | | - <path d="M3 4.5L6 7.5L9 4.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> |
839 | | - </svg> |
| 811 | + All |
840 | 812 | </button> |
841 | | - {#if channelDropdownOpen} |
842 | | - <div class="channel-dropdown-menu"> |
843 | | - <input |
844 | | - type="text" |
845 | | - class="channel-dropdown-search" |
846 | | - placeholder="Search channels..." |
847 | | - bind:value={channelSearch} |
848 | | - autofocus |
849 | | - /> |
850 | | - <div class="channel-dropdown-options"> |
851 | | - <button |
852 | | - class="channel-dropdown-option" |
853 | | - class:selected={channelFilter === 'all'} |
854 | | - onclick={() => { channelFilter = 'all'; channelDropdownOpen = false; }} |
855 | | - > |
856 | | - All channels |
857 | | - </button> |
858 | | - {#each filteredChannelOptions as channel} |
| 813 | + <button |
| 814 | + class="tab" |
| 815 | + class:active={completedFilter === 'cache'} |
| 816 | + onclick={() => (completedFilter = 'cache')} |
| 817 | + > |
| 818 | + Cache |
| 819 | + </button> |
| 820 | + <button |
| 821 | + class="tab" |
| 822 | + class:active={completedFilter === 'library'} |
| 823 | + onclick={() => (completedFilter = 'library')} |
| 824 | + > |
| 825 | + Library |
| 826 | + </button> |
| 827 | + </div> |
| 828 | + {#if availableChannels.length > 1} |
| 829 | + <!-- svelte-ignore a11y_no_static_element_interactions --> |
| 830 | + <div |
| 831 | + class="channel-dropdown" |
| 832 | + onkeydown={(e) => { if (e.key === 'Escape') channelDropdownOpen = false; }} |
| 833 | + > |
| 834 | + <button |
| 835 | + class="channel-dropdown-trigger" |
| 836 | + onclick={() => { channelDropdownOpen = !channelDropdownOpen; channelSearch = ''; }} |
| 837 | + > |
| 838 | + <span class="channel-dropdown-label">{channelFilter === 'all' ? 'All channels' : channelFilter}</span> |
| 839 | + <svg width="12" height="12" viewBox="0 0 12 12" fill="none" class="channel-dropdown-chevron" class:open={channelDropdownOpen}> |
| 840 | + <path d="M3 4.5L6 7.5L9 4.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> |
| 841 | + </svg> |
| 842 | + </button> |
| 843 | + {#if channelDropdownOpen} |
| 844 | + <div class="channel-dropdown-menu"> |
| 845 | + <input |
| 846 | + type="text" |
| 847 | + class="channel-dropdown-search" |
| 848 | + placeholder="Search channels..." |
| 849 | + bind:value={channelSearch} |
| 850 | + autofocus |
| 851 | + /> |
| 852 | + <div class="channel-dropdown-options"> |
859 | 853 | <button |
860 | 854 | class="channel-dropdown-option" |
861 | | - class:selected={channelFilter === channel} |
862 | | - onclick={() => { channelFilter = channel; channelDropdownOpen = false; }} |
| 855 | + class:selected={channelFilter === 'all'} |
| 856 | + onclick={() => { channelFilter = 'all'; channelDropdownOpen = false; }} |
863 | 857 | > |
864 | | - {channel} |
| 858 | + All channels |
865 | 859 | </button> |
866 | | - {/each} |
867 | | - {#if filteredChannelOptions.length === 0} |
868 | | - <div class="channel-dropdown-empty">No channels found</div> |
869 | | - {/if} |
| 860 | + {#each filteredChannelOptions as channel} |
| 861 | + <button |
| 862 | + class="channel-dropdown-option" |
| 863 | + class:selected={channelFilter === channel} |
| 864 | + onclick={() => { channelFilter = channel; channelDropdownOpen = false; }} |
| 865 | + > |
| 866 | + {channel} |
| 867 | + </button> |
| 868 | + {/each} |
| 869 | + {#if filteredChannelOptions.length === 0} |
| 870 | + <div class="channel-dropdown-empty">No channels found</div> |
| 871 | + {/if} |
| 872 | + </div> |
870 | 873 | </div> |
871 | | - </div> |
872 | | - <!-- svelte-ignore a11y_no_static_element_interactions --> |
873 | | - <div class="channel-dropdown-backdrop" onclick={() => (channelDropdownOpen = false)}></div> |
874 | | - {/if} |
875 | | - </div> |
876 | | - {/if} |
877 | | - <!-- svelte-ignore a11y_no_static_element_interactions --> |
878 | | - <div |
879 | | - class="sort-dropdown" |
880 | | - onkeydown={(e) => { if (e.key === 'Escape') sortDropdownOpen = false; }} |
881 | | - > |
| 874 | + <!-- svelte-ignore a11y_no_static_element_interactions --> |
| 875 | + <div class="channel-dropdown-backdrop" onclick={() => (channelDropdownOpen = false)}></div> |
| 876 | + {/if} |
| 877 | + </div> |
| 878 | + {/if} |
| 879 | + <!-- svelte-ignore a11y_no_static_element_interactions --> |
| 880 | + <div |
| 881 | + class="sort-dropdown" |
| 882 | + onkeydown={(e) => { if (e.key === 'Escape') sortDropdownOpen = false; }} |
| 883 | + > |
882 | 884 | <button |
883 | 885 | class="channel-dropdown-trigger" |
884 | 886 | onclick={() => (sortDropdownOpen = !sortDropdownOpen)} |
|
911 | 913 | <div class="channel-dropdown-backdrop" onclick={() => (sortDropdownOpen = false)}></div> |
912 | 914 | {/if} |
913 | 915 | </div> |
| 916 | + </div> |
914 | 917 | </div> |
915 | 918 | <div class="completed-search"> |
916 | 919 | <svg class="search-icon" width="16" height="16" viewBox="0 0 16 16" fill="none"> |
|
1525 | 1528 | align-items: center; |
1526 | 1529 | gap: var(--spacing-md); |
1527 | 1530 | margin-bottom: var(--spacing-lg); |
| 1531 | + flex-wrap: wrap; |
| 1532 | + } |
| 1533 | +
|
| 1534 | + .section-header-left { |
| 1535 | + display: flex; |
| 1536 | + align-items: center; |
| 1537 | + gap: var(--spacing-sm); |
| 1538 | + } |
| 1539 | +
|
| 1540 | + .section-header-right { |
| 1541 | + display: flex; |
| 1542 | + align-items: center; |
| 1543 | + gap: var(--spacing-sm); |
1528 | 1544 | } |
1529 | 1545 |
|
1530 | 1546 | .section-header h2 { |
|
1565 | 1581 | border-color: rgba(255, 255, 255, 0.2); |
1566 | 1582 | } |
1567 | 1583 |
|
| 1584 | + .channel-dropdown-trigger.active { |
| 1585 | + background: var(--accent-primary); |
| 1586 | + border-color: var(--accent-primary); |
| 1587 | + color: #fff; |
| 1588 | + } |
| 1589 | +
|
1568 | 1590 | .channel-dropdown-chevron { |
1569 | 1591 | transition: transform 0.15s; |
1570 | 1592 | } |
|
0 commit comments