d3841929bde0c503dd0aeda3b1efd1e61cd64ea7
jcasper
  Fri Apr 10 15:59:41 2026 -0700
CSS changes to accompany logic disabling the 'show only selected' slider in
the faceted composite UI when no tracks are selected, refs #36320

diff --git src/hg/htdocs/style/facetedComposite.css src/hg/htdocs/style/facetedComposite.css
index 19a3cc9eafe..b5f246d4c90 100644
--- src/hg/htdocs/style/facetedComposite.css
+++ src/hg/htdocs/style/facetedComposite.css
@@ -1,198 +1,205 @@
 /* SPDX-License-Identifier: MIT; (c) 2025 Andrew D Smith (author) */
 #container {
     display: flex;
     width: 100%;
     gap: 1em;
     align-items: flex-start;
     box-sizing: border-box;
 }
 #filters {
     display: flex;
     flex-direction: column;
     gap: 1em;
     width: 300px;
     flex-shrink: 0;
     /* ADS: the lines below are for vertical scrolling if needed */
     /* max-height: 80vh; */
     /* overflow-y: auto; */
     align-self: stretch;
     box-sizing: border-box;
     padding-right: 0.5em;
 }
 #filters > div {
     display: flex;
     flex-direction: column;
     gap: 0.3em;
 }
 #filters label {
     display: flex;
     align-items: center;
     gap: 0.3em;
     cursor: pointer;
     user-select: none;
 }
 #theMetaDataTable_wrapper {
     flex: 1 1 auto;
     min-width: 0;
     box-sizing: border-box;
 }
 #theMetaDataTable {
     width: 100% !important;
     box-sizing: border-box;
     box-shadow: 0 0 0 1px #ddd;
 }
 #theMetaDataTable td:nth-child(n+2),
 #theMetaDataTable th:nth-child(n+2) {
     vertical-align: top;
     /* white-space: nowrap; */
     /* overflow: hidden;          /* hide overflow */
     min-width: 100px; /* Adjust width as needed */
 }
 /* Override Select 3.0's custom checkbox styling to use native appearance */
 table.dataTable input.dt-select-checkbox {
     appearance: auto;
     width: auto;
     height: auto;
 }
 table.dataTable input.dt-select-checkbox:checked::after,
 table.dataTable input.dt-select-checkbox:indeterminate::after {
     display: none;
 }
 #theMetaDataTable input.row-select {
     /* additional checkbox styling */
 }
 table.dataTable {
     width: 100%;
     border-collapse: collapse;
     table-layout: auto;
 }
 table.dataTable tbody tr:nth-child(odd) {
     background-color: #f0f0f0;
 }
 table.dataTable tbody tr:nth-child(even) {
     background-color: #ffffff;
 }
 table.dataTable tbody tr:hover {
     background-color: #d3eaff; /* Light blue on hover */
 }
 .color-box {
     display: inline-block;
     width: 1em;
     height: 1em;
     vertical-align: middle;
     /* background-color set dynamically in JS */
 }
 
 .facet-heading {
     cursor: pointer;
     user-select: none;
 }
 .facet-heading::after {
     content: "  ❯";
     margin-left: 0.3em;
     display: inline-block;
     transition: transform 0.2s;
     transform: rotate(90deg);   /* points down = expanded */
 }
 .facet-heading.collapsed::after {
     transform: rotate(0deg);    /* points right = collapsed */
 }
 .facet-body {
     display: flex;
     flex-direction: column;
     gap: 0.3em;
 }
 .facet-body.collapsed {
     display: none;
 }
 
 /* "Show only selected" toggle in the toolbar */
 #selected-filter {
     display: inline-flex;
     align-items: center;
     gap: 0.5em;
     margin-left: 1.5em;
 }
 .dt-length {
     display: inline-flex !important;
     align-items: center;
 }
 
 /* Toggle switch for "show only selected" filter */
 .toggle-switch {
     position: relative;
     display: inline-block;
     width: 28px;
     height: 16px;
 }
 .toggle-switch input {
     opacity: 0;
     width: 0;
     height: 0;
 }
 .toggle-slider {
     position: absolute;
     inset: 0;
     background-color: #ccc;
     border-radius: 16px;
     cursor: pointer;
     transition: background-color 0.2s;
 }
 .toggle-slider::before {
     content: "";
     position: absolute;
     height: 12px;
     width: 12px;
     left: 2px;
     bottom: 2px;
     background-color: white;
     border-radius: 50%;
     transition: transform 0.2s;
 }
 .toggle-switch input:checked + .toggle-slider {
     background-color: #4a90d9;
 }
 .toggle-switch input:checked + .toggle-slider::before {
     transform: translateX(12px);
 }
+.toggle-switch input:disabled + .toggle-slider {
+    opacity: 0.4;
+    cursor: not-allowed;
+}
+#selected-filter:has(input:disabled) #selected-filter-text {
+    opacity: 0.4;
+}
 
 /* Active filter chips bar */
 #active-filters {
     display: flex;
     flex-wrap: wrap;
     align-items: center;
     justify-content: flex-start;
     text-align: left;
     gap: 0.4em;
     padding: 0.5em 0;
     border-top: 1px solid #ddd;
     margin-top: 0.75em;
     width: 100%;
 }
 .filter-chip-group-label {
     font-weight: bold;
     font-size: 0.85em;
     margin-left: 0.3em;
 }
 .filter-chip {
     display: inline-flex;
     align-items: center;
     background-color: #e8f0fe;
     border: 1px solid #c2d6f2;
     border-radius: 12px;
     padding: 0.15em 0.5em;
     font-size: 0.85em;
     white-space: nowrap;
 }
 .filter-chip .remove-chip {
     background: none;
     border: none;
     cursor: pointer;
     font-size: 1em;
     line-height: 1;
     padding: 0 0 0 0.25em;
     color: #666;
 }
 .filter-chip .remove-chip:hover {
     color: #c00;
 }