mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 09:39:48 +08:00
Opening a book's URL directly — a bookmark, a new tab, a refresh — drew the library first: the empty list one level above the book, with "Loading…" inside it, and then a jump to the reader once the fetch landed. From the reader's side that reads as a bad route or a missing book, on the URL they had just asked for (#1440). The route already knows the answer. `view` started at `list` and only became `reader` after `loadBookDetail` returned, so one piece of state was answering two questions: which surface is this, and is its data here yet. A book id in the path settles the first before any request is made, so the initial view is now derived from it and `opening` renders the book's own shell — sidebar and all — while the data is in flight. That makes a failed load worse than it was, so it is handled here too: it used to leave the reader on a loaded library, and would now leave them in a shell that never fills. A load that fails says why and returns them to the library, URL included. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>