shapeup-cli 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: ecb0aff2791935bf727f5afbb283ec92bb181325bb57b8ba0d6778d05b18db26
4
- data.tar.gz: 8f938f4be9b1dafc98c44916bcf539b936ba89fa0ca9c245cf78b1531c6a64c6
3
+ metadata.gz: f7f49a40c881c3e40aa1749a419a41139d02a5c3066113e851efecf544cddc84
4
+ data.tar.gz: baa1415c2d57ea6aeeb74c4562e67773041ddd72ad9d27667bf34756faca8e56
5
5
  SHA512:
6
- metadata.gz: f337c2f8aade0196c9cdaff8f48d7e10a4216736844e7b2381aa348dcc0855a12d8a0d3ee557fee7778599f1ab8bb15399676afcf87c8150b446e54e5328d323
7
- data.tar.gz: 517305b0931a662d4b3b8a4cfb2910a3a879b64bfce4d303edaf7da7cf390a6f0c2c8f1155ab9f2f0261ec64c6ef69574fed070f564c0ad0b9f8b9ebe820149f
6
+ metadata.gz: 83fb9f6f9978710170a847e270469de2b7b0d57381adb4751a0748db279477e6780d2ca87176f1f787a06cd89c5594e7cd65533c773d6b7fb12b7d0f3ee3747d
7
+ data.tar.gz: '098b476ae487d54975b7726227407462452da622fb5a7b188de2bd72d42a902dfc10f2fe474874eda44069b2014b5ea7d725a021e8cd988e90c7f8fa009faf11'
@@ -66,12 +66,9 @@ module ShapeupCli
66
66
  attach_paths = extract_options("--attach")
67
67
  text = positional_arg(1) || abort('Usage: shapeup comments add --issue <id> [--parent <comment_id>] [--attach <image>] "Comment text"')
68
68
 
69
- text, images = local_images_in(text)
70
- images += attach_paths.map { |path| [ path, nil ] }
71
-
72
- arguments = { commentable_type: type, commentable_id: id.to_s, content: text }
69
+ arguments = { commentable_type: type, commentable_id: id.to_s, content: place_local_images(text) }
73
70
  arguments[:parent_id] = parent.to_s if parent
74
- arguments[:attachments] = images.map { |path, alt| upload_image(path, alt) } if images.any?
71
+ arguments[:attachments] = attach_paths.map { |path| upload_image(path, nil) } if attach_paths.any?
75
72
  result = call_tool("create_comment", **arguments)
76
73
 
77
74
  render result,
@@ -85,7 +82,7 @@ module ShapeupCli
85
82
  comment_id = positional_arg(1) || abort('Usage: shapeup comments edit <comment_id> "New text"')
86
83
  text = positional_arg(2) || abort('Usage: shapeup comments edit <comment_id> "New text"')
87
84
 
88
- result = call_tool("update_comment", comment_id: comment_id.to_s, content: text)
85
+ result = call_tool("update_comment", comment_id: comment_id.to_s, content: place_local_images(text))
89
86
 
90
87
  render result, summary: "Comment ##{comment_id} updated"
91
88
  end
@@ -111,20 +108,16 @@ module ShapeupCli
111
108
 
112
109
  IMAGE_TYPES = { ".png" => "image/png", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".gif" => "image/gif", ".webp" => "image/webp" }.freeze
113
110
  IMAGE_MAX_SIZE = 10 * 1024 * 1024
