yarr icon indicating copy to clipboard operation
yarr copied to clipboard

Use item.content if title isn't available.

Open asimpson opened this issue 1 year ago • 3 comments

The current implementation uses item.title in the list of feeds and if item.title is empty it will display Untitled.

https://github.com/nkanaev/yarr/blob/b13cd85f0bf2c77a9e78dff6792a99b9f27d063c/src/assets/index.html#L285

This can lead to a lot of visual noise if you're following a "micro blog" or activity pub type feed that don't have titles.

image

I'm happy to provide a PR or keep this in a fork but my idea would be to use item.content. This would of course look terrible for most feeds, therefore I think this should be a setting like Auto Refresh, e.g. Use content as title.

asimpson avatar May 20 '24 15:05 asimpson

I'm happy with showing the content, but it must be sanitized/cleaned and truncated. Feel free to provide a PR and I'll have a look.

nkanaev avatar Jun 06 '24 11:06 nkanaev

One thing to note is that the /api/items endpoint doesn't return content field of the articles. The reasoning is because some feeds' content is large, and was omitted from the results to make API loads faster.

With that in mind, title either needs to be populated during writing (storing to the db) or during read (fetching via API) in the backend.

nkanaev avatar Jun 07 '24 12:06 nkanaev

Still thinking about this. A few interesting display rules from micro.blog.

  • If the post has no title and is 300 characters or less, the text is shown directly in the Micro.blog timeline.
  • If the post has no title and is over 300 characters, the text is truncated with a link back to the full post on your site.
  • If there’s a title and it looks like a date or number, Micro.blog ignores it, as if there were no title. It then tries to show the text in the timeline.

asimpson avatar Sep 20 '24 14:09 asimpson

implemented in https://github.com/nkanaev/yarr/commit/ad138c3017832f14ae452969816f9e4e7ce5237e

nkanaev avatar Dec 04 '24 21:12 nkanaev

Wow, I honestly didn't expect you to do this work! Thank you so much! I've already tested this out and it looks great 🏆.

asimpson avatar Dec 05 '24 00:12 asimpson