completion-kit 0.28.7 → 0.28.8

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/completion_kit/application.css +30 -7
  3. data/app/views/completion_kit/datasets/edit.html.erb +1 -0
  4. data/app/views/completion_kit/datasets/index.html.erb +1 -0
  5. data/app/views/completion_kit/datasets/new.html.erb +1 -0
  6. data/app/views/completion_kit/datasets/show.html.erb +2 -1
  7. data/app/views/completion_kit/metric_groups/_form.html.erb +5 -9
  8. data/app/views/completion_kit/metric_groups/edit.html.erb +1 -0
  9. data/app/views/completion_kit/metric_groups/index.html.erb +1 -0
  10. data/app/views/completion_kit/metric_groups/new.html.erb +1 -0
  11. data/app/views/completion_kit/metrics/_form.html.erb +1 -1
  12. data/app/views/completion_kit/metrics/edit.html.erb +1 -0
  13. data/app/views/completion_kit/metrics/index.html.erb +1 -0
  14. data/app/views/completion_kit/metrics/new.html.erb +1 -0
  15. data/app/views/completion_kit/metrics/show.html.erb +3 -2
  16. data/app/views/completion_kit/prompts/edit.html.erb +1 -0
  17. data/app/views/completion_kit/prompts/index.html.erb +1 -0
  18. data/app/views/completion_kit/prompts/new.html.erb +1 -0
  19. data/app/views/completion_kit/prompts/show.html.erb +8 -7
  20. data/app/views/completion_kit/provider_credentials/edit.html.erb +1 -0
  21. data/app/views/completion_kit/provider_credentials/index.html.erb +1 -0
  22. data/app/views/completion_kit/provider_credentials/new.html.erb +1 -0
  23. data/app/views/completion_kit/runs/_form.html.erb +2 -2
  24. data/app/views/completion_kit/runs/_response_row.html.erb +5 -5
  25. data/app/views/completion_kit/runs/_row.html.erb +5 -4
  26. data/app/views/completion_kit/runs/compare.html.erb +2 -1
  27. data/app/views/completion_kit/runs/compare_picker.html.erb +1 -0
  28. data/app/views/completion_kit/runs/edit.html.erb +1 -0
  29. data/app/views/completion_kit/runs/index.html.erb +1 -0
  30. data/app/views/completion_kit/runs/new.html.erb +1 -0
  31. data/app/views/completion_kit/runs/show.html.erb +9 -8
  32. data/app/views/completion_kit/tags/_form.html.erb +4 -6
  33. data/app/views/completion_kit/tags/edit.html.erb +1 -0
  34. data/app/views/completion_kit/tags/index.html.erb +1 -0
  35. data/app/views/completion_kit/tags/new.html.erb +1 -0
  36. data/app/views/layouts/completion_kit/application.html.erb +1 -1
  37. data/lib/completion_kit/version.rb +1 -1
  38. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15a1909a7793a8a6cb9e0d95eb333483823c0040dd902b40a4a50e3ced485bee
4
- data.tar.gz: fc407f0abd09a7505d56a96d4adcad8f9aedfa7ec6aaa4de928fb71fb8a9859c
3
+ metadata.gz: f5ebc05340fbd19412b2d7ceae93492c353dbd72400d420532a2894c2dd0c89c
4
+ data.tar.gz: 5a7ebe39faee5c5cb2419825ac285fae5cd67ec7c7f3f1618629ccf5f9fa5d01
5
5
  SHA512:
6
- metadata.gz: 16242a62b2e34fc8667093e88cb77cba25fcdaab65c4603cfd693fbe3dcce71ac34a76a501ffb1725a8d868ee78107775984d42135d9b98ca846f48712416634
7
- data.tar.gz: a3b5ba5d4eda948f3c2e2d0c5f75262793e3ddf439aac7e4a33c782df93dd0a4944e1b2b8655836fb4df25ae0f4e1e6a70ccb3b795a53d78951cac30456256dd
6
+ metadata.gz: d7a6a084c52769258fa3f170e0c2cd1bb793e4885e922dea83011a45425b4bb41a49351a47832733db8e5d0200f5a213ee33ddf953deef3c5346c143112c62ca
7
+ data.tar.gz: f7a1030d709b0434214ca24cc5f8215167ea8790f539365e869568850c35aa1758e8095c83b3d177fc9303b4fa78058beb5b4dfd4cf1cf53c8750debf3323bd0
@@ -352,7 +352,9 @@ form.button_to {
352
352
  }
