claude-inbox 0.14.1 → 0.14.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 +4 -4
- data/lib/claude_inbox/dialog.rb +3 -2
- data/lib/claude_inbox/session.rb +18 -3
- 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: d987ed72f80dde3f91bd8ddeb3486aa867fb25e8b4ac5be91305654be021c9b0
|
|
4
|
+
data.tar.gz: 5a4874f4eee5a49c7bf56921db71f966f935397001a20a58c53a71bec69b013b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c75cc50ea18dd72da00508eb50066dc6f0a7b9b20a1e8bb6ed042272bac0c45cd963ec31efe570b080dfaf9b4ec191c56143de05a229c2f83212b7baad551728
|
|
7
|
+
data.tar.gz: 5ed8c579ff1405d26327bc6c39acc95cd79a5c0eb3706314aeab91f006bdc940d699e6ba41f35396e3af9b372900329ec8978d122e6026a8f766554a7501c806
|
data/lib/claude_inbox/dialog.rb
CHANGED
|
@@ -74,7 +74,8 @@ module ClaudeInbox
|
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
# `o` open and `y` copy on a session with several PRs: the headline
|
|
77
|
-
# first,
|
|
77
|
+
# first, then the rest in Session#prs_by_status order; the same key
|
|
78
|
+
# again takes the headline. The PR is read from `choice`.
|
|
78
79
|
class PrPicker < Dialog
|
|
79
80
|
MARGIN = 6
|
|
80
81
|
KEYS = {open: "o", copy: "y"}.freeze
|
|
@@ -83,7 +84,7 @@ module ClaudeInbox
|
|
|
83
84
|
|
|
84
85
|
def initialize(kind, session)
|
|
85
86
|
super(kind, session.key)
|
|
86
|
-
@prs = [session.pr, *session.
|
|
87
|
+
@prs = [session.pr, *session.prs_by_status.reject { |pr| pr.equal?(session.pr) }].first(9)
|
|
87
88
|
end
|
|
88
89
|
|
|
89
90
|
def title = " #{kind.to_s.capitalize} pull request "
|
data/lib/claude_inbox/session.rb
CHANGED
|
@@ -99,19 +99,34 @@ module ClaudeInbox
|
|
|
99
99
|
|
|
100
100
|
def project = cwd ? File.basename(cwd) : ""
|
|
101
101
|
|
|
102
|
-
# The PR you would act on. One
|
|
103
|
-
# only mentioned (as Row#settled? judges), so it loses to any live one.
|
|
102
|
+
# The PR you would act on. One only mentioned loses to any live one.
|
|
104
103
|
def pr = prs.each_with_index.min_by { |pr, i| [headline_rank(pr), i] }&.first
|
|
105
104
|
|
|
105
|
+
# Oldest first so a stack reads up from its base; trouble is the
|
|
106
|
+
# headline's job, not this order's.
|
|
107
|
+
def prs_by_status = prs.each_with_index.sort_by { |pr, i| [*status_order(pr), i] }.map(&:first)
|
|
108
|
+
|
|
106
109
|
private
|
|
107
110
|
|
|
108
111
|
def headline_rank(pr)
|
|
109
|
-
if
|
|
112
|
+
if mentioned?(pr) then 4
|
|
110
113
|
elsif pr.needs_you? then 0
|
|
111
114
|
elsif pr.health == "CONFLICTING" then 1
|
|
112
115
|
elsif !pr.resolved? then 2
|
|
113
116
|
else 3
|
|
114
117
|
end
|
|
115
118
|
end
|
|
119
|
+
|
|
120
|
+
def status_order(pr)
|
|
121
|
+
age = pr.number.to_i
|
|
122
|
+
if mentioned?(pr) then [3, age]
|
|
123
|
+
elsif pr.state == "OPEN" then [0, age]
|
|
124
|
+
elsif pr.state == "DRAFT" then [1, age]
|
|
125
|
+
else [2, -age]
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Unknown, or resolved before the session began (as Row#settled? judges).
|
|
130
|
+
def mentioned?(pr) = !pr.known? || pr.resolved_before?(created_at)
|
|
116
131
|
end
|
|
117
132
|
end
|
data/lib/claude_inbox.rb
CHANGED