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

Enhance content path feature #2778

Merged

Conversation

javerous
Copy link
Contributor

@javerous javerous commented Jan 20, 2020

Closes #2772

Changes proposed in this pull request:

  • Add ability to show a whole screen pop-up which don't automatically disappear (instead of notifications).
    • /p/themes/Origine/origine.css
    • /p/scripts/main.js
    • /app/layout/layout.phtml
  • Add ability to reload a whole feed and clear cache
    • /app/Controllers/feedController.php
    • /app/views/helpers/feed/update.phtml
    • /p/themes/icons/screwdriver.svg
    • /app/Models/Themes.php
  • Add ability to preview content path on first article of a feed, to check if it's correct
    • /app/Controllers/feedController.php // this is probably not the right place
    • /p/scripts/extra.js
    • /app/views/helpers/feed/update.phtml
    • /p/themes/icons/look.svg
    • /app/Models/Themes.php

How to test the feature manually:

  1. Use the new UI elements in feed configuration side panel.

Pull request checklist:

  • clear commit messages
  • code manually tested
  • unit tests written (optional if too hard)
  • documentation updated

Screenshots:

  • The preview button next to path field (the "eye" icon) + help moved on next line

Screenshot 2020-01-22 at 22 53 31

  • The popup UI which preview the result of the current content-path (no need to be saved to be able to have a preview, of course)

Screenshot 2020-01-22 at 22 54 35

  • The new Maintenance section with 2 actions - help is perhaps redoundant, or perhaps need to be enhanced

Screenshot 2020-01-22 at 22 52 36

@javerous
Copy link
Contributor Author

javerous commented Jan 20, 2020

For now, it's mainly a draft, to see if the core team is interested in the change. If yes, there is still a bunch of things to do (propagate translation, propagate CSS things, etc.)

  • I'm not a PHP / JS developer, so my JS changes are perhaps not the best way to do what I wanted to do. Though, I tried to follow what already exists.
  • There is a lot of security restriction with JS I didn't want to touch (and which I wasn't even aware it exists…) like onclick which can't be random JS anymore, apparently. It complexifies usage of JS, so as previous point, I did my best to make it work, without being (too) dirty.
  • The content path preview is generated by feedController.php, but it's probably not the right place to do it. Feel free to suggest a better place for this kind of helper / tools, without having to re-implement an authentication system, like with APIs. I added some suggestions in the code, under XXX comment.
  • I thought it would be a good idea to add a new Maintenance section in the feed configuration, which group a bunch of maintenances buttons. It's useful for this ticket, but I'm not 100% sure it's the best way to handle it.

About this last point, some extra thinking:

  • Once someone do "Delete all articles" in the archiving section, the entries are then very slowly (i.e. after a very long moment) refetched, because of the cache, at least on my tests. So this feature by itself was not very practical to reapply content-path to articles. Plus, it forces to remove all articles already fetched by FreshRSS, and some of them are not in the remote server feeds anymore, so it's a bit unfortunate to lost articles to be able to reapply content-path.
  • I wanted to add a checkbox next to the content-path field to force reapply the path to articles, but it looked a bit weird: it would have been just a temporary check box, as an extra parameter to the Submit, but for a UX point of view, it looked like a setting, which was confusing. So I thought it would be nice to have a dedicated button for that in a new "Maintenance" section: "Reload Articles". This button re-fetch everything (without removing articles already fetched), and then reapply path-content to every article in the feed. It can be time and bandwidth consuming, so perhaps this feature can be limited to admins ? At least, this was perfect for me.
  • I thought it would be fine to be able to clear the cache of feed (and not only automatic clearing), so I added a button in "Maintenance". It's not specifically linked to the ticket (even if it can be used to speed up re-fetch after an "Delete all articles"), but looked nice to have this kind of feature too.

@Alkarex Alkarex added this to the 1.16.0 milestone Jan 20, 2020
@Alkarex
Copy link
Member

Alkarex commented Jan 20, 2020

Thanks @javerous
At a quick first glance, it seems to look good 👍
I will try to test soon. Do not hesitate to post screenshots to get faster feedback from more people on the general concepts.

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what I think of the icons, especially because it looks a bit like an illustration. just a textual Preview button might be preferable.

@Frenzie
Copy link
Member

Frenzie commented Jan 20, 2020

Btw, you can just paste the JS into https://jshint.com/. You don't need to install it locally or wait for the CI.

@javerous
Copy link
Contributor Author

Not sure what I think of the icons, especially because it looks a bit like an illustration. just a textual Preview button might be preferable.

The textual button are so big… Perhaps can be a button with this icon but no text ? ^^'

What others are thinking about that ?

@javerous
Copy link
Contributor Author

Btw, you can just paste the JS into https://jshint.com/. You don't need to install it locally or wait for the CI.

Ah yes, think you ! It will help.

@Frenzie
Copy link
Member