353
353
 
354
354
  .ck-link {
355
- text-decoration: none;
355
+ text-decoration: underline;
356
+ text-decoration-color: color-mix(in srgb, var(--ck-text) 40%, transparent);
357
+ text-underline-offset: 0.15em;
356
358
  color: var(--ck-text);
357
359
  transition: color 0.15s;
358
360
  }
@@ -664,7 +666,7 @@ form.button_to {
664
666
 
665
667
  .ck-chip {
666
668
  background: var(--ck-surface-soft);
667
- border: 1px solid var(--ck-line);
669
+ border: 1px solid var(--ck-line-strong);
668
670
  color: var(--ck-muted);
669
671
  }
670
672
 
@@ -743,7 +745,7 @@ tr:hover .ck-chip--publish {
743
745
 
744
746
  .ck-badge--pending {
745
747
  background: var(--ck-surface-soft);
746
- border: 1px solid var(--ck-line);
748
+ border: 1px solid var(--ck-line-strong);
747
749
  color: var(--ck-dim);
748
750
  }
749
751
 
@@ -4309,7 +4311,8 @@ table.ck-runs-table {
4309
4311
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
4310
4312
  }
4311
4313
 
4312
- .ck-response-row--expanded .ck-response-cell__preview {
4314
+ .ck-response-row--expanded .ck-response-cell__preview,
4315
+ .ck-responses-table tbody tr:focus-within .ck-response-cell__preview {
4313
4316
  -webkit-line-clamp: 12;
4314
4317
  line-clamp: 12;
4315
4318
  max-height: 22em;
@@ -4936,7 +4939,7 @@ a.tag:hover, label.tag:hover { filter: brightness(1.12); }
4936
4939
  text-transform: lowercase;
4937
4940
  white-space: nowrap;
4938
4941
  background: color-mix(in srgb, var(--mark-color) 38%, transparent);
4939
- color: color-mix(in srgb, var(--mark-color) 88%, var(--ck-text));
4942
+ color: color-mix(in srgb, var(--mark-color) 35%, white);
4940
4943
  }
4941
4944
 
4942
4945
  .tag-mark::before {
@@ -4995,8 +4998,8 @@ a.tag:hover, label.tag:hover { filter: brightness(1.12); }
4995
4998
  .ck-tag-filter .tag-mark:not(.tag-mark--off),
4996
4999
  .ck-metric-tag-filter .tag-mark:not(.tag-mark--off) {
4997
5000
  background: color-mix(in srgb, var(--mark-color) 38%, transparent);
4998
- color: color-mix(in srgb, var(--mark-color) 95%, var(--ck-text));
4999
- border-color: color-mix(in srgb, var(--mark-color) 50%, transparent);
5001
+ color: color-mix(in srgb, var(--mark-color) 42%, white);
5002
+ border-color: color-mix(in srgb, var(--mark-color) 70%, transparent);
5000
5003
  }
5001
5004
 
5002
5005
  /* Unselected state — same shape, neutral outline + muted text */
@@ -6487,3 +6490,23 @@ a.tag-mark {
6487
6490
  color: var(--ck-muted);
6488
6491
  margin-right: 0.2rem;
6489
6492
  }
6493
+
6494
+ .ck-slider:focus-visible {
6495
+ outline: 2px solid var(--ck-accent);
6496
+ outline-offset: 4px;
6497
+ }
6498
+ .ck-select__option:focus-visible {
6499
+ box-shadow: inset 0 0 0 2px var(--ck-accent);
6500
+ }
6501
+ .ck-disclosure-toggle:focus-visible {
6502
+ outline: 2px solid var(--ck-accent);
6503
+ outline-offset: 2px;
6504
+ }
6505
+ .ck-settings-menu__trigger:focus-visible {
6506
+ outline: 2px solid var(--ck-accent);
6507
+ outline-offset: 2px;
6508
+ }
6509
+ .ck-tag-picker__input:focus-visible {
6510
+ outline: 2px solid var(--ck-accent);
6511
+ outline-offset: 2px;
6512
+ }
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Edit dataset" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Datasets", datasets_path %></li>
3
4
  <li><%= link_to @dataset.name, dataset_path(@dataset) %></li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Datasets" %>
1
2
  <section class="ck-page-header">
2
3
  <div>
3
4
  <h1 class="ck-title">Datasets</h1>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "New dataset" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Datasets", datasets_path %></li>
3
4
  <li>New</li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, @dataset.name %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Datasets", datasets_path %></li>
3
4
  <li><%= @dataset.name %></li>
@@ -55,7 +56,7 @@
55
56
  <tr>
56
57
  <td class="ck-csv-table__rownum"><%= idx + 1 %></td>
57
58
  <% headers.each_with_index do |_, i| %>
58
- <td><span class="ck-csv-cell"><%= row[i] %></span></td>
59
+ <td><span class="ck-csv-cell" title="<%= row[i] %>"><%= row[i] %></span></td>
59
60
  <% end %>
60
61
  </tr>
61
62
  <% end %>
@@ -6,19 +6,15 @@
6
6
  "Delete \"#{metric_group.name}\"? Removes this grouping. #{pluralize(members_n, 'member metric')} #{members_n == 1 ? 'is' : 'are'} kept." %>
7
7
  <% end %>
8
8
  <%= form_with(model: metric_group, url: metric_group.persisted? ? metric_group_path(metric_group) : metric_groups_path, local: true) do |form| %>
9
- <% name_error = metric_group.errors[:name].first %>
10
-
11
9
  <div class="ck-card ck-form-card">
12
10
  <div class="ck-field">
13
11
  <%= form.label :name, "Metric group name", class: "ck-label" %>
14
12
  <%= form.text_field :name,
15
- class: ["ck-input", ("ck-input--error" if name_error)].compact.join(" "),
13
+ class: ["ck-input", ("ck-input--error" if metric_group.errors[:name].any?)].compact.join(" "),
16
14
  placeholder: "Support quality",
17
15
  autofocus: !metric_group.persisted?,
18
- "aria-invalid": name_error ? "true" : nil %>
19
- <% if name_error %>
20
- <p class="ck-field-error" role="alert"><%= name_error %></p>
21
- <% end %>
16
+ **ck_field_aria(form, :name) %>
17
+ <%= ck_field_error(form, :name) %>
22
18
  </div>
23
19
 
24
20
  <div class="ck-field">
@@ -29,7 +25,7 @@
29
25
  <%= render "completion_kit/tags/picker", record: metric_group, param_namespace: :metric_group %>
30
26
 
31
27
  <div class="ck-field">
32
- <p class="ck-label">Metrics in this group</p>
28
+ <p class="ck-label" id="mg_metrics_label">Metrics in this group</p>
33
29
  <p class="ck-hint">Pick the metrics to include. Filter the list by tag to narrow it down.</p>
34
30
 
35
31
  <% available_filter_tags = @metrics.flat_map(&:tags).uniq.sort_by(&:name) %>
@@ -46,7 +42,7 @@
46
42
  </div>
47
43
  <% end %>
48
44
 
49
- <div class="ck-metric-checkboxes" data-metric-checkboxes>
45
+ <div class="ck-metric-checkboxes" data-metric-checkboxes role="group" aria-labelledby="mg_metrics_label">
50
46
  <% @metrics.each do |metric| %>
51
47
  <label class="ck-checkbox-label" data-metric-tags="<%= metric.tag_names.join(",") %>">
52
48
  <%= check_box_tag "metric_group[metric_ids][]", metric.id, metric_group.metrics.exists?(metric.id), class: "ck-checkbox", id: "metric_group_metric_#{metric.id}" %>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Edit metric group" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Metrics", metrics_path %></li>
3
4
  <li><%= link_to @metric_group.name, metric_group_path(@metric_group) %></li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Metric groups" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Metrics", metrics_path %></li>
3
4
  <li>Metric groups</li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "New metric group" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Metrics", metrics_path %></li>
3
4
  <li>New metric group</li>
@@ -138,7 +138,7 @@
138
138
  <input type="hidden" name="metric[rubric_bands][<%= index %>][stars]" value="<%= band["stars"] %>">
139
139
  </div>
140
140
  <div class="ck-rubric-row__fields">
141
- <textarea name="<%= target_name %>" rows="2" class="ck-input ck-input--area"><%= band["description"] %></textarea>
141
+ <textarea name="<%= target_name %>" rows="2" class="ck-input ck-input--area" aria-label="Rubric description for the <%= band["stars"] %>-star rating"><%= band["description"] %></textarea>
142
142
  <% if band_changed %>
143
143
  <div class="ck-inline-suggestion ck-inline-suggestion--band">
144
144
  <div class="ck-inline-suggestion__head">
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Edit metric" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Metrics", metrics_path %></li>
3
4
  <li><%= link_to @metric.name, metric_path(@metric) %></li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Metrics" %>
1
2
  <section class="ck-page-header">
2
3
  <div>
3
4
  <h1 class="ck-title">Metrics</h1>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "New metric" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Metrics", metrics_path %></li>
3
4
  <li>New</li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, @metric.name %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Metrics", metrics_path %></li>
3
4
  <li><%= @metric.name %></li>
@@ -125,11 +126,11 @@
125
126
  <% pred = predecessor_of[v] %>
126
127
  <% next unless v.change_summary_against(pred) %>
127
128
  <% vs = v.validation_summary %>
128
- <dialog id="ck-mvdiff-<%= v.id %>" class="ck-modal" onclick="if(event.target===this)this.close()">
129
+ <dialog id="ck-mvdiff-<%= v.id %>" class="ck-modal" aria-labelledby="ck-mvdiff-title-<%= v.id %>" onclick="if(event.target===this)this.close()">
129
130
  <article class="ck-modal__panel" tabindex="-1" onclick="event.stopPropagation()">
130
131
  <header class="ck-modal__header">
131
132
  <div class="ck-modal__heading">
132
- <h2 class="ck-modal__title"><%= pred.version_label %> &rarr; <%= v.version_label %></h2>
133
+ <h2 class="ck-modal__title" id="ck-mvdiff-title-<%= v.id %>"><%= pred.version_label %> &rarr; <%= v.version_label %></h2>
133
134
  <span class="ck-modal__meta">What changed in <%= v.version_label %><% if v.current? %> (live)<% elsif v.draft? %> (draft)<% end %></span>
134
135
  </div>
135
136
  <button type="button" class="ck-modal__close" aria-label="Close" onclick="this.closest('dialog').close()">&times;</button>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Edit prompt" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Prompts", prompts_path %></li>
3
4
  <li><%= link_to @prompt.name, prompt_path(@prompt) %></li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Prompts" %>
1
2
  <section class="ck-page-header">
2
3
  <div>
3
4
  <h1 class="ck-title">Prompts</h1>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "New prompt" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Prompts", prompts_path %></li>
3
4
  <li>New</li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, @prompt.name %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Prompts", prompts_path %></li>
3
4
  <li><%= @prompt.name %></li>
@@ -15,7 +16,7 @@
15
16
  <% end %>
16
17
  <div class="ck-endpoint">
17
18
  <code class="ck-endpoint__url" id="prompt_endpoint"><%= request.base_url %><%= api_v1_prompt_path(@prompt.slug) %></code>
18
- <button type="button" class="ck-icon-btn" title="Copy endpoint" onclick="navigator.clipboard.writeText(document.getElementById('prompt_endpoint').textContent)"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="14" height="14"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"/><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"/></svg></button>
19
+ <button type="button" class="ck-icon-btn" title="Copy endpoint" aria-label="Copy endpoint" onclick="navigator.clipboard.writeText(document.getElementById('prompt_endpoint').textContent)"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="14" height="14" aria-hidden="true"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"/><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"/></svg></button>
19
20
  </div>
20
21
  <% if @prompt.tags.any? %>
21
22
  <div class="tag-marks-row">
@@ -72,7 +73,7 @@
72
73
  <td>
73
74
  <div class="ck-version-cell">
74
75
  <div class="ck-version-cell__label" onclick="event.stopPropagation()">
75
- <strong>v<%= v.version_number %></strong>
76
+ <%= link_to prompt_path(v), class: "ck-record-name" do %><strong>v<%= v.version_number %></strong><% end %>
76
77
  <% if v.current? %>
77
78
  <span class="ck-chip">Published</span>
78
79
  <% else %>
@@ -80,7 +81,7 @@
80
81
  <% end %>
81
82
  </div>
82
83
  <% if version_changed.call(v, pred) %>
83
- <button type="button" class="ck-cell-link ck-cell-link--delta" title="What changed from v<%= pred.version_number %>" onclick="event.stopPropagation();document.getElementById('ck-vdiff-<%= v.id %>').showModal()">&Delta;</button>
84
+ <button type="button" class="ck-cell-link ck-cell-link--delta" title="What changed from v<%= pred.version_number %>" aria-label="What changed from v<%= pred.version_number %>" onclick="event.stopPropagation();document.getElementById('ck-vdiff-<%= v.id %>').showModal()"><span aria-hidden="true">&Delta;</span></button>
84
85
  <% end %>
85
86
  </div>
86
87
  </td>
@@ -106,11 +107,11 @@
106
107
  <% versions.each do |v| %>
107
108
  <% pred = predecessor_of[v] %>
108
109
  <% next unless version_changed.call(v, pred) %>
109
- <dialog id="ck-vdiff-<%= v.id %>" class="ck-modal" onclick="if(event.target===this)this.close()">
110
+ <dialog id="ck-vdiff-<%= v.id %>" class="ck-modal" aria-labelledby="ck-vdiff-title-<%= v.id %>" onclick="if(event.target===this)this.close()">
110
111
  <article class="ck-modal__panel" tabindex="-1" autofocus onclick="event.stopPropagation()">
111
112
  <header class="ck-modal__header">
112
113
  <div class="ck-modal__heading">
113
- <h2 class="ck-modal__title">v<%= pred.version_number %> &rarr; v<%= v.version_number %></h2>
114
+ <h2 class="ck-modal__title" id="ck-vdiff-title-<%= v.id %>">v<%= pred.version_number %> <span aria-hidden="true">&rarr;</span> v<%= v.version_number %></h2>
114
115
  <span class="ck-modal__meta">What changed in <%= v.version_label %><% if v.current? %> (published)<% end %></span>
115
116
  </div>
116
117
  <button type="button" class="ck-modal__close" aria-label="Close" onclick="this.closest('dialog').close()">&times;</button>
@@ -168,11 +169,11 @@
168
169
  <tbody>
169
170
  <% suggestions.each do |s| %>
170
171
  <tr onclick="window.location='<%= suggestion_path(s, from: "prompt") %>'" style="cursor: pointer;">
171
- <td><strong><%= s.run.name %></strong></td>
172
+ <td><%= link_to suggestion_path(s, from: "prompt"), class: "ck-record-name" do %><strong><%= s.run.name %></strong><% end %></td>
172
173
  <td class="ck-meta-copy"><%= truncate(s.reasoning.to_s, length: 100) %></td>
173
174
  <td><%= s.applied_at? ? content_tag(:span, "Applied", class: "ck-chip", style: "background: var(--ck-success-soft); color: var(--ck-success);") : "&mdash;".html_safe %></td>
174
175
  <td class="ck-meta-copy"><time data-relative-time datetime="<%= s.created_at.utc.iso8601 %>"><%= time_ago_in_words(s.created_at) %> ago</time></td>
175
- <td class="ck-results-table__arrow">&rarr;</td>
176
+ <td class="ck-results-table__arrow" aria-hidden="true">&rarr;</td>
176
177
  </tr>
177
178
  <% end %>
178
179
  </tbody>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Edit provider" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Providers", provider_credentials_path %></li>
3
4
  <li>Edit</li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Providers" %>
1
2
  <% @provider_credentials.each do |pc| %>
2
3
  <%= turbo_stream_from "completion_kit_provider_#{pc.id}" %>
3
4
  <% end %>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "New provider" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Providers", provider_credentials_path %></li>
3
4
  <li>New</li>
@@ -119,7 +119,7 @@
119
119
  </div>
120
120
 
121
121
  <div class="ck-field" id="metrics-field">
122
- <label class="ck-label">Metrics</label>
122
+ <p class="ck-label" id="run_metrics_label">Metrics</p>
123
123
  <% if @all_metrics.empty? %>
124
124
  <p class="ck-field-hint" style="color: var(--ck-warning);">No metrics yet.&ensp;<%= link_to "Create a metric", new_metric_path, class: "ck-link" %></p>
125
125
  <% else %>
@@ -158,7 +158,7 @@
158
158
  </div>
159
159
  <% end %>
160
160
 
161
- <div class="ck-metric-checkboxes" data-metric-checkboxes>
161
+ <div class="ck-metric-checkboxes" data-metric-checkboxes role="group" aria-labelledby="run_metrics_label">
162
162
  <% @all_metrics.each do |metric| %>
163
163
  <label class="ck-checkbox-label" data-metric-tags="<%= metric.tag_names.join(",") %>" data-compare-expected="<%= metric.check? && metric.check_config.to_h["compare_to"] == "expected" ? "1" : "0" %>">
164
164
  <%= check_box_tag "run[metric_ids][]", metric.id, run.metric_ids.include?(metric.id), class: "ck-checkbox", id: "run_metric_#{metric.id}" %>
@@ -15,14 +15,14 @@
15
15
  <span class="ck-metric-bar ck-metric-bar--compact">
16
16
  <% pip_reviews.each do |r| %>
17
17
  <% if r.ai_score.present? %>
18
- <span class="ck-metric-pip ck-metric-pip--<%= ck_score_kind(r.ai_score.to_f) %>">
18
+ <span class="ck-metric-pip ck-metric-pip--<%= ck_score_kind(r.ai_score.to_f) %>" role="img" aria-label="<%= r.metric_name %> score <%= r.ai_score %>">
19
19
  <span class="ck-metric-pip__bar"></span>
20
- <span class="ck-metric-pip__label"><%= r.metric_name %> <strong><%= r.ai_score %></strong></span>
20
+ <span class="ck-metric-pip__label" aria-hidden="true"><%= r.metric_name %> <strong><%= r.ai_score %></strong></span>
21
21
  </span>
22
22
  <% else %>
23
- <span class="ck-metric-pip ck-metric-pip--<%= ck_pass_rate_kind(r.passed ? 1.0 : 0.0) %>">
23
+ <span class="ck-metric-pip ck-metric-pip--<%= ck_pass_rate_kind(r.passed ? 1.0 : 0.0) %>" role="img" aria-label="<%= r.metric_name %> <%= r.passed ? "Pass" : "Fail" %>">
24
24
  <span class="ck-metric-pip__bar"></span>
25
- <span class="ck-metric-pip__label"><%= r.metric_name %> <strong><%= r.passed ? "Pass" : "Fail" %></strong></span>
25
+ <span class="ck-metric-pip__label" aria-hidden="true"><%= r.metric_name %> <strong><%= r.passed ? "Pass" : "Fail" %></strong></span>
26
26
  </span>
27
27
  <% end %>
28
28
  <% end %>
@@ -69,5 +69,5 @@
69
69
  onclick: "event.stopPropagation();" %>
70
70
  <% end %>
71
71
  </td>
72
- <td class="ck-results-table__arrow"><% if clickable %>&rarr;<% end %></td>
72
+ <td class="ck-results-table__arrow"><% if clickable %><span aria-hidden="true">&rarr;</span><% end %></td>
73
73
  </tr>
@@ -3,6 +3,7 @@
3
3
  <div class="ck-runs-table__identity">
4
4
  <span class="ck-run-name">
5
5
  <span class="<%= ck_run_dot(run) %>"></span>
6
+ <span class="ck-visually-hidden"><%= run.status.to_s.humanize %>:</span>
6
7
  <%= link_to ck_run_path(run), class: "ck-record-name" do %><strong><%= run.name %></strong><% end %>
7
8
  </span>
8
9
  <div class="ck-runs-table__config">
@@ -35,14 +36,14 @@
35
36
  <div class="ck-metric-bar ck-metric-bar--compact">
36
37
  <% metrics.each do |m| %>
37
38
  <% if m[:kind] == "check" %>
38
- <span class="ck-metric-pip ck-metric-pip--<%= ck_pass_rate_kind(m[:pass_rate]) %>">
39
+ <span class="ck-metric-pip ck-metric-pip--<%= ck_pass_rate_kind(m[:pass_rate]) %>" role="img" aria-label="<%= m[:name] %> <%= (m[:pass_rate] * 100).round %>% pass rate">
39
40
  <span class="ck-metric-pip__bar"></span>
40
- <span class="ck-metric-pip__label"><%= m[:name] %> <strong><%= (m[:pass_rate] * 100).round %>%</strong></span>
41
+ <span class="ck-metric-pip__label" aria-hidden="true"><%= m[:name] %> <strong><%= (m[:pass_rate] * 100).round %>%</strong></span>
41
42
  </span>
42
43
  <% else %>
43
- <span class="ck-metric-pip ck-metric-pip--<%= ck_score_kind(m[:avg]) %>">
44
+ <span class="ck-metric-pip ck-metric-pip--<%= ck_score_kind(m[:avg]) %>" role="img" aria-label="<%= m[:name] %> average score <%= m[:avg] %>">
44
45
  <span class="ck-metric-pip__bar"></span>
45
- <span class="ck-metric-pip__label"><%= m[:name] %> <strong><%= m[:avg] %></strong></span>
46
+ <span class="ck-metric-pip__label" aria-hidden="true"><%= m[:name] %> <strong><%= m[:avg] %></strong></span>
46
47
  </span>
47
48
  <% end %>
48
49
  <% end %>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "#{@run.name} vs #{@other_run.name}" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Runs", runs_path %></li>
3
4
  <li><%= link_to @run.name, run_path(@run) %></li>
@@ -26,7 +27,7 @@
26
27
  <th scope="col">Case</th>
27
28
  <th scope="col">Metric</th>
28
29
  <th scope="col">A → B</th>
29
- <th scope="col" class="ck-num">Δ</th>
30
+ <th scope="col" class="ck-num"><span aria-hidden="true">Δ</span><span class="ck-visually-hidden">Delta (B minus A)</span></th>
30
31
  <th scope="col">Version</th>
31
32
  </tr>
32
33
  </thead>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Compare runs" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Runs", runs_path %></li>
3
4
  <li><%= link_to @run.name, run_path(@run) %></li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Edit run" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <% if @run.prompt %>
3
4
  <li><%= link_to "Prompts", prompts_path %></li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Runs" %>
1
2
  <section class="ck-page-header">
2
3
  <div>
3
4
  <h1 class="ck-title">Runs</h1>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "New run" %>
1
2
  <ol class="ck-breadcrumb">
2
3
  <li><%= link_to "Runs", runs_path %></li>
3
4
  <li>New run</li>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, @run.name %>
1
2
  <%= turbo_stream_from "completion_kit_run_#{@run.id}" %>
2
3
 
3
4
  <ol class="ck-breadcrumb">
@@ -117,11 +118,11 @@
117
118
  <% end %>
118
119
 
119
120
  <% if @run.dataset %>
120
- <dialog id="dataset-preview-<%= @run.id %>" class="ck-modal" onclick="if(event.target===this)this.close()">
121
+ <dialog id="dataset-preview-<%= @run.id %>" class="ck-modal" aria-labelledby="dataset-preview-title-<%= @run.id %>" onclick="if(event.target===this)this.close()">
121
122
  <article class="ck-modal__panel" tabindex="-1" autofocus onclick="event.stopPropagation()">
122
123
  <header class="ck-modal__header">
123
124
  <div class="ck-modal__heading">
124
- <h2 class="ck-modal__title"><%= @run.dataset.name %></h2>
125
+ <h2 class="ck-modal__title" id="dataset-preview-title-<%= @run.id %>"><%= @run.dataset.name %></h2>
125
126
  <span class="ck-modal__meta"><%= @run.dataset.row_count %> rows</span>
126
127
  </div>
127
128
  <button type="button" class="ck-modal__close" aria-label="Close" onclick="this.closest('dialog').close()">×</button>
@@ -187,12 +188,12 @@
187
188
  <table class="ck-results-table ck-responses-table"<%= ' hidden'.html_safe unless @responses.any? %> id="responses_table">
188
189
  <thead>
189
190
  <tr>
190
- <th>#</th>
191
- <th>Response</th>
192
- <th>Metrics</th>
193
- <th>Avg score</th>
194
- <th>Status</th>
195
- <th></th>
191
+ <th scope="col">#</th>
192
+ <th scope="col">Response</th>
193
+ <th scope="col">Metrics</th>
194
+ <th scope="col">Avg score</th>
195
+ <th scope="col">Status</th>
196
+ <th scope="col"></th>
196
197
  </tr>
197
198
  </thead>
198
199
  <tbody id="run_responses">
@@ -7,18 +7,16 @@
7
7
  <% end %>
8
8
  <%= form_with(model: tag, local: true) do |form| %>
9
9
  <div class="ck-card ck-form-card">
10
- <% name_error = tag.errors[:name].first %>
11
10
  <div class="ck-field">
12
11
  <%= form.label :name, "Tag name", class: "ck-label" %>
13
12
  <%= form.text_field :name,
14
13
  id: "tag_name",
15
- class: ["ck-input", ("ck-input--error" if name_error)].compact.join(" "),
14
+ class: ["ck-input", ("ck-input--error" if tag.errors[:name].any?)].compact.join(" "),
16
15
  placeholder: "e.g. production",
17
16
  autofocus: true,
18
- "aria-invalid": name_error ? "true" : nil %>
19
- <% if name_error %>
20
- <p class="ck-field-error" role="alert"><%= name_error %></p>
21
- <% elsif !tag.persisted? %>
17
+ **ck_field_aria(form, :name) %>
18
+ <%= ck_field_error(form, :name) %>
19
+ <% if tag.errors[:name].empty? && !tag.persisted? %>
22
20
  <p class="ck-hint">Color is auto-assigned from a 10-color palette.</p>
23
21
  <% end %>
24
22
  </div>
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Edit tag" %>
1
2
  <% original = @tag.name_was.presence || "tag" %>
2
3
  <% display_name = @tag.name.presence || original %>
3
4
  <% pill = content_tag(:span,
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "Tags" %>
1
2
  <%= render "completion_kit/shared/settings_nav", section_label: "Tags" %>
2
3
 
3
4
  <section class="ck-page-header">
@@ -1,3 +1,4 @@
1
+ <% content_for :ck_title, "New tag" %>
1
2
  <% display_name = @tag.name.presence.to_s %>
2
3
  <% pill = content_tag(:span,
3
4
  content_tag(:span, display_name, id: "tag-pill-text", data: { placeholder: "" }),
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>CompletionKit</title>
4
+ <title><%= [content_for(:ck_title).presence, "CompletionKit"].compact.join(" — ") %></title>
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <%= csrf_meta_tags %>
7
7
  <%= csp_meta_tag %>
@@ -1,3 +1,3 @@
1
1
  module CompletionKit
2
- VERSION = "0.28.7"
2
+ VERSION = "0.28.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: completion-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.7
4
+ version: 0.28.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Bastin