forge
Clone
https://git.tahinli.com/Tahinli/forge.git
0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 commits
| 1 | //! The history strip: one bar per recent commit, oldest on the left and newest on the right. Each |
| 2 | //! bar is a link to its commit. Heights are log-scaled against the window's largest commit. A |
| 3 | //! commit whose latest CI run failed is red, and the newest commit is live while its run goes. |
| 4 | |
| 5 | use RunState; |
| 6 | use Result; |
| 7 | use Cx; |
| 8 | use ; |
| 9 | |
| 10 | use ; |
| 11 | use crateLang; |
| 12 | use crate; |
| 13 | |
| 14 | /// The shortest bar, as a share of the strip, so a tiny commit still shows. |
| 15 | pub const MIN_BAR_PERCENT: u32 = 6; |
| 16 | |
| 17 | /// One commit on the strip. `ci` is the state of the commit's latest CI run, if it has one. |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | /// A bar's height in percent of the strip. Log-scaled against `max`, the window's largest |
| 25 | /// commit, so one huge commit does not flatten the rest. Never below [`MIN_BAR_PERCENT`]. |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | /// The tone class of a bar, the colour of its commit's latest run as the CI pages draw it: live for |
| 36 | /// the newest commit while its run goes, ok when it passed, bad when it failed, neutral with no run. |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | /// One bar as the view draws it: its classes, link and accessible name. |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | /// The strip for `bars`, given oldest first. Fewer than two commits draw nothing. The label |
| 55 | /// counts the bars drawn. |
| 56 | |
| 57 | pub async |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 |