Project

General

Profile

Actions

Task #3056

closed

update Planet software/theme

Added by Florian Effenberger over 4 years ago. Updated almost 4 years ago.

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

100%

Tags:

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
Actions #1

Updated by Beluga Beluga about 4 years 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

Actions #2

Updated by Beluga Beluga about 4 years 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.

Actions #3

Updated by Florian Effenberger about 4 years 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!

Actions #4

Updated by Beluga Beluga about 4 years 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.

Actions #5

Updated by Beluga Beluga about 4 years 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">
Actions #6

Updated by Beluga Beluga about 4 years 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.

Actions #7

Updated by Guilhem Moulin about 4 years 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!

Actions #9

Updated by Guilhem Moulin about 4 years 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.

Actions #10

Updated by Guilhem Moulin almost 4 years ago

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

Applied to production, closing.

Actions

Also available in: Atom PDF