You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 09cc2fc
Browse filesBrowse the repository at this point in the historyBrowse files
Both sides added a test at the same place in the storage fallback tests:
the ideas notice here, and a #project: link without IndexedDB on home-page.
Both are kept.
Copy file name to clipboardExpand all lines: docs/home-page.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,16 +36,17 @@ Still to try:
36
36
- Writes are coalesced per file with a short delay and flushed on `pagehide` and `visibilitychange`, stamped with the edit time so "last modified" is the edit. A flush never reads before it writes, and one from a hidden or unloading page commits explicitly: a transaction that waits on a read, or on its requests finishing, does not survive the page unloading. So the open project's storage holds the project's name and writes the whole record. A failed flush drops that batch, keeps the in-memory copy, logs once per session and shows ml-trainer's persistent toast: "Browser storage full" for a quota error, "Failed to save your project to browser storage" otherwise. Page actions that hit the quota show the same toast.
37
37
- Cross-tab: a `BroadcastChannel` carries `changed` and `deleted` project ids. Tabs refresh their lists; a tab with a changed project open reloads it; one with a deleted project open lets go of it, stops writing it and, if the editor is showing, goes to the home page with a message. Timestamp bumps (e.g. from open) are not broadcast.
38
38
- No IndexedDB (private browsing, blocked storage): one implicit project in session storage as today, no project management, pages redirect to the editor. Iframe controller mode is unchanged: the host owns the project.
39
-
- Migration: on first load, session-storage files with no current project id become a new project with the stored name, and the editor opens on them. A `#project:` link takes precedence.
39
+
- Migration: when the database opens, session-storage files left by the editor from before the database become a new project with the stored name, and the tab's current project. So the pages list it and the editor opens it, whichever loads first: the editor's old address is now the home page, so a tab reloaded after the upgrade lands there. A `#project:` link still opens its own project; the migrated one is then just in the list.
40
40
- The dirty flag is not stored in the database. The before-unload prompt applies only without the database, where closing the tab still loses work.
41
41
- Not done, deliberately: `navigator.storage.persist()` (Firefox prompts, Safari ignores it). The home page's info tooltip says projects are stored in this browser.
42
42
43
43
### Routing
44
44
45
45
-`react-router` 7, `createBrowserRouter`, one root layout route with `errorElement`, `urls.ts` builders as route paths, as ml-trainer. No project id in the URL; the tab's project is in `sessionStorage`.
46
46
- Editor at `/project` with tabs at `/project/:tab/:slug`; the old `/:tab/:slug` paths redirect; unknown paths are the shared not-found page. Iframe mode has a single-route router with the editor at the root.
47
-
- The editor route's loader chooses the project: the tab's, else migrated sessionstorage, else the most recent, else a new one with the starter program. So `/project` in a fresh tab goes straight to code, which ml-trainer does not do; the editor is low friction today and some users bookmark it.
47
+
- The editor route's loader chooses the project: the tab's (which a migrated session-storage project becomes), else the most recent, else a new one with the starter program. So `/project` in a fresh tab goes straight to code, which ml-trainer does not do; the editor is low friction today and some users bookmark it.
48
48
- The editor's project is chosen when its route loads, not at boot, so the pages render without one.
49
+
- A `#project:` link is removed from the address once it has become a project. One that cannot be read is removed at startup. The home page sends a link on to the editor only while one is waiting to be opened, which it asks the projects session rather than reading from the address.
0 commit comments