Skip to content

Disable number of unread in the title and favicon - #6590

Closed
sgzmd wants to merge 8 commits into
FreshRSS:edgefrom
sgzmd:disable-unread-title-favicon-6522
Closed

sgzmd wants to merge 8 commits into
FreshRSS:edgefrom
sgzmd:disable-unread-title-favicon-6522

Conversation

@sgzmd

@sgzmd sgzmd commented Jun 24, 2024

Copy link
Copy Markdown
Contributor

Closes #6522

DO NOT MERGE: see at the end for discussion

Changes proposed in this pull request:

  • Introduce new setting to show the number of unread items in the title, set to "On" by default
    image
  • When this checkbox is unchecked by the user, do not show the number of unread items in the title
  • Ditto favicon

How to test the feature manually:

  1. Ensure there are some unread RSS entries
  2. Navigate to Display settings
  3. Uncheck the icon
  4. Verify that title does not have number of unread items
  5. Verify that favicon is not overlayed with the number of unreads

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.


dear maintainers - I'm new to this project so still figuring out the ropes. I am trying to understand the best way to pass the configuration settings to JS code; so far I was able to identify that jsonVars maybe does what I need. Is there any example with modifying what is being sent to the client side?

Likewise, happy to add unit tests, but haven't quite figured how to do that - any links to existing PRs are highly appreciated.

@sgzmd
sgzmd force-pushed the disable-unread-title-favicon-6522 branch 2 times, most recently from 81a96ce to 0492530 Compare June 24, 2024 12:59
@sgzmd

sgzmd commented Jun 25, 2024

Copy link
Copy Markdown
Contributor Author

8674d91 illustrates how we can handle passing the value to the client code, but obviously it would be better to do it together with other variables.

@sgzmd
sgzmd marked this pull request as ready for review June 25, 2024 09:16
@Alkarex Alkarex added this to the 1.25.0 milestone Jun 25, 2024
@Alkarex Alkarex added the UI 🎨 User Interfaces label Jun 29, 2024
@Alkarex

Alkarex commented Jun 29, 2024

Copy link
Copy Markdown
Member

Quick fixes and refactoring - not tested

@Alkarex

Alkarex commented Jun 29, 2024

Copy link
Copy Markdown
Member

Thanks 👍🏻 . Hint for next time: try make fix-all and make test-all

sgzmd added 3 commits June 30, 2024 10:51
When user's config wasn't initialised we are copying it from `config-user.default.php` - if `show_title_unread` is not there, it is assumed to be false, whereas in `config.default.php` it's true by default. This results in inconsistency until user changes the field for the first time in Config->Display.
@sgzmd

sgzmd commented Jun 30, 2024

Copy link
Copy Markdown
Contributor Author

Dear maintainers - this has now been tested, few fixes applied and proper(-ish) translations added with the caveat that I don't speak most of the languages listed. Otherwise, I believe this is ready for review/merge.

@Alkarex Alkarex modified the milestones: 1.25.0, 1.26.0 Nov 30, 2024
@Alkarex Alkarex modified the milestones: 1.26.0, 1.27.0 Feb 6, 2025
@Alkarex Alkarex modified the milestones: 1.27.0, 1.28.0 Aug 18, 2025
@Alkarex Alkarex modified the milestones: 1.28.0, 1.29.0 Dec 16, 2025
Alkarex added a commit that referenced this pull request Apr 29, 2026
…8728)

Closes #6522.

Refresh of #6590 by @sgzmd, which has been stalled with merge
conflicts since 2024. All original commits are preserved as-is in the history
(authorship intact); this PR adds a merge with current `edge` plus minor fixes.

## Summary

Adds a user setting `show_title_unread` (default `true`, so existing behavior
is preserved) that hides the unread article counter from both the tab title
and the favicon overlay. A single toggle controls both, matching the request
in #6522.

## Screenshots

Toggle in display settings:

<img width="320" height="127" alt="Display settings with new toggle" src="https://github.com/user-attachments/assets/fc78f825-161d-4b47-9b85-08e39554a4b1" />

Tab title and favicon when **enabled** (current behavior):

<img width="253" height="42" alt="Tab title and favicon with unread counter" src="https://github.com/user-attachments/assets/57387600-72e0-4b22-b059-04b5bfea673a" />

Tab title and favicon when **disabled** (new behavior):

<img width="254" height="40" alt="Tab title and favicon without unread counter" src="https://github.com/user-attachments/assets/93ac7997-dd4e-49bc-ab4a-74e4f0d2db1b" />

## Changes on top of #6590

- Resolved merge conflicts with current `edge` (controllers, model, view,
  `config.default.php`, ~25 i18n files, plus the `zh-tw` -> `zh-TW` rename).
- Replaced Czech text mistakenly placed in `de/conf.php` with an English
  `// TODO` marker so a German speaker can translate later.
- Renamed JS context key `show_unread_favicon` -> `show_title_unread` to
  match the backend property and avoid a confusing dual-name for one setting.
- Removed an unused duplicate of `show_title_unread` from `config.default.php`
  (the setting is read via `userConf()`, never `systemConf()`).
- Gated the dynamic title rewrite in `incUnreadsFeed` (`p/scripts/main.js`)
  on the setting. Without this, marking an article read while the setting
  was off would re-add the `(N)` prefix to the tab title.
- Escaped a stray apostrophe in the Occitan translation that broke parsing.
- `make fix-all` re-sorted i18n keys and added `// TODO` placeholders for
  `fi`, `pt-PT`, `uk` (untranslated by the original PR).

## Test plan

- [x] `make test-all` passes (620/620 PHPUnit, phpstan, phpcs, eslint,
      stylelint, markdownlint clean; `bin/typos` failed locally with a binary
      arch mismatch on macOS arm64 - unrelated to this change).
- [x] Manually tested on a real instance: default behavior unchanged;
      toggling the setting hides both the tab title `(N) ` prefix and the
      favicon overlay; toggling back restores both; marking articles read
      while the setting is off does not bring the counter back; opening and
      closing an article preserves the user's choice.

* Make showing the number of unread items in the title configurable.

* Proposed approach to passing show_unread_favicon setting down to client-side code

* Fixes and refactoring

* Updating default config for the user.

When user's config wasn't initialised we are copying it from `config-user.default.php` - if `show_title_unread` is not there, it is assumed to be false, whereas in `config.default.php` it's true by default. This results in inconsistency until user changes the field for the first time in Config->Display.

* Adding translations.

* fix: gate JS title rewrite + drop dead system config entry

The original PR added show_title_unread to both config-user.default.php
(read by userConf, the right place) and config.default.php (read by
systemConf, never used here). Drop the system-level entry.

Also: incUnreadsFeed dynamically rewrites document.title when articles
are marked read/unread. That code path was not gated by the setting, so
toggling the setting off and then marking an article read would re-add
the (N) prefix to the tab title. Skip the document.title / prevTitle
write when context.show_title_unread is false.

* fix: drop README pollution from local make fix-all

`make fix-all` regenerated the README translation tables on macOS, where the
case-insensitive filesystem and an untracked local `app/i18n/nb/` directory
caused the generator to emit `zh-tw` (lowercase) and an `nb` entry. Reset
both README files to upstream/edge so CI can regenerate them cleanly.

* fix: restore zh-TW/conf.php from edge (case-insensitive FS damage)

The macOS case-insensitive filesystem caused the merge to overwrite
upstream/edge's properly-translated zh-TW/conf.php with the older
zh-tw/conf.php content from the PR side, regressing translation
coverage from 94% to 71%. Reset the file to edge's content and re-add
the show_title_unread Traditional Chinese translation.

---------

Co-authored-by: sgzmd <[email protected]>
Co-authored-by: Alexandre Alapetite <[email protected]>
Co-authored-by: Bjørn A. Andersen <[email protected]>
@Alkarex

Alkarex commented Apr 29, 2026

Copy link
Copy Markdown
Member

Merged via #8728

@Alkarex Alkarex closed this Apr 29, 2026
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] Disable unread article number indicator in favicon and tab title

2 participants