nudge icon indicating copy to clipboard operation
nudge copied to clipboard

Feature request: random text strings

Open shoopdawoop opened this issue 3 years ago • 1 comments

Would it be possible to introduce alternative text strings for certain fields to be discplayed randomly?

So e.g. instead of a single string

"mainHeader": "Your device requires a security update",

we could have an array of strings

"mainHeader" : [ "Your device requires a security update", "We've been trying to reach you to talk to you about an important software update", "I heard you liek updates?" ],

and the internal logic would randomly pick one of the available strings?

The idea is to make these messages a little less repetitive. I am thinking, perhaps make them a bit funny, so hopefully some users might even look forward to reading them ... (one can dream, right?).

shoopdawoop avatar Dec 04 '21 11:12 shoopdawoop

It's an interesting feature request but one I don't think I'm willing to code.

  1. The preference logic in Nudge is one of the most complex parts of the code to handle remote JSONs, local JSONs, mobile configurations and both json/mobileconfig deployed at the same time.
  2. I would either have to make a breaking change to everyone's configs (and make the code more complex) or significantly increase the code complexity to support both a single string or a list of strings.
  3. You can already technically do this if you create a custom script that dynamically changes the JSON configuration or dynamically using web JSONs.
  4. It may not fix the user experience you describe, which you also note.

Given that you could satisfy your own use case with scripting, my vote is to do that. It requires no additional code complexity on my end, no breaking changes for the hundreds of thousands of devices using nudge and could be deployed next week with a little ingenuity on your part.

I will leave the issue open in case others say they'd like this feature as well, but as I said, without significant interest in this, unless someone sends a pull request to do it, I will unlikely add this in.

erikng avatar Dec 05 '21 13:12 erikng