Loading homepage
Input: sortReadingOrder([{ id:"b", x:20, y:1 }, { id:"c", x:5, y:20 }, { id:"a", x:0, y:4 }], 5).map(p => p.id); Output: ["a", "b", "c"]
Input: sortReadingOrder([{x:30,y:0},{x:20,y:8},{x:10,y:16}],10).map(p=>p.y); Output: [8, 0, 16]; y=16 does not join the row anchored at 0.
Implement the exported API in index.js or index.ts. Tests cover the documented contract and edge cases.