damus icon indicating copy to clipboard operation
damus copied to clipboard

New feature: Polls

Open 0xtlt opened this issue 3 years ago • 18 comments

Hello everyone,

I have developed a poll feature for Damus that uses Nostr's reaction kind 7 to allow for voting.

In Damus options, the user can choose to see the votes of their friends as well as their friends' friends, or from everyone. By default, it is set to friends + friends' friends to prevent bots from spamming opinions.

It is now possible to create polls directly from the post writing panel.

I have also included a fix in this PR that prevents Damus from associating any reaction to a like, which was previously the case even if it was a thumbs down for the example.

I hope you enjoy it, I have also included a screenshot here:

Simulator Screen Shot - iPhone 14 Pro - 2023-01-04 at 17 13 30

0xtlt avatar Jan 04 '23 16:01 0xtlt

Nice :-)

BenGWeeks avatar Jan 04 '23 19:01 BenGWeeks

interesting...

jb55 avatar Jan 05 '23 18:01 jb55

why not just make it a different kind? it feels wrong using reactions for this.

jb55 avatar Jan 05 '23 18:01 jb55

I will try making a new NIP for that, just at the moment, I thought it wasn't necessary :)

0xtlt avatar Jan 05 '23 18:01 0xtlt

Working on the NIP right now :)

0xtlt avatar Jan 05 '23 18:01 0xtlt

we don't need a NIP yet, we just can just choose something and spec it after

jb55 avatar Jan 05 '23 19:01 jb55

but if you want to go for it lol

jb55 avatar Jan 05 '23 19:01 jb55

agreed, go and we gonna support both in the future if poll nip is accepted @jb55

0xtlt avatar Jan 05 '23 19:01 0xtlt

I added the code of the NIP 41, when it will be accepted, I will change again the code if needed it will be ready to be merged :)

0xtlt avatar Jan 06 '23 18:01 0xtlt

NIP 41 ref: https://github.com/nostr-protocol/nips/pull/148

0xtlt avatar Jan 06 '23 18:01 0xtlt

Would look cool with the linear gradient for the bars :-)

LinearGradient(gradient: Gradient(colors: [
    Color("DamusPurple"),
    Color("DamusBlue")
]), startPoint: .topTrailing, endPoint: .bottomTrailing)

BenGWeeks avatar Jan 08 '23 23:01 BenGWeeks

Would look cool with the linear gradient for the bars :-)

LinearGradient(gradient: Gradient(colors: [
    Color("DamusPurple"),
    Color("DamusBlue")
]), startPoint: .topTrailing, endPoint: .bottomTrailing)

Will add it today, thanks :)

0xtlt avatar Jan 09 '23 07:01 0xtlt

What does the Ui look like whilst creating the poll?

BenGWeeks avatar Jan 09 '23 08:01 BenGWeeks

simulator_screenshot_EF8E53E7-0C0D-4963-B9A2-656095C0DD71

@BenGWeeks

0xtlt avatar Jan 09 '23 09:01 0xtlt

With regards to the post button - was thinking better UX/UI would be to display but greyed out until created a message? (As apposed to hide, where I've thought to myself "if i write this message how will I be able to post it?")

BenGWeeks avatar Jan 09 '23 09:01 BenGWeeks

With regards to the post button - was thinking better UX/UI would be to display but greyed out until created a message? (As apposed to hide, where I've thought to myself "if i write this message how will I be able to post it?")

Will add it too :)

0xtlt avatar Jan 09 '23 10:01 0xtlt

(That's generic to all posts)

BenGWeeks avatar Jan 09 '23 10:01 BenGWeeks

this needs to be its own view instead of putting in eventview

jb55 avatar Jan 10 '23 18:01 jb55

closing this for now since it's pretty out of date

jb55 avatar Jul 31 '23 19:07 jb55