Repository navigation
Commit 1488fa5
committed
refactor(docs-infra): drive the progress bar from the
The progress bar listened to `NavigationStart` on `router.events`, started
a timer to show the bar after `PROGRESS_BAR_DELAY`, and used `switchMap`
to wait for the first `NavigationEnd`/`Cancel`/`Skipped`/`Error` event to
clear the timer and complete the bar.
Replace this with a single `effect` on the router's `currentNavigation`
signal: while a navigation is ongoing the effect schedules the timer, and
its cleanup, which runs when the navigation ends or is superseded, clears
the timer and completes the bar. The effect tracks the navigation id
rather than the navigation object, since `currentNavigation` notifies on
every update of an ongoing navigation and would otherwise restart the
timer mid-navigation.
Replace the disabled spec with specs that keep a navigation pending
through a resolver, covering slow, fast and canceled navigations.currentNavigation signal1 parent 82a4289 commit 1488fa5
2 files changed
Lines changed: 75 additions & 48 deletions
File tree
- adev/src/app/core/layout/progress-bar
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
13 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
22 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
23 | 43 | | |
24 | 44 | | |
25 | 45 | | |
26 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
27 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
28 | 67 | | |
29 | 68 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
35 | 73 | | |
36 | | - | |
37 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
38 | 85 | | |
39 | | - | |
40 | | - | |
| 86 | + | |
41 | 87 | | |
42 | 88 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 10 | + | |
| 11 | + | |
19 | 12 | | |
20 | | - | |
21 | 13 | | |
22 | 14 | | |
23 | 15 | | |
| |||
34 | 26 | | |
35 | 27 | | |
36 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
| |||
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
74 | 54 | | |
75 | 55 | | |
76 | 56 | | |
| 57 | + | |
77 | 58 | | |
78 | 59 | | |
0 commit comments