Repository navigation
fix(explorer): sort untitled documents in natural numeric order - #266
ThisIs-Developer merged 2 commits into
Conversation
|
@mikah13 is attempting to deploy a commit to the Developer Labs Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ThisIs-Developer
left a comment
There was a problem hiding this comment.
The natural sorting fix looks good and correctly addresses the "Untitled 10" / "Untitled 2" ordering issue.
However, the Vercel build is currently failing because "script.js" was updated without syncing the desktop resource:
"desktop-app/resources/js/script.js"
Please run:
"node desktop-app/prepare.js"
Then commit the regenerated desktop file(s) and verify that:
"npm run build"
passes successfully.
Also, please consider whether "sensitivity: 'base'" is actually required. If the goal is only natural numeric sorting, "{ numeric: true }" should be sufficient and would keep the change more focused.
Once the desktop resources are synced and the build passes, this should be ready for another review. 👍
Thanks for checking, I will get that resolved |
Natural numeric ordering only needs { numeric: true }. Keeping the
default sensitivity preserves the existing case and accent ordering.
Regenerated desktop-app/resources/js/script.js via desktop-app/prepare.js.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TDrHCrk7dhaiJdUkCNxgY6
Great work on this fix. Approved. 👍
|
Thanks for addressing the requested changes. Really appreciate the effort and the clean follow-up on the review feedback. The latest Vercel deployment is also passing successfully. Great work on this fix. Approved. 👍 |
What changed
compareNatural()helper inscript.jsusinglocaleCompare(..., undefined, { numeric: true, sensitivity: 'base' }).renderFlatDocumentView)renderWorkspaceTree)Why
Plain
localeComparesorts lexically, soUntitled 12sorted beforeUntitled 2(Untitled 1, Untitled 12, Untitled 2). New files created vianextUntitledTitle()(Untitled <counter>) hit this as soon as the counter reached 10+.How it was tested
node --check script.js— passed.Untitled 1, Untitled 10, Untitled 12, Untitled 2, Untitled 9Untitled 1, Untitled 2, Untitled 9, Untitled 10, Untitled 12npm run test:unit— fails identically onmain(missingmarkedpackage, pre-existing, unrelated).