Use natural sorting when displaying lists of book pages

Created on 8 December 2020, over 3 years ago
Updated 24 April 2024, 2 months ago

Problem/Motivation

The default sort order for book pages when weights are equal is non-intuitive. Currently, pages are displayed "asciibetically," requiring manual re-ordering to avoid clumsy displays.

This is different from ✨ Add configuration allowing administrative lists of books to be sorted alphabetically Postponed , as this targets pages, not books themselves.

<!--break-->

Steps to reproduce

Given an arbitrarily-ordered list of page titles, below:

  • (1) Heading
  • (8) Heading
  • (2) Heading
  • (4) Heading
  • (11) Heading
  • (5) Heading
  • (3) Heading
  • (6) Heading
  • (7) Heading
  • (10) Heading
  • (9) Heading

an end-user might expect them to be displayed like so:

  • (1) Heading
  • (2) Heading
  • (3) Heading
  • (4) Heading
  • (5) Heading
  • (6) Heading
  • (7) Heading
  • (8) Heading
  • (9) Heading
  • (10) Heading
  • (11) Heading

Currently, the Book module will display them as below:

  • (1) Heading
  • (10) Heading
  • (11) Heading
  • (2) Heading
  • (3) Heading
  • (4) Heading
  • (5) Heading
  • (6) Heading
  • (7) Heading
  • (8) Heading
  • (9) Heading

This is confusing for end-users, who must now fiddle with the weight field manually for desired results. Jeff Atwood best explains how this can make people feel.

Proposed resolution

Use natural sorting instead.

Remaining tasks

  1. Implement new sorting algorithm
  2. Update tests

User interface changes

  • Display order changes to (hopefully) be more intuitive.

API changes

None

Data model changes

None

Release notes snippet

TODO

✨ Feature request
Status

Needs work

Version

1.0

Component
BookΒ  β†’

Last updated 1 day ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡ΊπŸ‡ΈUnited States DragoonBoots New York

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024