        {:else if kind === "discosort"}
            {@const c = top().c}
            {@const ord = c.order || "new"}
            {@const byName = ord === "az" || ord === "za"}
            {@const grp = byName ? "none" : (c.group ?? "year")}
            <!-- the four orders are written out here rather than imported
                 from disco.js: this file is edited by every round and a new
                 import line is a collision waiting to happen. ORDER_LABEL
                 there carries the same four, and the walk asserts both. -->
            <div class="sheet-title">Sort &amp; group</div>
            <div class="sheet-sec">Order</div>
            <div class="chips" style="padding-bottom:12px">
                {#each [["new", "Newest first"], ["old", "Oldest first"], ["az", "A–Z"], ["za", "Z–A"]] as [k, l] (k)}
                    <button class="chip" class:on={ord === k} class:quiet={ord !== k} aria-pressed={ord === k} onclick={() => patch({ order: k })}>{l}</button>
                {/each}
            </div>
            <div class="sheet-sec">Group</div>
            <div class="chips" style="padding-bottom:12px">
                {#each [["year", "By year"], ["none", "None"]] as [k, l] (k)}
                    <button class="chip" class:on={grp === k} class:quiet={grp !== k} aria-pressed={grp === k} disabled={byName && k === "year"} onclick={() => patch({ group: k })}>{l}</button>
                {/each}
            </div>
            {#if byName}<div class="sec-note">By year needs a date order — under A–Z the years would repeat out of sequence.</div>{/if}
            <div style="padding: 4px var(--pad) 16px"><button class="btn btn-fill wide" onclick={closeHalf}>Done</button></div>
