@@ -34,6 +34,37 @@ of a bottom bar, side by side, neither before the other — a cut is the honest
3434rendering of that fact. Resist the urge to fill every navigation with movement;
3535declare the relations that exist and let the rest cut.
3636
37+ ## A page opened from anywhere
38+
39+ One shape of page has no pair to write. Its door is in the fixed furniture — a
40+ gear in the top bar, a "+" in the tab bar — so it is opened from every screen of
41+ the app and closed back onto whichever one the reader was on. The relation is
42+ real and it is a single sentence ("the settings come down over the screen you
43+ were on, and go back up"), but there are twenty-five ` from ` pages and not one of
44+ them is the point.
45+
46+ Leave the ` from ` out:
47+
48+ ``` js
49+ defineRouteTransition (null , SETTINGS_PAGE , " cover-top" );
50+ ```
51+
52+ Arriving there plays forward from wherever, leaving plays back to wherever. The
53+ back half is what this exists for: closing such a page is almost always a back —
54+ the close button running ` --navi-nav-back ` , the browser's back button, a swipe —
55+ and a traversal carries no link and therefore no request, so ` routeTransition ` on
56+ the way in has no counterpart on the way out. Written on the destination, the way
57+ out is found the same way the way in was, with nothing to remember per history
58+ entry.
59+
60+ It is tried last, after every written pair, so a pair naming the same destination
61+ still owns its crossing — the map, where it was drawn, is more precise than "from
62+ wherever". And it is not ` defineRouteDefaultTransition ` : a default is about every
63+ navigation nothing was said about, this is about ONE destination whose door
64+ happens to be everywhere. Write it for a page whose door really is furniture; a
65+ page reached from a screen has that screen to be paired with, and the pair says
66+ more.
67+
3768## Choosing a movement
3869
3970- ** ` slide-x ` ** — going INTO something: a list item opened, a card followed, a
@@ -42,10 +73,13 @@ declare the relations that exist and let the rest cut.
4273 taught.
4374- ** ` slide-y ` ** — the same relation on a vertical arrangement, when the layout
4475 genuinely reads as a column.
45- - ** ` cover-x ` / ` cover-y ` ** — a page that INTERRUPTS rather than continues:
46- settings, a composer, anything modal-like that one returns from to find the
47- page beneath unchanged. The covered page holding still is the point — it
48- promises "you are not leaving, this is on top".
76+ - ** ` cover-right ` / ` cover-left ` / ` cover-bottom ` / ` cover-top ` ** — a page that
77+ INTERRUPTS rather than continues: settings, a composer, anything modal-like
78+ that one returns from to find the page beneath unchanged. The covered page
79+ holding still is the point — it promises "you are not leaving, this is on
80+ top". The edge named is the one the page comes IN from, and the one to name is
81+ where its door is: a composer opened from a bottom bar covers from the bottom,
82+ settings pulled down from a top bar cover from the top.
4983- ** ` zoom ` ** — a detail brought closer: a photo, a card expanded into a page.
5084- ** ` cross-fade ` ** — a soft change with no spatial claim. Use it where a cut
5185 feels harsh but no direction would be true.
@@ -284,7 +318,7 @@ const ALERT_CREATE_ROUTE = route("/me/alerts/create");
284318const ALERT_DETAIL_ROUTE = route (" /me/alerts/:alertId" ); // "create" is an alertId
285319
286320defineRouteTransition (ALERTS_ROUTE , ALERT_DETAIL_ROUTE , " slide-x" );
287- defineRouteTransition (ALERTS_ROUTE , ALERT_CREATE_ROUTE , " cover-y " );
321+ defineRouteTransition (ALERTS_ROUTE , ALERT_CREATE_ROUTE , " cover-bottom " );
288322```
289323
290324On ` /me/alerts/create ` both detail and create are current; the page mentioned
0 commit comments