Project

General

Profile

Task #3056

update Planet software/theme

Added by Florian Effenberger about 1 year ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Team - Q1/2020
Start date:
Due date:
% Done:

100%

Tags:
URL:

Description

The task is to update the Planet software/theme to allow selecting feeds, just as https://planet.gnome.org allows (at the bottom)


Files

planet-filter.zip (9.08 MB) planet-filter.zip Static demo for Planet filter Beluga Beluga, 2020-04-04 19:07

History

#1

Updated by Beluga Beluga 10 months ago

Before we continue thinking about this, I would like to hear about the origin of this task. Who asked for this?

Personally I find this feature completely useless. The fact that the feature on Planet GNOME has apparently been broken for a long time tells me that nobody is using it. It smells of a solution looking for a problem, really.

These planet-type applications aim to provide a curated experience of feed reading. A change like this would be a hacky move towards personalised feed management.

In the case that some real actual person wants this, I would not try to hack this on top of our existing planet, but look into Pluto and make a feature request for it: https://github.com/feedreader

#2

Updated by Beluga Beluga 10 months ago

The more I think about this, the more I want to say WONTFIX. Anyone needing this level of control should subscribe to TDF planet using a dedicated feed reader and do the filtering there. There are plenty of options in this space, not only for desktop & mobile, but self-hosted web apps and browser extensions.

#3

Updated by Florian Effenberger 10 months ago

Before we continue thinking about this, I would like to hear about the
origin of this task. Who asked for this?

Me :-)

Personally I find this feature completely useless. The fact that the
feature on Planet GNOME has apparently been broken for a long time tells
me that nobody is using it. It smells of a solution looking for a
problem, really.

[..]

In the case that some real actual person wants this, I would not try to
hack this on top of our existing planet, but look into Pluto and make a
feature request for it: https://github.com/feedreader

If it's broken on Planet GNOME, I am indeed sceptical about replicating
it on our system. However, I don't mind giving our Planet a revamp. Can
we setup a Pluto test instance and have a look? If it at the same time
improves the design and responsiveness of the page, that'd be a win!

#4

Updated by Beluga Beluga 10 months ago

Backend changes needed to build something similar to the GNOME solution:

1. The <div class="channelgroup"> elements need an additional class name to associate them with the author. Could be just a lowercased author name with spaces replaced with underscores, examples: libreoffice_design_blog, official_tdf_blog
2. Daily cron job generating an authors.js file having an object like this containing all the authors:
var authors = {
"libreoffice_design_blog": "LibreOffice Design Blog",
"official_tdf_blog": "Official TDF Blog",
};

I can prototype this offline already on the client side.

#5

Updated by Beluga Beluga 10 months ago

Scratch that number 2 from my previous comment. We already have the authors list visible in the sidebar, so there is no need for much gymnastics. This is enough:

The li elements should have classes corresponding to the blog authors like

<li class="libreoffice_design_blog">
#6

Updated by Beluga Beluga 10 months ago

Attached is my static prototype.
It includes a screenshot of how things look like, when you hide all authors on the page - just to demonstrate the fundamental hackiness of this approach.

No external libraries are used. The JS does not work in IE11, because I wanted to minimise the investment in this hackery.

If you want to test the cookie functionality, you can erase the cookie by giving this in your browser's dev tools console:

document.cookie = "hidden=0;max-age=0";

The authors who happened to be featured on this planet snapshot:

"Andreas Kainz"
"CIB News"
"Collabora Community"
"LibreOffice QA Blog"
"Luboš Luňák"
"Marius Popa"
"Michael Meeks"
"Miklos Vajna"
"Official TDF Blog"
"Roman Kuznetsov"
"Tamás Bunth"
"Tamas Zolnai"
"Tomaž Vajngerl"

For Guilhem: I checked and there is actually no need to normalise unicode characters for use with HTML & CSS. Only NUL and space characters can not be used. It would have been a potential problem anyway, because possibly some author name could be in CJK form and normalising those naively would result in an empty string (with Python unicodedata.normalize at least).

So the only thing that needs to be done for the class names is to replace spaces with underscores.

#7

Updated by Guilhem Moulin 9 months ago

  • Status changed from New to Feedback

For Guilhem: I checked and there is actually no need to normalise unicode characters for use with HTML & CSS.

However AFAICT escaping is required before updating the cookie.

So the only thing that needs to be done for the class names is to replace spaces with underscores.

The template logic doesn't allow easy transliteration, but exposes an automatic variable “css-id” (which seems to be the lower-case feed name with hyphens instead of spaces) so I just used that. Applied some minor fixed and exposed the result to https://planet.documentfoundation.org/authorfilter/ . Thanks!

#9

Updated by Guilhem Moulin 9 months ago

Regarding escape() and unescape(), apparently we should not be using them, but rather these:

Thanks for the links (my JS-fu isn't stellar :-P), replaced encode() (resp. decode()) with encodeURIComponent() (resp. decodeURIComponent()) as its semantics seem appropriate for this use-case.

#10

Updated by Guilhem Moulin 9 months ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

Applied to production, closing.

Also available in: Atom PDF