zaniah 0.12.0 → 0.12.2

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: 8bda306c4301dbab842c0014a31bd563366fd846755c1adab9b864704dcd04a2
4
- data.tar.gz: 94a9f0005a5e03e97f64f362e9ace3c1ec1757a2f73b9bf893f4e4eee6c56926
3
+ metadata.gz: 2a2129697924f8c947c192512c04feadb9a24e2573874b3d33c221ee57f264b4
4
+ data.tar.gz: ac0e3df1f93298c90b927718699ee209aa28dc9a74e08f2c793e83f6b7da6b34
5
5
  SHA512:
6
- metadata.gz: 0ed9ec96438a5e8de2c420b13d709be7865ad5a1df0d5e0d41cb23a110a2fe00dfc9143624a4fa4ead856e02f9b63c9e986df2f89ecee7e1f113e6265bfa6485
7
- data.tar.gz: 118e347c3b1fe1ddc83e5f5a3390fd4dfb026ca95b79d32239c328960b1dc3a91525e7e70f1b60ef24570026f4f997dd0bb82f955a12c3f67653bd8db90d4032
6
+ metadata.gz: ef5918ddb7423a37cde8864ec5f85d4474b2c749d0339debe4994f3ac8aab41477cd2cfd8c13e6b9a93867edfce2d44af4ffc8b9f9f949ee4c69809d73ccecb9
7
+ data.tar.gz: a46e5523427daff5318e54515b95e832f5a4762f10e7dadcb759e6bfbebd00800ca114a1c1cc830d4dc1a6c21d088c0b3511db0d102e93a382a6f8453f855d87
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.2 — 2026-10-02
4
+
5
+ - Reduce redraw allocations to improve rendering responsiveness.
6
+
7
+ ## 0.12.1 — 2026-10-02
8
+
9
+ - Prevent obsolete focus controls from accumulating across redraws, reducing memory use and keeping keyboard navigation on current controls.
10
+
3
11
  ## 0.12.0 — 2026-10-02
4
12
 
5
13
  - Add streaming virtual tables with lazy cells, stable selection, row styling, configurable columns, and tail following.
@@ -20,6 +20,7 @@ module Zaniah
20
20
  @keymap, @hits = keymap, []
21
21
  @transforms = [Transform.identity]
22
22
  @focus_tree = FocusTree.new
23
+ @automatic_focus_parents = []
23
24
  end
24
25
 
25
26
  def focus(handle, origin: :programmatic)
@@ -100,6 +101,7 @@ module Zaniah
100
101
  if owner.respond_to?(:focus_handle) && (parent = owner.focus_handle)
101
102
  unless parent.equal?(handle)
102
103
  handle.parent = parent
104
+ @automatic_focus_parents << [handle, parent]
103
105
  break
104
106
  end
105
107
  end
@@ -116,6 +118,10 @@ module Zaniah
116
118
 
117
119
  def clear_hits
118
120
  @hits.clear
121
+ @automatic_focus_parents.each do |handle, parent|
122
+ handle.parent = nil if handle.parent.equal?(parent)
123
+ end
124
+ @automatic_focus_parents.clear
119
125
  @focus_tree.clear
120
126
  @transforms.replace([Transform.identity])
121
127
  end
@@ -22,7 +22,11 @@ module Zaniah
22
22
 
23
23
  def initialize(**properties) = @values = DEFAULTS.merge(properties).freeze
24
24
  def [](name) = @values[name]
25
- def merge(**properties) = Style.new(**@values.merge(properties))
25
+ def merge(**properties)
26
+ style = Style.allocate
27
+ style.instance_variable_set(:@values, @values.merge(properties).freeze)
28
+ style
29
+ end
26
30
  def to_h = @values
27
31
 
28
32
  def inherit(parent)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zaniah
4
- VERSION = "0.12.0"
4
+ VERSION = "0.12.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaniah
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yudai Takada