|
54 | 54 | </script> |
55 | 55 |
|
56 | 56 | <div class="prefs"> |
| 57 | + <p class="prefs-hint">{macosPrefs.length} configured. Expand a category to manage settings.</p> |
57 | 58 | {#each byCategory as group (group.cat)} |
58 | | - <div class="group"> |
59 | | - <div class="group-label">{group.cat}</div> |
60 | | - {#each group.items as item (item.id)} |
61 | | - {@const on = isOn(item)} |
62 | | - <div class="row"> |
63 | | - <div class="row-text"> |
64 | | - <div class="row-name">{item.label}</div> |
65 | | - <div class="row-desc">{item.description}</div> |
| 59 | + <details class="group" name="macos-preference-category"> |
| 60 | + <summary> |
| 61 | + <span class="group-label">{group.cat}</span> |
| 62 | + <span class="group-count">{group.items.filter(isOn).length} / {group.items.length} included</span> |
| 63 | + <svg class="chevron" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="m9 5 7 7-7 7" /></svg> |
| 64 | + </summary> |
| 65 | + <div class="group-items"> |
| 66 | + {#each group.items as item (item.id)} |
| 67 | + {@const on = isOn(item)} |
| 68 | + <div class="row"> |
| 69 | + <div class="row-text"> |
| 70 | + <div class="row-name">{item.label}</div> |
| 71 | + <div class="row-desc">{item.description}</div> |
| 72 | + </div> |
| 73 | + <button class="knob" class:on role="switch" aria-checked={on} aria-label={item.label} onclick={() => toggle(item)}> |
| 74 | + <span class="knob-dot"></span> |
| 75 | + </button> |
66 | 76 | </div> |
67 | | - <button class="knob" class:on role="switch" aria-checked={on} aria-label={item.label} onclick={() => toggle(item)}> |
68 | | - <span class="knob-dot"></span> |
69 | | - </button> |
70 | | - </div> |
71 | | - {/each} |
72 | | - </div> |
| 77 | + {/each} |
| 78 | + </div> |
| 79 | + </details> |
73 | 80 | {/each} |
74 | 81 |
|
75 | 82 | {#if customPrefs.length > 0} |
76 | | - <div class="group"> |
77 | | - <div class="group-label">Custom</div> |
78 | | - {#each customPrefs as pref (pref.domain + ':' + pref.key)} |
79 | | - <div class="row"> |
80 | | - <div class="row-text"> |
81 | | - <div class="row-name">{pref.desc || pref.key}</div> |
82 | | - <div class="row-desc">{pref.domain} {pref.key} = {pref.value}</div> |
| 83 | + <details class="group" name="macos-preference-category"> |
| 84 | + <summary> |
| 85 | + <span class="group-label">Custom</span> |
| 86 | + <span class="group-count">{customPrefs.length} included</span> |
| 87 | + <svg class="chevron" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="m9 5 7 7-7 7" /></svg> |
| 88 | + </summary> |
| 89 | + <div class="group-items"> |
| 90 | + {#each customPrefs as pref (pref.domain + ':' + pref.key)} |
| 91 | + <div class="row"> |
| 92 | + <div class="row-text"> |
| 93 | + <div class="row-name">{pref.desc || pref.key}</div> |
| 94 | + <div class="row-desc">{pref.domain} {pref.key} = {pref.value}</div> |
| 95 | + </div> |
| 96 | + <button class="knob on" role="switch" aria-checked="true" aria-label="Remove {pref.key}" onclick={() => removeCustom(pref)}> |
| 97 | + <span class="knob-dot"></span> |
| 98 | + </button> |
83 | 99 | </div> |
84 | | - <button class="knob on" role="switch" aria-checked="true" aria-label="Remove {pref.key}" onclick={() => removeCustom(pref)}> |
85 | | - <span class="knob-dot"></span> |
86 | | - </button> |
87 | | - </div> |
88 | | - {/each} |
89 | | - </div> |
| 100 | + {/each} |
| 101 | + </div> |
| 102 | + </details> |
90 | 103 | {/if} |
91 | 104 | </div> |
92 | 105 |
|
|
96 | 109 | flex-direction: column; |
97 | 110 | } |
98 | 111 |
|
99 | | - .group + .group { |
100 | | - margin-top: 14px; |
| 112 | + .prefs-hint { |
| 113 | + font-size: 0.72rem; |
| 114 | + color: var(--text-muted); |
| 115 | + line-height: 1.5; |
| 116 | + margin: 0 0 10px; |
| 117 | + } |
| 118 | +
|
| 119 | + .group { |
| 120 | + border-bottom: 1px solid var(--border); |
| 121 | + } |
| 122 | +
|
| 123 | + summary { |
| 124 | + display: flex; |
| 125 | + align-items: center; |
| 126 | + gap: 12px; |
| 127 | + padding: 13px 4px; |
| 128 | + cursor: pointer; |
| 129 | + list-style: none; |
| 130 | + border-radius: 5px; |
| 131 | + } |
| 132 | +
|
| 133 | + summary::-webkit-details-marker { |
| 134 | + display: none; |
| 135 | + } |
| 136 | +
|
| 137 | + summary:hover { |
| 138 | + background: var(--bg-tertiary); |
| 139 | + } |
| 140 | +
|
| 141 | + summary:focus-visible, |
| 142 | + .knob:focus-visible { |
| 143 | + outline: 2px solid var(--accent); |
| 144 | + outline-offset: 2px; |
101 | 145 | } |
102 | 146 |
|
103 | 147 | .group-label { |
104 | | - font-size: 0.66rem; |
105 | | - font-weight: 600; |
106 | | - text-transform: uppercase; |
107 | | - letter-spacing: 0.1em; |
| 148 | + font-size: 0.8rem; |
| 149 | + color: var(--text-primary); |
| 150 | + } |
| 151 | +
|
| 152 | + .group-count { |
| 153 | + margin-left: auto; |
| 154 | + font-size: 0.68rem; |
108 | 155 | color: var(--text-muted); |
109 | | - padding: 8px 0 2px; |
| 156 | + white-space: nowrap; |
| 157 | + } |
| 158 | +
|
| 159 | + .chevron { |
| 160 | + flex-shrink: 0; |
| 161 | + color: var(--text-muted); |
| 162 | + } |
| 163 | +
|
| 164 | + .group[open] .chevron { |
| 165 | + transform: rotate(90deg); |
| 166 | + } |
| 167 | +
|
| 168 | + .group-items { |
| 169 | + max-height: 340px; |
| 170 | + overflow-y: auto; |
| 171 | + overscroll-behavior: contain; |
| 172 | + scrollbar-gutter: stable; |
| 173 | + padding: 0 4px 8px; |
110 | 174 | } |
111 | 175 |
|
112 | 176 | .row { |
|
120 | 184 |
|
121 | 185 | .row-text { |
122 | 186 | min-width: 0; |
| 187 | + overflow-wrap: anywhere; |
123 | 188 | } |
124 | 189 |
|
125 | 190 | .row-name { |
|
0 commit comments