Skip to content

fix: gallery crash when sorting boolean pinned flags - #8

Merged
kpal81xd merged 1 commit into
mainfrom
fix/gallery-pinned-sort
Oct 15, 2026
Merged

kpal81xd merged 1 commit into
mainfrom
fix/gallery-pinned-sort

Conversation

@kpal81xd

Copy link
Copy Markdown
Owner

/api/artifacts returns pinned as a boolean, but the gallery sorted it with String#localeCompare. With two or more artifacts the sort threw (b.pinned ?? "").localeCompare is not a function and the gallery never rendered.

The sort now compares the flags numerically, keeping pinned first, then newest.

Smoke test

  1. Publish at least two artifacts, then open http://localhost:47328/code/artifacts. All artifacts are listed, newest first, with no console error.
  2. Pin the oldest artifact. It moves to the top under "Pinned".
  3. Unpin it. It returns to its date position.

@kpal81xd kpal81xd self-assigned this Oct 15, 2026
@kpal81xd kpal81xd added the bug Something isn't working label Oct 15, 2026
@kpal81xd
kpal81xd merged commit 203e35c into main Oct 15, 2026
3 checks passed
@kpal81xd
kpal81xd deleted the fix/gallery-pinned-sort branch October 15, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant