claude-inbox 0.9.0 → 0.10.0

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: 6194693f8175ae0767d58a3f9f90e746122f831a33675c2928e2120ccba4e895
4
- data.tar.gz: d1f08c4e9341d115a7775fff9702fef6342b3771b9a76e3bc0fd957af79d04ef
3
+ metadata.gz: 56e25a548ff2899f765523fbf990e66b96f970915c8efafa39fb8834af99f6db
4
+ data.tar.gz: 590e72d23244e04517692beee562c53c59cecba10028b16ea9a371560392fcec
5
5
  SHA512:
6
- metadata.gz: 721c56943e7dbf8155b99c32befb179b471b5f1971ce7031fa9e0d33e747c083fa6a1dfd2441f5d72c6bebc56897ac342bc783abaa36b34bc2eff5aee0ebd7ca
7
- data.tar.gz: 7424b14a131fdfd6ff488e2cef38781bbb046b375d847d094ada5be48f6789db5b9135335a3d6592374028f2c92a506235e10e8adfe91fb53cfe4f2d5c6c4fff
6
+ metadata.gz: ffb0d572f03f482149ddf17f599d936a99de569340e6dbc61d587a5b736aa1919d78d300ddde35689e6b31b15a020eef350830668b046288df6925e021768ecb
7
+ data.tar.gz: 56805ff4fd994c5a22ef94742a801a6693b04b577f3ebfee63bb99271ff5de68f343e54f33011558852c7dbaeb6851124a944aa2b091190f95479ce51d2736fd
@@ -21,11 +21,14 @@ module ClaudeInbox
21
21
  end
22
22
 
23
23
  def frame(width, caret = nil)
24
- box = [width - 4, self.class::WIDTH].min
24
+ box = [width - 4, fit].min
25
25
  TTY::Box.frame(lines(box - 4, caret).join("\n"), title: {top_left: title}, padding: [0, 1], width: box)
26
26
  .split("\n")
27
27
  end
28
28
 
29
+ # How wide the box wants to be; the frame caps it at the terminal.
30
+ def fit = self.class::WIDTH
31
+
29
32
  # `s` snooze: one key per choice, and the choice is read from `choice`.
30
33
  class Snooze < Dialog
31
34
  MENU = [
@@ -56,7 +59,7 @@ module ClaudeInbox
56
59
  # `o` open and `y` copy on a session with several PRs: the headline
57
60
  # first, and the same key again takes it. The PR is read from `choice`.
58
61
  class PrPicker < Dialog
59
- WIDTH = 64
62
+ MARGIN = 6
60
63
  KEYS = {open: "o", copy: "y"}.freeze
61
64
  VERBS = {open: "open", copy: "copy"}.freeze
62
65
 
@@ -69,6 +72,10 @@ module ClaudeInbox
69
72
 
70
73
  def title = " #{VERBS.fetch(kind).capitalize} pull request "
71
74
 
75
+ # Titles vary, so the box grows to the longest line plus some air,
76
+ # and never shrinks below a plain dialog.
77
+ def fit = [WIDTH, lines(Float::INFINITY, nil).map { |l| Text.width(l) }.max + MARGIN].max
78
+
72
79
  def lines(width, _caret)
73
80
  (@prs.each_with_index.map { |pr, i| " #{i + 1} #{label(pr)}" } +
74
81
  ["", " #{KEYS.fetch(kind)} #{VERBS.fetch(kind)} #{@prs.first.short} · esc cancel"])
data/lib/claude_inbox.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClaudeInbox
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claude-inbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Byron