diamsa / nostrbounties

A nostr client for finding and posting Bounties
https://nostrbounties.com
MIT License
22 stars 11 forks source link

Add ability to set a comment when adding additional bounty #10

Closed erskingardner closed 1 year ago

erskingardner commented 1 year ago

This is related to this bounty.

--

Preview of the changes on the individual bounty page: image

Goals I wanted to give users the ability to add their own notes when they are adding more to a bounty.

Changes

  1. I've made the additional bounty amount a #reward tag on the kind: 1 note. I described some of the tradeoffs in this comment. But I've tried to make sure that older notes with the amount in the content field are handled well here.
  2. I've added prettier, which explains the large number of files changed. Sorry about the larger changeset but this should make sure that new contributors have a more consistent experience (with smaller changes).

Questions

  1. Should we additionally add a link back to the original bounty in the text content? Or should we simply allow clients to show these as a reply on the original note? I think this was more along the lines of the original bounty and it's doable but wanted to get thoughts.
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
nostrbounties ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 28, 2023 at 3:43PM (UTC)
diamsa commented 1 year ago

hey! i am reviewing the changes and found a bug in the total sats pledged by the user component, it is returning NaN NostrBounties_ complete tasks and get paid with Bitcoin â‚¿ - Brave 27_03_2023 9_52_36 (2)

My first thought is, why if instead of using a new tag to describe the reward, do we use that tag for the note and keep content as the number of sats pledged? Did you think about that?

In regard to your question, i think we could keep it as a reply to the original note

erskingardner commented 1 year ago

Thanks @diamsa – good catch on that bug – I'll sort it shortly.

I did think about putting the text content in the tag instead of the content but given the content is what you'd expect to see when displaying a kind: 1 event I went with that version. I'm curious to know more about why the amount is in the content field. Maybe I'm overlooking something?

My question was more related to the idea of doing something like the following:

  1. User adds 123 sats to a bounty and leaves a note saying, "I'm excited to add to this bounty".
  2. We would put the amount in a tag (as I've done here) and, in the content field, we'd put the note content + a pre-formatted message. So the end result would be something like: "content": "I just added 123 sats to #[0]. I'm excited to add to this bounty" where the #[0] is a link to the bounty itself.

What do you think?

diamsa commented 1 year ago

@erskingardner honestly, i didn't pay attention to the fact that this kind 1 was going to be displayed in other clients and that it needed to be more descriptive.

NostrBounties_ complete tasks and get paid with Bitcoin â‚¿ - Brave 27_03_2023 11_17_52 (2)

I am working on the UI to display the people who pledged new sats as in the image above. What about setting the poster note in a tag, called it posterMessage, and putting content with a pre-formatted message ("content": "I just added 123 sats to #[0]) as you said? I think This approach could give us more freedom to customize the UI while still being descriptive to other clients, doesn't it?

diamsa commented 1 year ago

My idea in the UI is to display the message as Diamsa just added 123 sats to #[0], with a message that says [posterMessage Tag], what do you think?

erskingardner commented 1 year ago

Did you look at how I changed that list of additional rewards? There is a new design on my branch.

We can have the UI in the app show something slightly different to what is published in the kind: 1 note, so it probably makes sense to think of it as separate things.

To me, I think it makes the most sense (even though it's more complicated) to move the amount to a tag and use the content field for the message that the user writes. This allows other clients to display something that makes a bit more sense. They won't know how to parse these kind 1 notes and the app will just be creating notes for people that are showing a number. Doesn't feel like a great experience to me.

In the UI of the app I like the message that you have above but we can easily construct whatever copy we want from the event data. How about:

Diamsa just committed an additional 123 sats to #[0], with the following message: [message - from content]

EDIT: Now that I've thought about it for a few more minutes, maybe we should just put the entire text above in the note content field. That would be super clear if other clients rendered it and would link more people back to the bounty.

diamsa commented 1 year ago

great! sounds good to me. I think the copy for content as above is fine.

erskingardner commented 1 year ago

Cool – I'll update this PR when I get the changes made.

erskingardner commented 1 year ago

@diamsa – I think I've sorted everything we talked about – let me know what you think.

erskingardner commented 1 year ago

image

Accidentally published to a live relay but it's a good indication of what it will look like in real usage. The root event is missing because it was only published to my local relay.

diamsa commented 1 year ago

hey @erskingardner! I am checking the changes ;)

diamsa commented 1 year ago

image

Accidentally published to a live relay but it's a good indication of what it will look like in real usage. The root event is missing because it was only published to my local relay.

it is a good sign haha

erskingardner commented 1 year ago

🎉