admin_suite 0.3.0 → 0.3.1

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: eadb4dfd6668dd70da1795f1188d17e6ba0d65950c09ff92a858238efa7c606f
4
- data.tar.gz: 6c99383ce4ba18076897d828faada789b95540760111e6fa7e04194fa66fcb94
3
+ metadata.gz: 9bafe4fb74ddbd5bb365501f185970b270950000aeae6e5d9689f7fcf7f32c5b
4
+ data.tar.gz: 2490ec0b676767b12fba85bc83f36284cde983ce07008e070d0aec31d882f8e0
5
5
  SHA512:
6
- metadata.gz: 97b5c9435b6da6cefa0a427b5c7d09c28917ae7fcd03873fca257be9221bd6bc9c214eea47154e1b51c2f7ed02c8097c08a6a266f5010ee75029ad0548ae3394
7
- data.tar.gz: dfe2b7c2a326b22a1e4a84620b1f0c322a65af9fb8fd9acd09292ec527a7d3e606380788d6fa3b42f9247beaa96c6608455b90f9d9dd51dd6fde924af1345565
6
+ metadata.gz: 1628a85ae6f41e1ac6d467dace94314b9db51b27e3e044938c9cde52e7ea616b3c5604b23cb694259a8eb828a321e52eb6981852d956c7a0956f8ba5bec20b1e
7
+ data.tar.gz: d6cb87908af3d7e20445f2b680bfecb92a0aed93736a5d1c7810f4efa85b5fda85dee4a98c585b765788e6d52950720122b3adf7575c28a68c45e982b9597acb
data/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.1] - 2026-08-01
11
+
12
+ ### Fixed
13
+
14
+ - Chart panels now give percentage-height bars a definite-height container, preserve full axis labels, and keep small nonzero values visible.
15
+
10
16
  ## [0.3.0] - 2026-07-31
11
17
 
12
18
  ### Changed (BREAKING)
@@ -29,7 +29,8 @@ end %>
29
29
  <% height_float = (value / max_value) * 100.0 %>
30
30
  <% height_float = 0.0 if height_float.nan? || height_float.infinite? %>
31
31
  <% height = height_float.round %>
32
- <div class="flex-1 flex flex-col items-center gap-1">
32
+ <% height = [height, 2].max if value.positive? %>
33
+ <div class="flex-1 h-full flex flex-col items-center justify-end">
33
34
  <div class="w-full rounded-t <%= bar_color %> transition-all" style="height: <%= height %>%"
34
35
  title="<%= "#{d[:label]}: #{d[:value]}" %>"></div>
35
36
  </div>
@@ -38,7 +39,7 @@ end %>
38
39
 
39
40
  <div class="flex gap-1 mt-2">
40
41
  <% data.each do |d| %>
41
- <div class="flex-1 text-center text-xs text-slate-400"><%= d[:label].to_s.first(3) %></div>
42
+ <div class="flex-1 text-center text-xs text-slate-400" title="<%= d[:label] %>"><%= d[:label] %></div>
42
43
  <% end %>
43
44
  </div>
44
45
  <% else %>
@@ -2,7 +2,7 @@
2
2
 
3
3
  module AdminSuite
4
4
  module Version
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
7
7
 
8
8
  # Backward-compatible constant.
@@ -65,5 +65,45 @@ module AdminSuite
65
65
  AdminSuite.config.root_dashboard_description = old_description
66
66
  AdminSuite.reset_root_dashboard!
67
67
  end
68
+
69
+ test "chart bars have a definite-height wrapper and preserve full labels" do
70
+ old_globs = AdminSuite.config.dashboard_globs
71
+
72
+ Dir.mktmpdir("admin-suite-chart") do |dir|
73
+ dashboard_rb = File.join(dir, "dashboard.rb")
74
+
75
+ File.write(dashboard_rb, <<~'RUBY')
76
+ # frozen_string_literal: true
77
+
78
+ AdminSuite.root_dashboard do
79
+ row do
80
+ chart_panel "Daily Cost", data: -> {
81
+ [
82
+ { label: "Jul 30", value: 0.01 },
83
+ { label: "Thursday", value: 10 }
84
+ ]
85
+ }
86
+ end
87
+ end
88
+ RUBY
89
+
90
+ AdminSuite.reset_root_dashboard!
91
+ AdminSuite.config.dashboard_globs = [ File.join(dir, "*.rb") ]
92
+
93
+ get "/internal/admin_suite"
94
+ assert_response :success
95
+
96
+ document = Nokogiri::HTML(response.body)
97
+ chart = document.at_xpath("//h3[normalize-space()='Daily Cost']/ancestor::div[contains(@class, 'rounded-xl')]")
98
+ assert chart
99
+ assert_equal 2, chart.css(".h-16 > .h-full").size
100
+ assert_equal ["height: 2%", "height: 100%"], chart.css(".h-16 > .h-full > div").map { |bar| bar["style"] }
101
+ assert_includes chart.text, "Jul 30"
102
+ assert_includes chart.text, "Thursday"
103
+ end
104
+ ensure
105
+ AdminSuite.config.dashboard_globs = old_globs
106
+ AdminSuite.reset_root_dashboard!
107
+ end
68
108
  end
69
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admin_suite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - TechWright Labs