consistently sort class names

keep None at the bottom
This commit is contained in:
Josh Hawkins 2026-03-13 07:45:46 -05:00
parent 544d3c6139
commit 6ad5e98681
2 changed files with 81 additions and 69 deletions

View File

@ -125,7 +125,13 @@ export default function ClassificationSelectionDialog({
isMobile && "gap-2 pb-4", isMobile && "gap-2 pb-4",
)} )}
> >
{classes.sort().map((category) => ( {classes
.sort((a, b) => {
if (a === "none") return 1;
if (b === "none") return -1;
return a.localeCompare(b);
})
.map((category) => (
<SelectorItem <SelectorItem
key={category} key={category}
className="flex cursor-pointer gap-2 smart-capitalize" className="flex cursor-pointer gap-2 smart-capitalize"

View File

@ -700,7 +700,13 @@ function LibrarySelector({
</div> </div>
</> </>
)} )}
{Object.keys(dataset).map((id) => ( {Object.keys(dataset)
.sort((a, b) => {
if (a === "none") return 1;
if (b === "none") return -1;
return a.localeCompare(b);
})
.map((id) => (
<DropdownMenuItem <DropdownMenuItem
key={id} key={id}
className="group flex items-center justify-between" className="group flex items-center justify-between"