reddit-moderator-toolbox-legacy icon indicating copy to clipboard operation
reddit-moderator-toolbox-legacy copied to clipboard

Mod macros: allow insert mode for macro text (currently overwriting initial reply box contents)

Open multubunu opened this issue 8 years ago • 5 comments

This is a feature request, I have more as a matter of fact, will open them separately.

Consider the following scenario:

  • reacting to someone insulting people; select offending text, press reply
  • the reply box opens with the offending text already quoted
  • activating the appropriate macro will overwrite the initially existing text; that needs to be copy/pasted in the macro dialog box.

This could be avoided if the macro text would be inserted after the existing text in the reply box, rather than overwriting the existing comments.This is a feature request, I have more as a matter of fact, will open them separately.

Consider the following scenario:

  • reacting to someone insulting people; select offending text, press reply
  • the reply box opens with the offending text already quoted
  • activating the appropriate macro will overwrite the initially existing text; that needs to be copy/pasted in the macro dialog box.

This could be avoided if the macro text would be inserted after the existing text in the reply box, rather than overwriting the existing comments.

multubunu avatar Feb 12 '17 14:02 multubunu

Hmm, maybe we could introduce a token for any text that's already in the reply box? That way you could set macros up to include that text wherever it's relevant, and you could type out the custom part before confirming the rest of the macro.

Would probably end up extending info around macros.js:433 - maybe name the new token something like replytext, could just insert something like:

info.replytext = $this.closest('.usertext-edit').find('textarea').text()

@creesch thoughts?

eritbh avatar Feb 12 '17 15:02 eritbh

The thing is, the macro doesn't overwrite whatever is in there... It opens up a popup you can move.

Having said that, a token for existing text is a good idea since in new modmail the macro will actually replace whatever is in the reply box...

We probably want the token to be part of TBUtils.getThingInfo if at all possible.

creesch avatar Feb 13 '17 08:02 creesch

Is putting it in there a good idea? The reply text isn't really a property of the link/comment in a strict sense.

eritbh avatar Feb 13 '17 14:02 eritbh

Hrm, that is true. It might indeed be more appropriate in the macro itself.

I am not even sure it should be a token to be honest, maybe "prepend/append text from textarea" as a button. Though rereading the use case he can probably simply use {body} as token most of the times.

Ah well... Let's go for a token at first in the macro module itself it is simplest thing to do.

creesch avatar Feb 13 '17 14:02 creesch

Eh, if you're quoting multiple lines of the body, just doing

> {body}

wouldn't work because it would only quote the first line and have the rest trailing off. So for this specific case, it makes sense to let Reddit do the quoting and then insert that.

I do like the idea of adding a button though - we could even make it "insert at current cursor position" or something so there's easier control over it.

eritbh avatar Feb 13 '17 14:02 eritbh