Podcasts sort by name with a leading "The" set aside (#481)
The feed list, the Podcasts shelf and the playlist dialog took the server's order, which is by id, a slug of the title, so The Rest Is Science was under T; the Directory sorted by title the same way. One helper, nameOrder, now orders names with a leading "The" aside, case and accents aside and numbers by value. renderFeeds sorts S.feeds with it, so a feed a live update adds or renames takes its place as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
This commit is contained in:
@@ -28,6 +28,13 @@ test('esc makes text safe to put in markup and attributes', () => {
|
||||
assert.equal(run('esc(undefined)'), '');
|
||||
});
|
||||
|
||||
test('names sort as a shelf files them, a leading The aside (#481)', () => {
|
||||
const names = ['The Rest Is Science', 'science weekly', 'Theory of Everything', 'Episode 10', 'Episode 2', 'the Daily', 'Radiolab'];
|
||||
// As JSON: an array from the page's VM is of another realm, which deepEqual tells apart.
|
||||
assert.deepEqual(JSON.parse(run(`JSON.stringify(${JSON.stringify(names)}.sort(nameOrder))`)),
|
||||
['the Daily', 'Episode 2', 'Episode 10', 'Radiolab', 'The Rest Is Science', 'science weekly', 'Theory of Everything']);
|
||||
});
|
||||
|
||||
test('webUrl keeps only web addresses from a feed', () => {
|
||||
assert.equal(run(`webUrl('https://example.com/a')`), 'https://example.com/a');
|
||||
assert.equal(run(`webUrl('HTTP://example.com/')`), 'HTTP://example.com/');
|
||||
|
||||
Reference in New Issue
Block a user