ckolderup / postmarks

a single-user bookmarking website designed to live on the Fediverse
https://postmarks.glitch.me
MIT License
467 stars 38 forks source link

Empty bookmark titles should display url instead #143

Closed jeffsikes closed 1 year ago

jeffsikes commented 1 year ago

These changes revolve around the title being blank, but a few other minor items were included in at the same time. :)

Item 1 - Displaying url when title is blank

Looking at #23 and the front end import UI, only one field is required for a bookmark, the url. In a few locations on the site, it assumes a title will be present and appears blank, which can look a bit odd on the client side.

Bookmarks can enter the system in multiple ways. The main point of entry via /add will set the title to "Untitled" if no title is entered and no opengraph title is found. But if you update through the Edit form, add through the PopUp form or the multi-import process (Multiadd), it may end up blank.

I am proposing the following changes that relate to this.

I chose not to replace with "Untitled" throughout because there isn't yet a foundation for i8n, and I didn't want to start dropping language specific text in the codebase if I could help it.

The same goes for the required field validation message. Right now in it's most simplistic form, the browser will determine the validation message and display in the browser's selected language.

Item 2: Description indentation upon federation

When a note is pushed to the ActivityPub outbox, a tab or several spaces were being passed along at the front of the description. This wasn't visible in Postmarks or the Mastodon Web UI, but prevalent in all other iOS apps I viewed (Ice Cubes, Ivory, Mona, Elk) I also removed the extra line breaks at the top.

description-indent

I updated the content section to remove the indent.

Item 3: Hyperlink classes and attributes upon federation

To better protect the user's privacy (this also matches Mastodon), I have added rel="nofollow noopener noreferrer" target="_blank" on the hyperlink that is created from the url and title in the ActivityPub content. This also opens the url in a separate window.

Pull request incoming with these changes.

ckolderup commented 1 year ago

thanks for the thorough report! There are a lot of form validation edge cases that need work, but I can see how the Title one in particular creates problems. Using the URL is a better option than "Untitled" for sure.

The other proposed changes also make sense to me.

ckolderup commented 1 year ago

closing, looks like your wording didn't get auto-tagged by Github's systems as connecting the two.