Skip to content

feat: create config to display website icon only / name only / icon and name / none on feeds - #4969

Merged
Alkarex merged 5 commits into
FreshRSS:edgefrom
sad270:feat/config-for-website-display-on-feed
Mar 4, 2023
Merged

Alkarex merged 5 commits into
FreshRSS:edgefrom
sad270:feat/config-for-website-display-on-feed

Conversation

@sad270

@sad270 sad270 commented Dec 30, 2022 •

Copy link
Copy Markdown
Contributor

Closes #4838

Hello, I create this PR in draft, I'm open to review (codestyle, naming, other idea), it's my first real PR (with real code).

To be consistent with existing code for the topline_thumbnail (I copy it). I didn't use constants for full, none, name and icon values, but IMHO we should use constant for both config. If you are ok with this I can use constant for website and do the refactor for the thumbnail.

I want to create a enum for the values, but it's not available in PHP 7.

I don't know how translation works, I copy/past for all language (in no brain mode !). I see some po/pot files in project, maybe there is a translation tools ? if not I can add french translation in this PR directly.

I didn't run tests and quality tools, my dev env is not working, I will try again later.

Changes proposed in this pull request:

  • Create a new display setting where you can select to display icon only or name only or icon and name or none for website on the feeds view

How to test the feature manually:

  1. Open the homepage localhost:8080/i/ and check that website icon and label are visible by default.
  2. Go to settings, check the new Website settings is here.
  3. Change the website value and save.
  4. Go back to homepage to verify that website display has changed.

Screenshots

The settings view :

Screenshot 2022-12-30 at 04 46 08

Feed in full view (default) :

Screenshot 2022-12-30 at 04 51 37

Feed in none view :

Screenshot 2022-12-30 at 04 47 46

Feed in icon view :

Screenshot 2022-12-30 at 04 48 19

Feed in name view :

Screenshot 2022-12-30 at 04 51 03

Pull request checklist:

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

Additional information can be found in the documentation.

@Alkarex Alkarex added this to the 1.21.0 milestone Dec 31, 2022
Comment thread app/i18n/fr/conf.php Resolved
@sad270
sad270 force-pushed the feat/config-for-website-display-on-feed branch from d28a53d to 162ab6d Compare January 8, 2023 19:03
@sad270

sad270 commented Jan 8, 2023

Copy link
Copy Markdown
Contributor Author

I rebase on edge and add some translation.
I see for using constant. It's a little bit difficult. The best think to do IMO, is to use a ValueObject, and store the availlable choices in this ValueObject (as constant).

I want to add a WebsiteConfiguration object in Models/Configurations (and step by step do the same for all configurations), but I need to change the autoloader. IMO this is too big for this MR, in must be done (if we want to do this) in another MR.

The autoloader is weired, why you don't use namespaces ? and why you don't use composer for no-dev dependencies ?

@sad270
sad270 marked this pull request as ready for review January 8, 2023 19:11
@sad270
sad270 force-pushed the feat/config-for-website-display-on-feed branch from 162ab6d to 0027160 Compare January 8, 2023 19:12
@Alkarex Alkarex added the UI 🎨 User Interfaces label Jan 9, 2023
@math-GH

math-GH commented Jan 11, 2023

Copy link
Copy Markdown
Contributor

There is an issue with the title hover:
hover

because of the max-width, that calculates with the width of the website column
image

@Frenzie

Frenzie commented Jan 11, 2023

Copy link
Copy Markdown
Member

The CSS in your screenshot doesn't seem to make much sense. Looks like it should just be removed completely?

@math-GH

math-GH commented Jan 12, 2023

Copy link
Copy Markdown
Contributor

The CSS in your screenshot doesn't seem to make much sense. Looks like it should just be removed completely?

It is needed to cut the title. If the title will not be cut than it will overflow and a x-axis scroll bar will appear
image

@Frenzie

Frenzie commented Jan 12, 2023 •

Copy link
Copy Markdown
Member

I said the CSS, not the max-width. But okay, so the intended behavior on the current default style is as follows:
image
(top not hovered, bottom hovered)

@math-GH

math-GH commented Jan 14, 2023

Copy link
Copy Markdown
Contributor

I said the CSS, not the max-width. But okay, .....

Please help me to understand you. Which CSS does not make sense?

@Frenzie

Frenzie commented Jan 14, 2023

Copy link
Copy Markdown
Member

Given the context that was available at the time, the entire thing.

@math-GH

math-GH commented Jan 14, 2023

Copy link
Copy Markdown
Contributor

I have an idea:
I would add a CSS class (f.e. noWebsite, onlyIcon, onlyWebsite) to <ul class="horizontal-list flux_header"> and would solve it with CSS instead of manipulation of the DOM in .phtml. Then CSS could solve the :hover .item.title issue.

@sad270 If you would allow I could support here with commits

@sad270

sad270 commented Jan 14, 2023

Copy link
Copy Markdown
Contributor Author

I have an idea:
I would add a CSS class (f.e. noWebsite, onlyIcon, onlyWebsite) to <ul class="horizontal-list flux_header"> and would solve it with CSS instead of manipulation of the DOM in .phtml. Then CSS could solve the :hover .item.title issue.

@sad270 If you would allow I could support here with commits

It's open source, and my PR is open source too 😁 feels free if you want to contribute.

I already add a css class on the 'item website' element with the selected option value if it can help.
If not, maybe remove the classname I add on 'item website' add it on the 'ul' element as you said. And use this new classes ?

@math-GH

math-GH commented Jan 14, 2023

Copy link
Copy Markdown
Contributor

I made a commit. Please check.

@sad270

sad270 commented Jan 15, 2023

Copy link
Copy Markdown
Contributor Author

@math-GH I'm sorry I think I didn't understand what you said. I understand that you want to remove the date on hover, so you need to add the config in a parent element to be able to apply css rules on other column.
I don't think that was a good idea to manage the displaying of icon / website name in the CSS. Why should we add the website name and the favicon when not needed to display ?

I don't understand your problem. Why don't you remove the CSS ? If I remove max-width and position: absolute rules like this.

.flux:not(.current):hover .item.title {
	background-color: inherit;
}

Everything works good for me. And they seems to be useless ? Maybe legacy rules ?

Note: I will update and force push my branch. I will rebase your commit and mine to have them after the commit from edge branch. And fix type in french translation ;)

@Frenzie

Frenzie commented Jan 15, 2023 •

Copy link
Copy Markdown
Member

Everything works good for me. And they seems to be useless ? Maybe legacy rules ?

The default display is single line. See #4969 (comment)

I greatly prefer multiline but in any case it's not useless at this time. How much added value there is to showing a mere handful of extra chars is certainly debatable though, and I'd also rather just remove those lines.

@sad270
sad270 force-pushed the feat/config-for-website-display-on-feed branch from ee18531 to bf1d5f1 Compare January 15, 2023 16:57
@math-GH

math-GH commented Jan 15, 2023

Copy link
Copy Markdown
Contributor

I don't think that was a good idea to manage the displaying of icon / website name in the CSS. Why should we add the website name and the favicon when not needed to display ?

You are right. I reverted it

@sad270

sad270 commented Jan 15, 2023 •

Copy link
Copy Markdown
Contributor Author

@Frenzie how do you do to have the view in your comment ? Do you add custom css ? I try différents config' with différents width of screen ? I didn't have your the same behavour you have in your screen.

@sad270

sad270 commented Jan 27, 2023

Copy link
Copy Markdown
Contributor Author

@Frenzie up ?

@Frenzie

Frenzie commented Jan 27, 2023

Copy link
Copy Markdown
Member

While I do use custom CSS, I use it to make it look like this:
image

The behavior I showed in the screenshots is the default.

@sad270

sad270 commented Feb 1, 2023

Copy link
Copy Markdown
Contributor Author

@Frenzie I didn't have this behavour by default => #4969 (comment)
@math-GH I didn't have this behavour by default => #4969 (comment)

How did you do (what is your settings) to have this ? If it is custom css, send the custom css you added to have this. I will try to reproduice this and help you to fix it. I didn't understand if my code isn't good or the custom CSS may be updated.

@Frenzie

Frenzie commented Feb 1, 2023

Copy link
Copy Markdown
Member

The behavior in #4969 (comment) is the default, not custom. Perhaps you mean you don't have it due to the changes in this PR?

Comment thread app/i18n/fr/conf.php Resolved
@Alkarex

Alkarex commented Feb 6, 2023

Copy link
Copy Markdown
Member

@Frenzie and @math-GH : Could you please help me with a quick status here. Do you still have any pending suggestion / comment ?

@Frenzie

Frenzie commented Feb 7, 2023

Copy link
Copy Markdown
Member

I don't mind changing the behavior if it's a conscious decision.

@math-GH

math-GH commented Mar 2, 2023

Copy link
Copy Markdown
Contributor

As far as I can oversee it is okay now

@Alkarex Alkarex modified the milestones: 1.21.0, 1.22.0 Mar 4, 2023
@Alkarex
Alkarex merged commit d3966be into FreshRSS:edge Mar 4, 2023
@sad270
sad270 deleted the feat/config-for-website-display-on-feed branch March 4, 2023 13:52
@math-GH math-GH mentioned this pull request May 28, 2023
Alkarex pushed a commit that referenced this pull request May 10, 2026
Two narrow @media rules in base-theme/frss.css predate the configurable topline_website modes from #4969 and force icon-only behavior regardless of the user's Website setting; #8631 partially papered over this for grid-layout entries. Drop the unconditional span-hide and its grid-layout exception, and scope the 40px width cap to .websiteicon (with a comment explaining why it stays at narrow).

Co-authored-by: Bjørn A. Andersen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI 🎨 User Interfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Hide feed title in normal view

4 participants