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 +4 -4
- data/lib/claude_inbox/dialog.rb +9 -2
- data/lib/claude_inbox.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 56e25a548ff2899f765523fbf990e66b96f970915c8efafa39fb8834af99f6db
|
|
4
|
+
data.tar.gz: 590e72d23244e04517692beee562c53c59cecba10028b16ea9a371560392fcec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ffb0d572f03f482149ddf17f599d936a99de569340e6dbc61d587a5b736aa1919d78d300ddde35689e6b31b15a020eef350830668b046288df6925e021768ecb
|
|
7
|
+
data.tar.gz: 56805ff4fd994c5a22ef94742a801a6693b04b577f3ebfee63bb99271ff5de68f343e54f33011558852c7dbaeb6851124a944aa2b091190f95479ce51d2736fd
|
data/lib/claude_inbox/dialog.rb
CHANGED
|
@@ -21,11 +21,14 @@ module ClaudeInbox
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def frame(width, caret = nil)
|
|
24
|
-
box = [width - 4,
|
|
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
|
-
|
|
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