Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-app text and markdown publishing and editing #4105

Closed
kauffj opened this issue Apr 30, 2020 · 21 comments
Closed

In-app text and markdown publishing and editing #4105

kauffj opened this issue Apr 30, 2020 · 21 comments
Labels
help wanted type: new feature New functionality that does not exist yet

Comments

@kauffj
Copy link
Member

kauffj commented Apr 30, 2020

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.

@kauffj
Copy link
Member Author

kauffj commented Apr 30, 2020

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

@jtwebman
Copy link
Contributor

jtwebman commented May 1, 2020

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.

@kauffj
Copy link
Member Author

kauffj commented May 1, 2020

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.

@jtwebman
Copy link
Contributor

jtwebman commented May 2, 2020

Cool will give it a shot this weekend.

@kauffj
Copy link
Member Author

kauffj commented May 4, 2020

How'd it go @jtwebman?

@jtwebman
Copy link
Contributor

jtwebman commented May 4, 2020

@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.

@kauffj
Copy link
Member Author

kauffj commented May 7, 2020

@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

@jtwebman
Copy link
Contributor

jtwebman commented May 7, 2020

@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.

@jtwebman
Copy link
Contributor

jtwebman commented May 9, 2020

@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.

@kauffj
Copy link
Member Author

kauffj commented May 9, 2020

@jtwebman all good, thank you for attempting the challenge 😁

I hope you are enjoying LBRY

@jtwebman
Copy link
Contributor

jtwebman commented May 9, 2020

@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.

@btzr-io
Copy link
Collaborator

btzr-io commented May 9, 2020

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 ✌️

@btzr-io btzr-io added the type: new feature New functionality that does not exist yet label May 9, 2020
@kauffj
Copy link
Member Author

kauffj commented May 14, 2020

@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

@btzr-io
Copy link
Collaborator

btzr-io commented May 14, 2020

@kauffj Ok, I can give it a try 👍

@btzr-io
Copy link
Collaborator

btzr-io commented May 15, 2020

Initail refactioring for the filePublish component done here: #4170, now it should be easy to set the current file from any component.

@btzr-io
Copy link
Collaborator

btzr-io commented May 28, 2020

Those the bounty still stands ?

@btzr-io btzr-io self-assigned this May 28, 2020
@kauffj
Copy link
Member Author

kauffj commented May 28, 2020

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

@btzr-io btzr-io removed their assignment Jun 15, 2020
@infinite-persistence
Copy link
Contributor

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"?

@btzr-io
Copy link
Collaborator

btzr-io commented Jun 26, 2020

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...

lbryio/lbry-sdk#1634

@btzr-io
Copy link
Collaborator

btzr-io commented Jun 26, 2020

"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

@eatdostacos
Copy link
Contributor

@kauffj This should be marked as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted type: new feature New functionality that does not exist yet
Projects
None yet
Development

No branches or pull requests

6 participants