Frenzie commented Jan 20, 2020

The textual button are so big… Perhaps can be a button with this icon but no text ? ^^'

Note that my main point is that you should make it look like a button, like these ones:

Screenshot_2020-01-20_11-31-37

Edit: In English

Screenshot_2020-01-20_11-33-03

@javerous
Copy link
Contributor Author

Note that my main point is that you should make it look like a button, like these ones:

Okay, I will try this.

@javerous javerous force-pushed the 2772-enhance-content-path-feature branch 2 times, most recently from 642ab41 to fa772d7 Compare January 20, 2020 11:25
javerous and others added 17 commits January 20, 2020 12:35
- Add a maintenance section to be able to clear cache and force reload a feed.
- Add an icon next to path field to show a pop-up with the result of the content path.
Co-Authored-By: Frans de Jonge <[email protected]>
Co-Authored-By: Frans de Jonge <[email protected]>
Co-Authored-By: Frans de Jonge <[email protected]>
Co-Authored-By: Frans de Jonge <[email protected]>
Co-Authored-By: Frans de Jonge <[email protected]>
…us/FreshRSS into 2772-enhance-content-path-feature
…in closure.

Use 'let' instead of 'var', as... it's better.
@javerous
Copy link
Contributor Author

javerous commented Feb 7, 2020

Okay, I think that this time, it's all done ! (the tests are failing because of some time-out, I don't think it's related to my last changes…)

cc @marienfressinaud

@marienfressinaud
Copy link
Member

I fixed some minor details I found while working on the style. The improved popup looks like this (don't pay attention to the small scrollbar glitch at the bottom of the popup, it was caused by the devtools):

Capture d’écran - 2020-02-07 à 18 15 55

Capture d’écran - 2020-02-07 à 18 16 12

I'm not totally satisfied with the controls box (maybe too grey?), but I think it's enough for now.

@javerous
Copy link
Contributor Author

javerous commented Feb 7, 2020

@marienfressinaud Yes, I was testing the changes right now. It's definitely better!

For the gray, I don't have special advice, it looks good to me (I'm not accustomed to see source code with white text on a dark background, but I think it's the most common).

[Edit] Oh, you were speaking about the gray of the controls box. It's perfect from my point of view.

@marienfressinaud
Copy link
Member

I didn't style specifically the source code, just reused what was done in the rest of the application :) If we change the style here, we should change it for code in the articles.

@marienfressinaud
Copy link
Member

Fixed for the dir="auto" 👍 Concerning the language, the same issue happens in the rest of the application. It will be at least true for the error messages and the controls ^^

@Frenzie
Copy link
Member

Frenzie commented Feb 7, 2020

Not exactly, the rest of the application has an actual application going on. :-P (But fair enough.)

@javerous javerous closed this Feb 10, 2020
@javerous javerous reopened this Feb 10, 2020
@marienfressinaud
Copy link
Member

If there's no new comments, I'll merge this PR before the end of the day :)

@Frenzie
Copy link
Member

Frenzie commented Feb 13, 2020

@marienfressinaud Like I said before, I could nitpick various things but I think it's good enough to merge. ;-)

@marienfressinaud marienfressinaud merged commit d30ac40 into FreshRSS:master Feb 13, 2020
@javerous
Copy link
Contributor Author

🎉

@javerous javerous deleted the 2772-enhance-content-path-feature branch February 13, 2020 17:42
@Alkarex
Copy link
Member

Alkarex commented Feb 29, 2020

Sorry for the late feedback. This is a great work :-)
One suggestion of improvement (I have not read the whole thread): If I understand correctly, the preview mode test against the Web site's home page, right?
However, the home page might not be the page on which to test the CSS path. An improvement could be to provide to either: a) expose a field on which to type an example of article URL; or b) automatically test on the latest article retrieved.

@javerous
Copy link
Contributor Author

javerous commented Feb 29, 2020

@Alkarex Thank you, it was a bit "laborious" (I don't know if it translates well), but mainly because I'm not a web developer ;p

One suggestion of improvement (I have not read the whole thread): If I understand correctly, the preview mode test against the Web site's home page, right?

No. I followed the suggestion from @Frenzie : I do the preview on the last article (i.e. the last retrieved) of the feed, so it should be okay (it's your "b" proposal, I think). I used the feature a bunch of time since, and it's very practical (okay, I'm perhaps not very impartial, but it helped me for sure).

A possible enhancement would be to be able to update the css path while we are inside the preview pop-up, but it seems too complex for me ;p

@Alkarex
Copy link
Member

Alkarex commented Feb 29, 2020

Great, testing more carefully on another feed indeed shows that it works as intended :-)

@Alkarex
Copy link
Member

Alkarex commented May 13, 2022

Slight refactoring in #4291

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

Successfully merging this pull request may close these issues.

Being able to flush / recompute entry content when changing "article CSS path".
5 participants