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

feat: add a button to fetch post titles #828

Merged
merged 14 commits into from
Oct 28, 2023

Conversation

sharunkumar
Copy link
Contributor

@sharunkumar sharunkumar commented Oct 24, 2023

should resolve #817

currently uses proxying to fetch in case of PWA, due to CORS issues when doing it directly

image

@sharunkumar sharunkumar marked this pull request as ready for review October 24, 2023 18:38
@aeharding
Copy link
Owner

Thanks for the PR! Why not use getSiteMetadata like lemmy-ui, though?

@sharunkumar
Copy link
Contributor Author

sharunkumar commented Oct 24, 2023

Thanks for the PR! Why not use getSiteMetadata like lemmy-ui, though?

was not aware of this, will check it out 👀

update: implemented it but the title does seem different from the earlier implementation though:

image

src/features/post/new/PostEditorRoot.tsx Outdated Show resolved Hide resolved
src/features/post/new/PostEditorRoot.tsx Outdated Show resolved Hide resolved
src/features/post/new/PostEditorRoot.tsx Outdated Show resolved Hide resolved
src/features/post/new/PostEditorRoot.tsx Outdated Show resolved Hide resolved
@aeharding
Copy link
Owner

@sharunkumar I moved around the field a bit. Now, it displays "autofill" next to the title box after you've entered a URL, but not if you've already typed in the title field.

Let me know what you think.

@sharunkumar
Copy link
Contributor Author

@sharunkumar I moved around the field a bit. Now, it displays "autofill" next to the title box after you've entered a URL, but not if you've already typed in the title field.

Let me know what you think.

looks perfect 👍

@fer0n
Copy link
Contributor

fer0n commented Oct 27, 2023

Thanks for working on this :)

Regarding the implementation: there's an argument to be made that it should auto fill whenever the title is empty and a URL is entered. The button to trigger the auto fill could still be there, but wouldn't have to (makes the UI a bit cleaner without, but being deliberate has also advantages).

I'd personally go with auto fill an empty title (show a spinner in the title field while loading) and otherwise do nothing, but that's up to you.

@sharunkumar
Copy link
Contributor Author

it should auto fill whenever the title is empty and a URL is entered

this is there in the latest commit made by @aeharding

@fer0n
Copy link
Contributor

fer0n commented Oct 27, 2023

Ah, nice. Apologies for the comment then.

@aeharding
Copy link
Owner

Ah, nice. Apologies for the comment then.

It doesn't automatically fetch the post title - you still need to press the button.

I thought about that, however in some cases the request took an abnormal amount of time, so I opted not to. Once we have this in the wild we can totally revisit this though, it would be a very small change!

@aeharding aeharding merged commit ab6bbe0 into aeharding:main Oct 28, 2023
2 checks passed
@aeharding
Copy link
Owner

Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically fill article/video title when sharing a link
3 participants