Lbry-desktop: In-app text and markdown publishing and editing

Created on 30 Apr 2020  路  21Comments  路  Source: lbryio/lbry-desktop

Currently markdown is well supported only if you prepare it via an external editor and upload a .md file directly.

It would be much better UX if a user could:

  1. Create a new post via the existing markdown editor directly in the app
  2. Edit previous text or markdown posts directly in the app
  3. Embed other LBRY content directly in the posts (add a custom button or parsing for lbry.tv embeds)

This will likely require somewhat separate code for lbry.tv and LBRY Desktop.

help wanted new feature

All 21 comments

50,000 LBC bounty for this if someone wants to do it

How would you guys want the UI to look? Would there be a new publish markdown button? The current publish just goes straight add a file via upload and I don't really see any tab pattern in the app already.

My off-the-cuff proposal:

  1. The toggles on this page can be used as tabs: https://lbry.tv/$/discover
  2. Insert tabs above file selector, below publish header (Show: File | Text)
  3. Use the same text editor for description to construct the markdown

In general, we're happy to do a pass on labeling or other presentation, so if you can get the core architecture and design correct, we're happy to make any final decisions on necessary icons, labels, etc on review and merge.

Cool will give it a shot this weekend.

How'd it go @jtwebman?

@kauffj Slower then I thought. The way that the upload page is built doesn't make it that easy. I need to re-think how I was going to do it.

@jtwebman if you're still actively working on it and it'd be helpful to chat with one of our team, just let me know

@kauffj Thanks, I am still working on it but this week was a little crazy at work so I didn't have as much time. I think I have a much better idea now on how to do it. If I have any questions I will ask for sure. I also will try and get a WIP Draft PR open so the team can take a look and make sure I am on the right path once I get some time tomorrow.

@kauffj Ok sorry to delay this. I think this is maybe too much for being new to the project for me to bit off. If anyone else wants to work on this please do.

@jtwebman all good, thank you for attempting the challenge :grin:

I hope you are enjoying LBRY

@kauffj I do very much and will keep trying to help out. It just been a long time since I have worked on the frontend.

I'm working on some minor improvements to the markdown editor, if nobody picks this one, I'll give it a try, either way I can provide help if needed :v:

@btzr-io would love to see you try this one, it's very desired feature https://twitter.com/squidlord/status/1260967812383805441

The bounty promised above still stands, worth about $2500 for someone to do this right now

@kauffj Ok, I can give it a try 馃憤

Initail refactioring for the filePublish component done here: https://github.com/lbryio/lbry-desktop/pull/4170, now it should be easy to set the current file from any component.

Those the bounty still stands ?

@btzr-io yes, bounty still stands. Would love to give it to someone I already know is talented :stuck_out_tongue:

Hi guys, I was curious on the technical side on how one would be implemented (wanted to get acquainted with the SDK).
I believe the publish API only accepts a file path file_path as a parameter. I was thinking of spewing the text editor's value to a temp file before publishing (so code changes would be minimal), but I think that would only work for Desktop.
Q: Does the API provide other file options? Alternatively, is there a standard way to write to temp file on the browser? (still new to the web programming).
Q: Same goes for the editing part (2nd checklist) -- is there an API to query the claim data as a string if the type is "text"?

Does the API provide other file options?

Idk, I don't think so

Alternatively, is there a standard way to write to temp file on the browser?

Yes, there are different ways to achieve this, there is a new web api specifically for this but is still experimental, you can create workspaces, folders and files etc..

You can also build a blob from a string:

new Blob(["text..."]], {type: 'text/plain'}); 

is there an API to query the claim data as a string if the type is "text"?

Yes you can just use the stream api from the lbry sdk, and fetch the stream data

Idk where are docs of the stream api...

https://github.com/lbryio/lbry-sdk/issues/1634

"streaming_url": "(str) url to stream the file using range requests"
http://localhost:5280/stream/63004f5578b24360b3c67cffa552d07a4a334375afb7972c8beb47b835a1cec86b7208dc17addf852377e6afb78b8b81

Lbry.tv has a similar endpoint for this.
https://lbry.tech/api/sdk#get

@kauffj This should be marked as closed.

Was this page helpful?
0 / 5 - 0 ratings