keystone_ui 0.85.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/components/keystone/ui/timeline_component.html.erb +31 -14
- data/app/components/keystone/ui/timeline_component.rb +92 -8
- data/lib/keystone_ui/version.rb +1 -1
- data/the_local/agents/keystone_ui-develop.md +52 -15
- data/the_local/agents/keystone_ui-info.md +20 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94679872bb456fe1af2afe9da20383d24a17015d610a237ff0459ebc3ed30853
|
|
4
|
+
data.tar.gz: f75346f3b8067fd199f91d0b8e6199d6fb2b0f0044d9a82b2b7df7cfc0231dfd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e66fe72413ad1c5afdc9355fe1da64e877c2d30d9a14f33608e811ad0d788bb3bd580f1a5e6d902e5d30057de247300781fc7aa697b05566d7374c210ca40f3d
|
|
7
|
+
data.tar.gz: 07cbacf662f77376e819bde19ac1da4c09852e48eed8f7568dfd24353e421aa8dd84f748b355e0f56304fd9a7461183cecf70371003a9d232ac9b3d02e8400f2
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
<% if entries.empty? %>
|
|
2
2
|
<%= render Keystone::Ui::EmptyStateComponent.new(title: "No steps") %>
|
|
3
3
|
<% else %>
|
|
4
|
-
<div class="
|
|
4
|
+
<div class="<%= timeline_classes %>" data-timeline>
|
|
5
|
+
<% if one_line %>
|
|
6
|
+
<div class="<%= ONE_LINE_AXIS_CLASSES %>">
|
|
7
|
+
<% marks.each do |mark| %>
|
|
8
|
+
<span class="<%= MARK_CLASSES %>" data-timeline-mark style="<%= mark[:style] %>"><%= mark[:label] %></span>
|
|
9
|
+
<% end %>
|
|
10
|
+
</div>
|
|
11
|
+
<% end %>
|
|
5
12
|
<% rows.each do |row| %>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<div class="<%=
|
|
13
|
+
<% label = content_tag(row_href(row) ? :a : :span, row[:label], class: label_classes, data: { timeline_label: "" }, href: row_href(row)) %>
|
|
14
|
+
<% status = capture do %>
|
|
15
|
+
<span class="<%= status_classes %>">
|
|
16
|
+
<% if running?(row) %><%= render Keystone::Ui::StatusDotComponent.new(state: :info, label: "Running") %><% end %>
|
|
17
|
+
<%= tag.span(duration(row), class: duration_classes(row), data: { timeline_duration: "" }) %>
|
|
18
|
+
</span>
|
|
19
|
+
<% end %>
|
|
20
|
+
<% track = capture do %>
|
|
21
|
+
<div class="<%= track_classes %>">
|
|
15
22
|
<% row[:tries].each do |entry| %>
|
|
16
23
|
<% if entry[:queued_at] %>
|
|
17
24
|
<div class="<%= QUEUED_CLASSES %>" data-timeline-queued style="<%= queued_style(entry) %>"></div>
|
|
@@ -19,11 +26,21 @@
|
|
|
19
26
|
<%= content_tag(bar_tag(entry), class: bar_classes(entry), data: { timeline_bar: "" }, style: bar_style(entry), href: entry[:href]) do %><% if entry[:href] %><span class="<%= SCREEN_READER_CLASSES %>"><%= entry[:label] %></span> <% end %><% if entry[:failed] %><span class="<%= SCREEN_READER_CLASSES %>">Failed</span><% end %><% end %>
|
|
20
27
|
<% end %>
|
|
21
28
|
</div>
|
|
29
|
+
<% end %>
|
|
30
|
+
<%= tag.div(data: { timeline_row: "" }, class: row_classes(row), aria: { current: ("true" if selected?(row)) }) do %>
|
|
31
|
+
<% if one_line %>
|
|
32
|
+
<%= label %><%= track %><%= status %>
|
|
33
|
+
<% else %>
|
|
34
|
+
<div class="<%= ROW_TEXT_CLASSES %>"><%= label %><%= status %></div>
|
|
35
|
+
<%= track %>
|
|
36
|
+
<% end %>
|
|
37
|
+
<% end %>
|
|
38
|
+
<% end %>
|
|
39
|
+
<% unless one_line %>
|
|
40
|
+
<div class="<%= AXIS_CLASSES %>">
|
|
41
|
+
<span data-timeline-axis-start><%= axis_start_label %></span>
|
|
42
|
+
<span data-timeline-axis-end><%= total_duration %></span>
|
|
22
43
|
</div>
|
|
23
44
|
<% end %>
|
|
24
|
-
<div class="<%= AXIS_CLASSES %>">
|
|
25
|
-
<span data-timeline-axis-start><%= axis_start_label %></span>
|
|
26
|
-
<span data-timeline-axis-end><%= total_duration %></span>
|
|
27
|
-
</div>
|
|
28
45
|
</div>
|
|
29
46
|
<% end %>
|
|
@@ -6,19 +6,43 @@ module Keystone
|
|
|
6
6
|
TRACK_CLASSES = "ks-timeline-track relative w-full h-2 overflow-hidden"
|
|
7
7
|
BAR_CLASSES = "ks-timeline-bar absolute inset-y-0"
|
|
8
8
|
FAILED_CLASSES = "ks-timeline-failed"
|
|
9
|
+
WAITING_CLASSES = "ks-tone-warning"
|
|
9
10
|
QUEUED_CLASSES = "ks-timeline-queued absolute inset-y-0"
|
|
10
11
|
SCREEN_READER_CLASSES = "sr-only"
|
|
11
12
|
SELECTED_ROW_CLASSES = "ks-table-row-current"
|
|
13
|
+
TIMELINE_CLASSES = "flex flex-col ks-grid-gap-sm"
|
|
14
|
+
ONE_LINE_TIMELINE_CLASSES = "sm:grid sm:grid-cols-[fit-content(40%)_1fr_auto]"
|
|
15
|
+
ONE_LINE_ROW_CLASSES = "grid grid-cols-[1fr_auto] items-center ks-grid-gap-x-sm text-sm sm:col-span-3 sm:grid-cols-subgrid"
|
|
16
|
+
ONE_LINE_LABEL_CLASSES = "ks-meter-label min-w-0 truncate sm:mb-0"
|
|
17
|
+
ONE_LINE_TRACK_CLASSES = "col-span-2 row-start-2 sm:col-span-1 sm:col-start-2 sm:row-start-1"
|
|
18
|
+
ONE_LINE_STATUS_CLASSES = "ks-meter-label justify-self-end sm:mb-0"
|
|
12
19
|
ROW_TEXT_CLASSES = "ks-meter-label flex justify-between text-sm"
|
|
13
20
|
AXIS_CLASSES = "ks-meter-label flex justify-between text-xs"
|
|
14
21
|
ROW_STATUS_CLASSES = "flex items-center ks-grid-gap-sm"
|
|
22
|
+
ONE_LINE_AXIS_CLASSES = "ks-meter-label relative h-4 text-xs sm:col-start-2"
|
|
23
|
+
MARK_CLASSES = "absolute top-0 whitespace-nowrap"
|
|
15
24
|
MINIMUM_BAR_PERCENT = 2
|
|
25
|
+
MARK_STEPS = [ 1, 2, 5, 10, 15, 30, 60, 120, 300, 600, 900, 1800, 3600, 7200, 10_800, 21_600, 43_200, 86_400 ].freeze
|
|
26
|
+
MAXIMUM_MARK_INTERVALS = 6
|
|
16
27
|
|
|
17
|
-
attr_reader :entries
|
|
28
|
+
attr_reader :entries, :one_line
|
|
18
29
|
|
|
19
|
-
def initialize(entries:)
|
|
30
|
+
def initialize(entries:, one_line: false)
|
|
20
31
|
entries.each { |entry| check_times(entry) }
|
|
21
32
|
@entries = entries
|
|
33
|
+
@one_line = one_line
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def track_classes
|
|
37
|
+
[ TRACK_CLASSES, (ONE_LINE_TRACK_CLASSES if one_line) ].compact.join(" ")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def label_classes
|
|
41
|
+
ONE_LINE_LABEL_CLASSES if one_line
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def status_classes
|
|
45
|
+
[ ROW_STATUS_CLASSES, (ONE_LINE_STATUS_CLASSES if one_line) ].compact.join(" ")
|
|
22
46
|
end
|
|
23
47
|
|
|
24
48
|
def bar_style(entry)
|
|
@@ -37,8 +61,16 @@ module Keystone
|
|
|
37
61
|
row[:tries].any? { |entry| entry[:selected] }
|
|
38
62
|
end
|
|
39
63
|
|
|
64
|
+
def timeline_classes
|
|
65
|
+
[ TIMELINE_CLASSES, (ONE_LINE_TIMELINE_CLASSES if one_line) ].compact.join(" ")
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def row_classes(row)
|
|
69
|
+
[ (ONE_LINE_ROW_CLASSES if one_line), (SELECTED_ROW_CLASSES if selected?(row)) ].compact.join(" ").presence
|
|
70
|
+
end
|
|
71
|
+
|
|
40
72
|
def running?(row)
|
|
41
|
-
row[:tries].any? { |entry| entry[:ended_at].nil? }
|
|
73
|
+
!waiting?(row) && row[:tries].any? { |entry| entry[:ended_at].nil? }
|
|
42
74
|
end
|
|
43
75
|
|
|
44
76
|
def queued_style(entry)
|
|
@@ -46,6 +78,8 @@ module Keystone
|
|
|
46
78
|
end
|
|
47
79
|
|
|
48
80
|
def bar_classes(entry)
|
|
81
|
+
return QUEUED_CLASSES if entry[:waiting]
|
|
82
|
+
|
|
49
83
|
[ BAR_CLASSES, (FAILED_CLASSES if entry[:failed]) ].compact.join(" ")
|
|
50
84
|
end
|
|
51
85
|
|
|
@@ -53,33 +87,82 @@ module Keystone
|
|
|
53
87
|
entry[:href] ? :a : :div
|
|
54
88
|
end
|
|
55
89
|
|
|
90
|
+
def waiting?(row)
|
|
91
|
+
row[:tries].any? { |entry| entry[:waiting] }
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def duration_classes(row)
|
|
95
|
+
WAITING_CLASSES if waiting?(row)
|
|
96
|
+
end
|
|
97
|
+
|
|
56
98
|
def duration(row)
|
|
57
|
-
|
|
99
|
+
return "waiting" if waiting?(row)
|
|
100
|
+
|
|
101
|
+
[ written_duration(row[:tries].sum { |entry| ended_at(entry) - entry[:started_at] }), attempts(row) ].compact.join(" · ")
|
|
58
102
|
end
|
|
59
103
|
|
|
60
104
|
def total_duration
|
|
61
105
|
written_duration(axis_end - axis_start)
|
|
62
106
|
end
|
|
63
107
|
|
|
108
|
+
def marks
|
|
109
|
+
(0..mark_intervals).map { |index| { label: written_mark(index * mark_step), style: mark_style(index) } }
|
|
110
|
+
end
|
|
111
|
+
|
|
64
112
|
def axis_start_label
|
|
65
|
-
|
|
113
|
+
written_mark(0)
|
|
66
114
|
end
|
|
67
115
|
|
|
68
116
|
private
|
|
69
117
|
|
|
118
|
+
def attempts(row)
|
|
119
|
+
"#{row[:tries].size} att." if row[:tries].size > 1
|
|
120
|
+
end
|
|
121
|
+
|
|
70
122
|
def check_times(entry)
|
|
71
123
|
raise ArgumentError, "Timeline entry #{entry[:label].inspect} has no started_at" unless entry[:started_at]
|
|
72
124
|
raise ArgumentError, "Timeline entry #{entry[:label].inspect} ends before it starts" if entry[:ended_at] && entry[:ended_at] < entry[:started_at]
|
|
73
125
|
end
|
|
74
126
|
|
|
75
127
|
def written_duration(seconds)
|
|
128
|
+
return format("%.1fs", seconds.round(1)) if seconds.round(1) < 10
|
|
129
|
+
|
|
76
130
|
hours, rest = seconds.round.divmod(3600)
|
|
77
131
|
minutes, seconds = rest.divmod(60)
|
|
78
132
|
parts = [ [ hours, "h" ], [ minutes, "m" ], [ seconds, "s" ] ].drop_while { |amount, _| amount.zero? }
|
|
79
|
-
parts = [ [ 0, "s" ] ] if parts.empty?
|
|
80
133
|
parts.map { |amount, unit| "#{amount}#{unit}" }.join(" ")
|
|
81
134
|
end
|
|
82
135
|
|
|
136
|
+
def written_mark(seconds)
|
|
137
|
+
hours, rest = seconds.divmod(3600)
|
|
138
|
+
minutes, seconds = rest.divmod(60)
|
|
139
|
+
parts = [ [ hours, "h" ], [ minutes, "m" ], [ seconds, "s" ] ].reject { |amount, _| amount.zero? }
|
|
140
|
+
parts.empty? ? "0s" : parts.map { |amount, unit| "#{amount}#{unit}" }.join(" ")
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def mark_style(index)
|
|
144
|
+
return "left: 0%" if index.zero?
|
|
145
|
+
return "right: 0%" if index == mark_intervals
|
|
146
|
+
|
|
147
|
+
"left: #{percent(index * mark_step)}%; transform: translateX(-50%)"
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def mark_step
|
|
151
|
+
@mark_step ||= MARK_STEPS.find { |step| span <= step * MAXIMUM_MARK_INTERVALS } || (span / (MARK_STEPS.last * MAXIMUM_MARK_INTERVALS)).ceil * MARK_STEPS.last
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def mark_intervals
|
|
155
|
+
[ (span / mark_step).ceil, 1 ].max
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def scale
|
|
159
|
+
one_line ? mark_intervals * mark_step : span
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def span
|
|
163
|
+
axis_end - axis_start
|
|
164
|
+
end
|
|
165
|
+
|
|
83
166
|
def axis_start
|
|
84
167
|
@axis_start ||= entries.map { |entry| entry[:queued_at] || entry[:started_at] }.min
|
|
85
168
|
end
|
|
@@ -89,6 +172,8 @@ module Keystone
|
|
|
89
172
|
end
|
|
90
173
|
|
|
91
174
|
def ended_at(entry)
|
|
175
|
+
return axis_start + scale if entry[:waiting]
|
|
176
|
+
|
|
92
177
|
entry[:ended_at] || axis_end
|
|
93
178
|
end
|
|
94
179
|
|
|
@@ -101,8 +186,7 @@ module Keystone
|
|
|
101
186
|
end
|
|
102
187
|
|
|
103
188
|
def share(seconds)
|
|
104
|
-
|
|
105
|
-
span.zero? ? 0 : (seconds / span * 100).round(2)
|
|
189
|
+
scale.zero? ? 0 : (seconds.fdiv(scale) * 100).round(2)
|
|
106
190
|
end
|
|
107
191
|
end
|
|
108
192
|
end
|
data/lib/keystone_ui/version.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: keystone_ui-develop
|
|
3
|
-
description: Use PROACTIVELY for building or editing screens in a Rails app that has keystone_ui — page shells with Back links and breadcrumbs, forms and fields, a search field that picks a record or enters a new one, data tables with saved columns, desktop navigation, sidebars and bottom tabs, a page's main action as a phone top-bar icon or a button fixed to the bottom of the screen, a question asked before a button or main action goes ahead, action menus for a record's Edit and Delete, dashboards with stat cards, charts, funnels, goal buckets and timelines of timed steps with retries, queued time, failed tries, steps still running, links to each try and the current step marked, amounts shown in green or red as a gain or loss, status dots coloured by state, pictures held to half the screen, two versions of a text compared line by line side by side, info buttons and breakdowns, marketing sections, a light/dark theme switch — MUST BE USED instead of hand-writing ERB and Tailwind for UI.
|
|
3
|
+
description: Use PROACTIVELY for building or editing screens in a Rails app that has keystone_ui — page shells with Back links and breadcrumbs, forms and fields, a search field that picks a record or enters a new one, data tables with saved columns, desktop navigation, sidebars and bottom tabs, a page's main action as a phone top-bar icon or a button fixed to the bottom of the screen, a question asked before a button or main action goes ahead, action menus for a record's Edit and Delete, dashboards with stat cards, charts, funnels, goal buckets and timelines of timed steps, drawn one line per step with a marked time axis if wanted, with retries and their count, queued time, failed tries, steps still running, steps waiting on approval, links to each try and the current step marked, amounts shown in green or red as a gain or loss, status dots coloured by state, pictures held to half the screen, two versions of a text compared line by line side by side, info buttons and breakdowns, marketing sections, a light/dark theme switch — MUST BE USED instead of hand-writing ERB and Tailwind for UI.
|
|
4
4
|
tools: Bash, Read, Write, Edit, Grep
|
|
5
5
|
scope: UI — pages, forms, tables, navigation, dashboards
|
|
6
6
|
---
|
|
@@ -98,7 +98,7 @@ not available in the app yet, that is `keystone_ui-install`'s job.
|
|
|
98
98
|
- `ui_funnel` — a conversion funnel drawn as bars or one joined shape.
|
|
99
99
|
- `ui_bucket` — an upright container filled toward a goal.
|
|
100
100
|
- `ui_bucket_series` — a wrapping row of buckets.
|
|
101
|
-
- `ui_timeline` — rows of timed steps on one shared time axis, each try of a step a bar on its row, with optional queued time, failed tries
|
|
101
|
+
- `ui_timeline` — rows of timed steps on one shared time axis, each try of a step a bar on its row, optionally one line per row with a marked axis, each row's summed try time and number of tries, with optional queued time, failed tries, tries still running and tries waiting marked, bars and row labels that open an address, the current row marked, and a "No steps" message when there are no entries.
|
|
102
102
|
- `ui_pipeline` — a staged flow diagram with buttons and breakable links that post to the app.
|
|
103
103
|
- `ui_hero` — a marketing hero with title, call-to-action buttons and an aside.
|
|
104
104
|
- `ui_cta_banner` — a marketing banner holding call-to-action buttons.
|
|
@@ -765,9 +765,10 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
765
765
|
the fill turns green with `over: :success` or amber with `over: :warning`.
|
|
766
766
|
- `ui_bucket_series(buckets:)` takes an array of hashes with the keywords
|
|
767
767
|
of `ui_bucket`, such as `[{ goal: 10, actual: 7, label: "Mon" }, ...]`.
|
|
768
|
-
- `ui_timeline(entries:)` takes no block. `entries:` is
|
|
769
|
-
`[{ label:, started_at:, ended_at: nil, queued_at: nil, failed: false, href: nil, selected: false }, ...]`,
|
|
770
|
-
with every time a `Time` value.
|
|
768
|
+
- `ui_timeline(entries:, one_line: false)` takes no block. `entries:` is
|
|
769
|
+
`[{ label:, started_at:, ended_at: nil, queued_at: nil, failed: false, waiting: false, href: nil, selected: false }, ...]`,
|
|
770
|
+
with every time a `Time` value. `one_line:` picks the layout, described
|
|
771
|
+
below.
|
|
771
772
|
- It draws one row per label, in the order each label first appears.
|
|
772
773
|
Entries that share a label, such as the tries of one step, share that
|
|
773
774
|
row and each draws its own bar, so pass a step's tries one after another
|
|
@@ -777,9 +778,11 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
777
778
|
`started_at` of any entry to the latest `ended_at`, or to the latest
|
|
778
779
|
`started_at` when that is later.
|
|
779
780
|
- An entry with no `ended_at:`, or `ended_at: nil`, is a try still
|
|
780
|
-
running. Its bar runs to the
|
|
781
|
+
running. Its bar runs to the latest `ended_at` or `started_at` of any
|
|
782
|
+
entry, and its row shows an
|
|
781
783
|
`:info` status dot beside its duration that screen readers read as
|
|
782
|
-
"Running". Leave `ended_at:` out only for a
|
|
784
|
+
"Running", unless the row is waiting. Leave `ended_at:` out only for a
|
|
785
|
+
try that has not finished.
|
|
783
786
|
- Every bar is drawn at least 2% of the track wide, so a try that took no
|
|
784
787
|
time still shows. When every entry starts and ends at one moment, every
|
|
785
788
|
bar is drawn at that width at the left edge of the track.
|
|
@@ -789,6 +792,17 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
789
792
|
- An entry given `failed: true` draws its bar in the danger colour, and
|
|
790
793
|
screen readers read it as "Failed". Ask the developer which tries count
|
|
791
794
|
as failed and whether the queued time is shown.
|
|
795
|
+
- An entry given `waiting: true` is a try paused before it can go on, such
|
|
796
|
+
as a step waiting for approval. Its bar runs from its `started_at` to the
|
|
797
|
+
end of the axis, which on a one-line timeline is its last mark, in the
|
|
798
|
+
queued colour, in place of the danger colour even
|
|
799
|
+
when it is also `failed: true`. Its row writes `waiting` in the warning
|
|
800
|
+
tone in place of the duration, and shows no "Running" dot. A row holding
|
|
801
|
+
any waiting entry is a waiting row.
|
|
802
|
+
- The timeline reads no clock, so a waiting entry's `ended_at:` only moves
|
|
803
|
+
the end of the axis. Pass `ended_at: Time.current` on it so the axis, and
|
|
804
|
+
its bar, reach the present. Ask the developer which states of a step
|
|
805
|
+
count as waiting.
|
|
792
806
|
- An entry given `href:` draws its bar as a link to that address, read out
|
|
793
807
|
by screen readers as the entry's label. A row's label links to the
|
|
794
808
|
`href:` of the row's last entry that has one, and with none it is plain
|
|
@@ -799,13 +813,36 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
799
813
|
screen readers announce it as the current item. Pass it on the entry the
|
|
800
814
|
page is showing, such as the try whose detail page holds the timeline,
|
|
801
815
|
and on one entry at most.
|
|
802
|
-
- Each row shows its label
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
still running
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
816
|
+
- Each row shows its label, its duration and its track. The row's duration
|
|
817
|
+
is the time from `started_at` to `ended_at` of each of its entries added
|
|
818
|
+
together, so queued time and the gaps between tries are not counted, and
|
|
819
|
+
a try still running counts up to the latest `ended_at` or `started_at` of
|
|
820
|
+
any entry. A duration under ten seconds is written with one decimal,
|
|
821
|
+
such as `8.2s`, and a zero duration is `0.0s`. A longer one is written in
|
|
822
|
+
whole hours, minutes and seconds, such as `1h 0m 5s` or `41s`, leaving
|
|
823
|
+
out leading zero units.
|
|
824
|
+
- A row holding more than one entry adds its number of tries after the
|
|
825
|
+
duration, such as `41s · 2 att.`. The wording is fixed.
|
|
826
|
+
- With the default `one_line: false`, each row shows its label and its
|
|
827
|
+
duration on one line with its track below them, at every width. Under
|
|
828
|
+
the rows the axis reads `0s` on the left and the whole span on the right,
|
|
829
|
+
written as a row's duration is, and the bars fill the track from the start of the axis to its end.
|
|
830
|
+
- With `one_line: true`, from `sm:` up each row is one line: its label,
|
|
831
|
+
then its track, then its duration. The label column is as wide as the
|
|
832
|
+
longest label up to 40% of the timeline, a longer label is cut off with
|
|
833
|
+
an ellipsis, and every row's track has the same width and lines up with
|
|
834
|
+
the others. Below `sm:` each row shows its label and duration on one
|
|
835
|
+
line with its track on a second line across the full width.
|
|
836
|
+
- Above a one-line timeline's first row, in the track column, the axis
|
|
837
|
+
shows marks at even
|
|
838
|
+
intervals from `0s`, at the smallest of 1, 2, 5, 10, 15 or 30 seconds,
|
|
839
|
+
1, 2, 5, 10, 15 or 30 minutes, or 1, 2, 3, 6, 12 or 24 hours that covers
|
|
840
|
+
the whole span in six intervals or fewer, and at whole days past six
|
|
841
|
+
days. The axis ends at the first mark at or after the span, so the
|
|
842
|
+
longest bar can stop short of the right edge, and every bar and mark is
|
|
843
|
+
placed on that axis. A mark is written with each non-zero unit, such as
|
|
844
|
+
`1m 30s` or `1h 5s`.
|
|
845
|
+
- Ask the developer which layout a screen uses.
|
|
809
846
|
- An entry with no `started_at:` raises `ArgumentError` naming its label,
|
|
810
847
|
and so does an entry whose `ended_at:` is before its `started_at:`. Check
|
|
811
848
|
the times before rendering rather than rescuing the error.
|
|
@@ -881,7 +918,7 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
881
918
|
others show through, a Columns menu with no greyed name for a hidden
|
|
882
919
|
column, a table row whose caret does not open its detail, a text diff whose
|
|
883
920
|
removed and added rows look like its shared rows, a timeline whose failed
|
|
884
|
-
tries
|
|
921
|
+
tries, queued time or waiting tries look like its other bars, or a status dot
|
|
885
922
|
that draws nothing — the app's Stimulus controllers or keystone_ui-styles version are
|
|
886
923
|
out of date. Stop and hand that part to `keystone_ui-install`, and add no
|
|
887
924
|
classes to fix it.
|
|
@@ -68,16 +68,31 @@ One decision: is keystone_ui set up in the app?
|
|
|
68
68
|
- **Timelines.** A timeline entry is one try at a step: a label, a start time,
|
|
69
69
|
an end time, and optionally the time it was queued and whether it failed.
|
|
70
70
|
Entries sharing a label are drawn as several bars on one row, in the order
|
|
71
|
-
given
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
given. The row's duration is the time of each try added together, so the
|
|
72
|
+
gaps between tries are not counted, and a row with more than one try adds the
|
|
73
|
+
number of tries after it, such as `· 3 att.`. A duration under ten seconds is
|
|
74
|
+
written with one decimal, such as `8.2s`, and a longer one in whole hours,
|
|
75
|
+
minutes and seconds, such as `1m 5s`. Queued time is drawn as its own
|
|
76
|
+
segment before the bar, and a failed try is marked failed both in colour and
|
|
77
|
+
for screen readers. An entry can be marked waiting, for a try that has not
|
|
78
|
+
started running: its bar runs from its start to the end of the axis in the
|
|
79
|
+
queued colour, and its row shows the word `waiting` in the warning tone in
|
|
80
|
+
place of a duration, with no running dot. The axis
|
|
74
81
|
runs from the earliest queued or start time of any entry to the latest end
|
|
75
82
|
or start time. An entry with no end time is still running: its bar runs to
|
|
76
|
-
the end of
|
|
83
|
+
the latest end or start time of any entry, and its row shows a status dot that screen readers read
|
|
77
84
|
as "Running". Every bar is drawn at least a small visible width, so a try
|
|
78
85
|
that took no time still shows. An entry with no start time, or one that ends
|
|
79
86
|
before it starts, raises `ArgumentError` naming its label. A timeline with no
|
|
80
|
-
entries shows a message saying there are no steps.
|
|
87
|
+
entries shows a message saying there are no steps. By default each row shows
|
|
88
|
+
its label and duration on one line with the bar below, and the axis under the
|
|
89
|
+
rows shows only `0s` and the total duration. A timeline can be drawn one line
|
|
90
|
+
per row instead: from `sm:` up each row holds its label, its bar and its
|
|
91
|
+
duration side by side, every row's bar has the same width, and a long label is
|
|
92
|
+
cut off with an ellipsis. Below `sm:` the bar moves under the label and
|
|
93
|
+
duration. In that layout the axis, drawn above the first row, shows marks at the smallest round time step
|
|
94
|
+
that covers the run in six intervals or fewer, and the axis ends at the last mark rather than at the latest
|
|
95
|
+
time, so bars are placed against that longer axis. An entry can carry an address, and then its bar is a link to it whose
|
|
81
96
|
name screen readers announce is the entry's label, and the row's label links
|
|
82
97
|
to the address of the last entry in that row that has one. An entry can be
|
|
83
98
|
marked selected, and the row holding it is drawn in the same tint as a data
|