Skip to content

Fixed label select ordering with infinite scroll#26702

Merged
kevinansfield merged 1 commit intomainfrom
worktree-BER-3402-label-select-ordering
Mar 4, 2026
Merged

Fixed label select ordering with infinite scroll#26702
kevinansfield merged 1 commit intomainfrom
worktree-BER-3402-label-select-ordering

Conversation

@kevinansfield
Copy link
Member

Summary

  • Removed ignorePunctuation: true from label client-side sort to match server ordering
  • ignorePunctuation caused #-prefixed labels to sort as if the # didn't exist, but the server's name asc puts # before alphabetical characters
  • This mismatch meant each new page of labels loaded via infinite scroll appeared in the wrong position instead of appending to the list

ref https://linear.app/ghost/issue/BER-3402/

ref https://linear.app/ghost/issue/BER-3402/

The client-side sort used `ignorePunctuation: true` which treated `#` as
punctuation, sorting `#label` as `label`. The server's `name asc` ordering
puts `#` before alphabetical characters, so newly loaded pages appeared
in the wrong position instead of being appended to the list.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7d04cbbb-7bb7-4350-8cea-0f124fbc22cc

📥 Commits

Reviewing files that changed from the base of the PR and between 3671359 and 96a6cdc.

📒 Files selected for processing (1)
  • ghost/admin/app/services/labels-manager.js

Walkthrough

The change modifies the label sorting logic by removing the ignorePunctuation: true parameter from a localeCompare call in the labels-manager service. This updates the sorting algorithm to respect punctuation characters that were previously ignored during alphabetical ordering. The modification affects how labels are ordered but does not alter any public API signatures.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing label ordering to work correctly with infinite scroll by removing the ignorePunctuation option.
Description check ✅ Passed The description clearly explains the problem, solution, and impact: removing ignorePunctuation from client-side sorting to match server behavior and fix infinite scroll label positioning.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch worktree-BER-3402-label-select-ordering

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kevinansfield kevinansfield enabled auto-merge (squash) March 4, 2026 17:54
@kevinansfield kevinansfield merged commit 895aa01 into main Mar 4, 2026
31 checks passed
@kevinansfield kevinansfield deleted the worktree-BER-3402-label-select-ordering branch March 4, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant