feat(Quote Replies): Add action buttons to replies in post notes (meatballs menu)#1662
feat(Quote Replies): Add action buttons to replies in post notes (meatballs menu)#1662marcustyphoon wants to merge 29 commits intoAprilSylph:masterfrom
Conversation
|
Man, I wish I had typescript and something similar to Zod. I mean, jesus. |
This comment was marked as resolved.
This comment was marked as resolved.
|
q: why did you make a PR that would immediately completely explode when it's merged with another active PR? |
a16b5f8 to
551bf9e
Compare
Yeah, doing that "merge" took me slightly over an hour. Fun times. (The actual issue was that I—at the time, cleverly—reused the |
|
Hm, this might be easier with the |
yeah, I dunno, maybe... not. |
is this really better though
| }; | ||
|
|
||
| const determineNoteReplyType = ({ noteProps, parentNoteProps }) => { | ||
| if (userBlogNames.includes(noteProps.note.blogName)) return false; |
There was a problem hiding this comment.
Interesting note from testing: this line excludes quote replying yourself, which probably makes sense in general... but a) maybe it doesn't (something something group blogs), and b) that's inconsistent with the behavior on activity items, which totally does let you quote reply yourself!
|
|
You know... putting this in meatballs doesn't necessarily make a ton of sense, does it. No one's going to find it there. And now there's a juicy space right next to the like button... |
As a bit of an aside to the actual issue in question, #1655 (comment) also brought up that it's reasonable to expect Quote Replies to be usable from the replies themselves as well as the activity pane. It isn't... but we can probably do that!
As a bonus, this sidesteps #1658, since the post notes API is totally different. (No longer relevant)
Description
This implements an item in the meatball menu on certain replies in the post footer, allowing the user to activate Quote Replies directly from that location if they would have been able to from the relevant item in the activity menu/page.
Technical Details
[register/unregister]ReplyMeatballItemmodes added to target the meatball menus in post footer replies, which should be fairly self-explanatory, as the utility was recently factored to make adding modes easier and the code is similar to the other modes.notePropsObjectsutility is added, similar totimelineObjectandnotificationObject... mostly. Note the plural. Thenoteprop doesn't include enough information to correctly process threaded replies, so the utility returns both the note prop for the target reply and, if it exists, the note prop of its parent. Also, there are multiple React components in the tree withnoteprops, not all of which contain all of the fields.determineNoteReplyTypefunction, which is used both to determine if we should be able to quote-reply a reply (i.e. if it's targeting us) and, if so, what type of reply it will be and which of our blogs is being targeted.As noted in below comments, creatingcontentandtagsis mostly a copy-paste job, but following the DRY rule here makes the code pretty complicated.Testing steps
todo: list testing steps