completion-kit 0.28.8 → 0.28.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5ebc05340fbd19412b2d7ceae93492c353dbd72400d420532a2894c2dd0c89c
4
- data.tar.gz: 5a7ebe39faee5c5cb2419825ac285fae5cd67ec7c7f3f1618629ccf5f9fa5d01
3
+ metadata.gz: d8c0966124eec13a8ab4f91dae2c0f592ed5b2147efc6cfe41c43bd3bbc2b88c
4
+ data.tar.gz: e6d8c475875979668fe7856c6a035f0070c7e6f0485e3cbcc73c30740eb0feb6
5
5
  SHA512:
6
- metadata.gz: d7a6a084c52769258fa3f170e0c2cd1bb793e4885e922dea83011a45425b4bb41a49351a47832733db8e5d0200f5a213ee33ddf953deef3c5346c143112c62ca
7
- data.tar.gz: f7a1030d709b0434214ca24cc5f8215167ea8790f539365e869568850c35aa1758e8095c83b3d177fc9303b4fa78058beb5b4dfd4cf1cf53c8750debf3323bd0
6
+ metadata.gz: 383719e92a5353355beb243b136911cbce1965a26a5e0f5830e7c61e7b68743ed2d24a65512aa8724deef0da1f44204c293437bfd67ab76e80c2f317ddc50d89
7
+ data.tar.gz: 970823682d45586018b0ee93b36b3b4abbb6af8f680ab6ab3502c5a751d74b55c6c1af95570c0869ee1a7a6032dfac75d5277de4136c4c7dc9638e922645b6a1
@@ -289,8 +289,16 @@ form.button_to {
289
289
  .ck-pagination {
290
290
  display: flex;
291
291
  align-items: center;
292
- gap: 1rem;
293
- margin-top: 1rem;
292
+ justify-content: center;
293
+ gap: 1.25rem;
294
+ margin-top: 1.25rem;
295
+ padding-top: 1rem;
296
+ border-top: 1px solid var(--ck-line);
297
+ }
298
+ .ck-pagination .ck-meta-copy {
299
+ margin: 0;
300
+ min-width: 14rem;
301
+ text-align: center;
294
302
  }
295
303
 
296
304
  .ck-title,
@@ -11,6 +11,7 @@ module CompletionKit
11
11
  end
12
12
 
13
13
  RESPONSES_PER_PAGE = 100
14
+ RESPONSE_PREVIEW_CHARS = 700
14
15
 
15
16
  def show
16
17
  @responses_total = @run.responses.count
@@ -19,6 +20,7 @@ module CompletionKit
19
20
  @responses_page = params[:page].to_s.to_i.clamp(1, @responses_total_pages)
20
21
  @responses_offset = (@responses_page - 1) * RESPONSES_PER_PAGE
21
22
  @responses = ordered_responses_relation(@run, params[:sort])
23
+ .with_body_preview(RESPONSE_PREVIEW_CHARS)
22
24
  .includes(:reviews)
23
25
  .limit(RESPONSES_PER_PAGE)
24
26
  .offset(@responses_offset)
@@ -8,6 +8,11 @@ module CompletionKit
8
8
 
9
9
  delegate :prompt, to: :run
10
10
 
11
+ scope :with_body_preview, ->(limit) {
12
+ other_columns = (column_names - ["response_text"]).map { |column| "#{table_name}.#{column}" }
13
+ select(*other_columns, "SUBSTR(#{table_name}.response_text, 1, #{limit.to_i}) AS response_text")
14
+ }
15
+
11
16
  validates :response_text, presence: true, if: :requires_response_text?
12
17
 
13
18
  before_validation :set_default_status, on: :create
@@ -1,3 +1,3 @@
1
1
  module CompletionKit
2
- VERSION = "0.28.8"
2
+ VERSION = "0.28.9"
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.8
4
+ version: 0.28.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Bastin