114
- MARKDOWN_IMAGE = /!\[([^\]]*)\]\(([^)\s]+)\)\n?/
115
-
116
- def local_images_in(text)
117
- images = []
118
- text = text.gsub(MARKDOWN_IMAGE) do |markdown|
119
- alt, path = $1, $2
120
- if path.match?(%r{\A[a-z][a-z0-9+.-]*://}i) || !File.file?(path)
121
- markdown
122
- else
123
- images << [ path, alt ]
124
- ""
125
- end
111
+ MARKDOWN_IMAGE = /!\[([^\]]*)\]\(([^)\s]+)(?:\s+"([^"]*)")?\)/
112
+
113
+ def place_local_images(text)
114
+ text.gsub(MARKDOWN_IMAGE) do |markdown|
115
+ alt, path, caption = $1, $2, $3
116
+ next markdown if path.match?(%r{\A[a-z][a-z0-9+.-]*:}i) || !File.file?(path)
117
+
118
+ uploaded = upload_image(path, alt)
119
+ %(![#{uploaded[:alt]}](attachment:#{uploaded[:attachment]}#{%( "#{caption}") if caption}))
126
120
  end
127
- [ text.strip, images ]
128
121
  end
129
122
 
130
123
  def upload_image(path, alt)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShapeupCli
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
@@ -222,7 +222,7 @@ Branch on `retryable` to decide retry-vs-abandon; `false` means "no known reason
222
222
  | Watch the inbox as JSON lines | `SHAPEUP_PROFILE=<agent> shapeup connect` |
223
223
  | Reply under a comment | `shapeup comments add --issue <id> --parent <comment_id> "Reply"` |
224
224
  | React to a comment | `shapeup comments react <comment_id> 👀` |
225
- | Attach screenshots to a comment | `shapeup comments add --issue <id> "Text ![What it shows](./shot.png)"` or `--attach shot.png` |
225
+ | Attach screenshots to a comment | `shapeup comments add --issue <id> "Text ![What it shows](./shot.png \"Caption\")"` (stays where you put it; images on consecutive lines sit side by side) or `--attach shot.png` (added at the end) |
226
226
 
227
227
  ## Common Workflows
228
228
 
@@ -142,18 +142,36 @@ Give the subagent this, filled in:
142
142
  > commit there. Never push, deploy, merge or delete branches unless the owner said so in this
143
143
  > session.
144
144
  > 4. If the ask is unclear or you are blocked, ask on the issue rather than guess.
145
- > 5. If the work changes anything people see, show it. Use whatever browser tool you have to take
146
- > screenshots of each place it touches, before (from the main branch) and after (from yours),
147
- > at the size people use it and on a phone when it matters. Save them as PNG files outside the
148
- > repository, with names that say what they show.
145
+ > 5. If the work changes anything people see, compare it the way a careful reviewer would:
146
+ > - From your diff, list the screens and states it touches, including the ones it could break.
147
+ > - Run the main branch beside yours: check main out into a git worktree outside this
148
+ > repository and start it on a second port, so both are up at once. How to start and sign in
149
+ > to the app should be in the project's CLAUDE.md or README; if it isn't, ask on the issue.
150
+ > - With whatever browser tool you have, capture each screen in both, at the same size and with
151
+ > the same content, plus a phone width and dark mode where they matter. Save PNGs outside the
152
+ > repository, named for what they show.
153
+ > - Stop the second server and remove the worktree when you're done.
149
154
  > 6. Reply once, under the comment that asked:
150
155
  > `shapeup --profile <profile> comments add --issue <issue.id> --parent <reply_to.comment_id> "<reply>"`
151
- > (leave out `--parent` when `reply_to.comment_id` is null). Start with `@<requester.name>`.
152
- > Say what changed, the branch and commit, how you checked it, and anything still open.
153
- > Keep it short and plain. Put each screenshot in the reply as a local Markdown image,
154
- > `![Toolbar after the fix, on a phone](/tmp/toolbar-after-phone.png)`: the CLI uploads it and
155
- > the words in brackets become its description for people who can't see it, so write them
156
- > properly. Mention anyone the requester asked you to hand over to.
156
+ > (leave out `--parent` when `reply_to.comment_id` is null). Start with `@<requester.name>`,
157
+ > then say what changed, the branch and commit, and how you checked it. Keep it plain.
158
+ >
159
+ > When you have screenshots, write the rest like a review: a `## heading` per area, a line on
160
+ > what changed there, then its before and after as local Markdown images on consecutive lines,
161
+ > so they sit side by side:
162
+ >
163
+ > ```markdown
164
+ > ## Toolbar
165
+ > Looks the same. Dropdowns now open with focus on the first item.
166
+ >
167
+ > ![Toolbar on main, dropdown open](/tmp/shots/toolbar-before.png "Before")
168
+ > ![Toolbar on this branch, dropdown open with the first item focused](/tmp/shots/toolbar-after.png "After")
169
+ > ```
170
+ >
171
+ > The CLI uploads each image where it stands. The words in brackets are its description for
172
+ > people who can't see it, so say what it shows; the quoted word is its caption. End with a
173
+ > `## Worth a look` section for anything that seems off, and mention whoever the requester asked
174
+ > you to hand over to.
157
175
  > 7. Then take it out of the inbox: `shapeup --profile <profile> inbox done <id>`.
158
176
  > 8. Report back in one line.
159
177
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shapeup-cli
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
  - ShapeUp