plutonium 0.56.2 → 0.56.3

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.
@@ -44,11 +44,12 @@ module Plutonium
44
44
  # preferences read from localStorage:
45
45
  # - Color mode: applies `dark` class on <html> so dark theme renders
46
46
  # from the first frame instead of flashing light.
47
- # - Rail-pin: applies `pu-rail-pinned` on <body> (when present) and
48
- # on every incoming body via turbo:before-render, so a
49
- # Turbo.visit (e.g. the redirect after a form submit) doesn't
50
- # flash the rail into its collapsed state before the
51
- # icon-rail Stimulus controller can restore it.
47
+ # - Rail-pin: the rail is pinned by default, so this applies
48
+ # `pu-rail-pinned` on <body> (when present) and on every incoming
49
+ # body via turbo:before-render unless the user explicitly collapsed
50
+ # it (localStorage "false"), so a Turbo.visit (e.g. the redirect
51
+ # after a form submit) doesn't flash the rail into its collapsed
52
+ # state before the icon-rail Stimulus controller can restore it.
52
53
  def render_pre_paint_scripts
53
54
  script do
54
55
  raw(safe(<<~JS))
@@ -62,10 +63,10 @@ module Plutonium
62
63
  } catch (e) {}
63
64
 
64
65
  try {
65
- if (localStorage.getItem("pu_rail_pinned") !== "true") return;
66
+ if (localStorage.getItem("pu_rail_pinned") === "false") return;
66
67
  if (document.body) document.body.classList.add("pu-rail-pinned");
67
68
  document.addEventListener("turbo:before-render", function (event) {
68
- if (localStorage.getItem("pu_rail_pinned") === "true") {
69
+ if (localStorage.getItem("pu_rail_pinned") !== "false") {
69
70
  event.detail.newBody.classList.add("pu-rail-pinned");
70
71
  }
71
72
  });
@@ -39,7 +39,7 @@ module Plutonium
39
39
  id: "sidebar-navigation",
40
40
  data: {controller: "sidebar icon-rail"},
41
41
  aria: {label: "Sidebar Navigation"},
42
- class: "fixed top-0 left-0 z-40 h-screen " \
42
+ class: "fixed top-0 left-0 z-40 h-dvh " \
43
43
  "bg-[var(--pu-surface)] border-r border-[var(--pu-border)] " \
44
44
  "flex flex-col transition-[width] duration-200 overflow-x-hidden " \
45
45
  "-translate-x-full lg:translate-x-0"
@@ -54,7 +54,11 @@ module Plutonium
54
54
 
55
55
  def render_brand_section
56
56
  div(class: "h-12 flex items-center justify-center border-b border-[var(--pu-border)] shrink-0") do
57
- render brand_slot if brand_slot?
57
+ next unless brand_slot?
58
+
59
+ a(href: root_path, aria: {label: "Home"}, class: "flex items-center justify-center") do
60
+ render brand_slot
61
+ end
58
62
  end
59
63
  end
60
64
 
@@ -18,7 +18,7 @@ module Plutonium
18
18
  data: {controller: "sidebar"},
19
19
  id: "sidebar-navigation",
20
20
  aria: {label: "Sidebar Navigation"},
21
- class: "fixed top-0 left-0 z-40 w-64 h-screen pt-14 transition-transform -translate-x-full lg:translate-x-0"
21
+ class: "fixed top-0 left-0 z-40 w-64 h-dvh pt-14 transition-transform -translate-x-full lg:translate-x-0"
22
22
  ) do
23
23
  div(
24
24
  id: "sidebar-navigation-content",
@@ -10,7 +10,8 @@ module Plutonium
10
10
 
11
11
  nav(role: "tablist",
12
12
  aria: {label: "Scope"},
13
- class: "flex items-center gap-1 px-4 py-2 border-b border-[var(--pu-border)]") do
13
+ class: "flex flex-nowrap items-center gap-1 px-4 py-2 border-b border-[var(--pu-border)] " \
14
+ "overflow-x-auto whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden") do
14
15
  render_all_pill
15
16
  scopes.each_key { |key| render_pill(key) }
16
17
  end
@@ -43,7 +44,7 @@ module Plutonium
43
44
  end
44
45
 
45
46
  def pill_classes(active)
46
- base = "px-3 py-1 rounded-md text-sm transition-colors"
47
+ base = "shrink-0 px-3 py-1 rounded-md text-sm transition-colors"
47
48
  state = if active
48
49
  "bg-primary-100 text-primary-700 dark:bg-primary-950/40 dark:text-primary-300"
49
50
  else
@@ -1,5 +1,5 @@
1
1
  module Plutonium
2
- VERSION = "0.56.2"
2
+ VERSION = "0.56.3"
3
3
  NEXT_MAJOR_VERSION = VERSION.split(".").tap { |v|
4
4
  v[1] = v[1].to_i + 1
5
5
  v[2] = 0
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radioactive-labs/plutonium",
3
- "version": "0.56.2",
3
+ "version": "0.56.3",
4
4
  "description": "Build production-ready Rails apps in minutes, not days. Convention-driven, fully customizable, AI-ready.",
5
5
  "type": "module",
6
6
  "main": "src/js/core.js",
@@ -780,8 +780,11 @@ body.pu-rail-pinned .icon-rail-pin-expand {
780
780
  box-shadow: var(--pu-shadow-lg);
781
781
  padding: 6px;
782
782
  animation: pu-rail-flyout-in 120ms ease-out;
783
- /* Cap to the viewport so long menus scroll instead of overflowing. */
783
+ /* Cap to the viewport so long menus scroll instead of overflowing.
784
+ dvh tracks the visible viewport so the cap holds on mobile (where
785
+ 100vh sits behind the browser chrome); 100vh is the fallback. */
784
786
  max-height: calc(100vh - 16px);
787
+ max-height: calc(100dvh - 16px);
785
788
  overflow-y: auto;
786
789
  overscroll-behavior: contain;
787
790
  }
@@ -9,10 +9,9 @@ export default class extends Controller {
9
9
  }
10
10
 
11
11
  connect() {
12
- const pinned = localStorage.getItem(this.storageKeyValue) === "true"
13
- if (pinned) {
14
- document.body.classList.add("pu-rail-pinned")
15
- }
12
+ // Pinned is the default; only an explicit "false" collapses the rail.
13
+ const pinned = localStorage.getItem(this.storageKeyValue) !== "false"
14
+ document.body.classList.toggle("pu-rail-pinned", pinned)
16
15
  }
17
16
 
18
17
  togglePin() {
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plutonium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.56.2
4
+ version: 0.56.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-06-05 00:00:00.000000000 Z
10
+ date: 2026-06-07 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: zeitwerk