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

Empty bookmark titles should display url instead #143

Closed
jeffsikes opened this issue Oct 9, 2023 · 2 comments
Closed

Empty bookmark titles should display url instead #143

jeffsikes opened this issue Oct 9, 2023 · 2 comments

Comments

@jeffsikes
Copy link
Contributor

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.

  • Home screen - listing of bookmarks
  • Bookmark Post view at /bookmark/{id}
  • Bookmarks XML feed at /index.xml

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.

  • On Add and Edit Bookmark forms, make url a required field with an input type of url (too strict?)
  • Create a helper function to determine if the title is blank or an empty string, and on any user facing view, display the bookmark URL instead
  • Update the Home screen, Bookmark view and Bookmark Xml Feed to use the helper function

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
Copy link
Owner

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
Copy link
Owner

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

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

No branches or pull requests

2 participants