Skip to content

Recipes index: server sort order differs from the client sorter #486

Description

@dubadub

Found during review of #456.

The index is sorted server-side with byte order (items.sort_by on name in src/web/builders.rs), so uppercase names sort before lowercase and "Recipe 10" sorts before "Recipe 9". The client-side sorter in templates/recipes.html then re-sorts with Intl.Collator (numeric, case-insensitive) on load. Two consequences: the no-JS first paint of the static site shows a different order from what JS settles on, and there is a theoretical reorder flash.

Fix: sort server-side with a case-insensitive natural key so both agree, or drop the client re-sort on load.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions