feat(playlist): add filename sort mode#19
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (19)
📝 WalkthroughWalkthroughAdds filename-based playlist sorting that extracts file basenames cross-platform and sorts using numeric-aware collation. The feature is integrated into the sort menu with i18n support across 17 locales and documented for guidance. ChangesFilename Playlist Sort Mode
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/views/PlaylistView.tsx`:
- Line 1250: The code currently uses a per-key i18n fallback for the
"sort.filename" key in the PlaylistView component; remove the inline English
fallback and call t("sort.filename") instead so the string relies solely on
locale JSONs (locate the usage in PlaylistView where filename:
t("sort.filename", "Filename") is set and replace it with t("sort.filename")).
Ensure all locale JSON files under src/i18n/locales/ include a "sort.filename"
entry so there is no per-key fallback at runtime.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: b41d5475-d8f9-4c04-9267-1e37e287828c
📒 Files selected for processing (19)
CLAUDE.mdsrc/components/views/PlaylistView.tsxsrc/i18n/locales/ar.jsonsrc/i18n/locales/de.jsonsrc/i18n/locales/en.jsonsrc/i18n/locales/es.jsonsrc/i18n/locales/fr.jsonsrc/i18n/locales/hi.jsonsrc/i18n/locales/id.jsonsrc/i18n/locales/it.jsonsrc/i18n/locales/ja.jsonsrc/i18n/locales/kr.jsonsrc/i18n/locales/nl.jsonsrc/i18n/locales/pt-BR.jsonsrc/i18n/locales/pt.jsonsrc/i18n/locales/ru.jsonsrc/i18n/locales/tr.jsonsrc/i18n/locales/zh-CN.jsonsrc/i18n/locales/zh-TW.json
Many users (including the project owner) number their files manually (`01. Track.mp3`, `02. Track.mp3`) and rely on filename ordering to preserve a sequence that doesn't match any tag-derived field. The new mode sorts on the cross-platform basename of `file_path` with `Intl.Collator` (numeric:true) so "1 …" / "2 …" / "10 …" land in natural order like Explorer/Finder.
The key is now defined in all 17 locales (added in the same commit
that introduced the sort mode) so the inline English fallback in
t("sort.filename", "Filename") is unreachable. Per the project's
locale-completeness contract, drop it.
8504f93 to
a2e0467
Compare
Summary
Adds a Filename option to the playlist sort dropdown. Sorts on the cross-platform basename of
track.file_pathwithIntl.Collator({ numeric: true })so users who manually number their files (01. …,02. …,10. …) get a natural order matching Explorer/Finder behaviour — and not the lexicographic1, 10, 2, 20, 3trap.Same client-side sort pattern as the existing modes: doesn't touch
playlist_track.positionin the DB, so flipping back to "Custom order" restores the curated drag-and-drop order verbatim.Test plan
1 Track.mp3,2 Track.mp3,10 Track.mp3→ switch sort to "Filename" → expect1 / 2 / 10order (not1 / 10 / 2).01.mp3/02.mp3) and unnumbered files → leading-zero numbered cluster first, unnumbered fall in lexicographic order.\paths) → basename still resolves correctly.Summary by CodeRabbit