FreshRSS / FreshRSS/FreshRSS

[Feature] Better Feeds Tagging System

Open
#8,653 1 comment 0 reactions 0 assignees View on GitHub
Feature Request
Dominant language
PHP
Stars
16k
Forks
1.3k
Avg merge
13h 24m
Merged PRs (30d)
40

Description

Current labeling and user query system allow user to do things like below:

- **Search & filter feeds** based on custom filters
- Automatically **add label new articles of a feed** by custom filters
- **Mark new articles as read** by custom filters and other settings

However, **things become quite hard when we try implementing "tagging" logical structure using FreshRSS label system**. Let's see an example below:

# Implement Feed Tagging by Label

## Initialization

Consider our logical tag structure is as below:

| FeedID | Feed | Logical Tags |
| ------ | ----------------------------- | -------------------- |
| 1 | FreshRSS GitHub Issue | `github`, `selfhost` |
| 2 | GitHub Dependencies Alerts | `github`, `notice` |
| 3 | Selfhost Server States Update | `selfhost`, `notice` |

The most intuitive way to achieve such "tagging" structure in current version of FreshRSS is to use **label system**.

| Label Name | Label Filters |
| ---------- | ------------- |
| `github` | `f:1,2` |
| `selfhost` | `f:1,3` |
| `notice` | `f:2,3` |

Looks good until we start considering following cases.

## Add / Remove Multiple Tags to / from Feed

Consider we need to add a new feed "FreshRSS Security Updates" *(let's say its feed id is `4`)*, which need to be tagged as `github`, `selfhost` and `notice`.

The **complexity goes up if there are lots of "tags" we want to add to a new feed**. In case above, we need to go to the settings of 3 different labels and update their filters expression to add `4` to the feed id filter.

| Label Name | Label Filters |
| ---------- | ------------- |
| `github` | `f:1,2,4` |
| `selfhost` | `f:1,3,4` |
| `notice` | `f:2,3,4` |

Similar operations required when we want to remove multiple tags from a feed. Also, it would be a disaster if I somehow need to delete and re-add a feed which has lots of tags.

# My Opinion

## About the ID Filter

Personally, I think **it's not a very good idea to allow users to hardcoded the unique id of the feeds/categories/labels into the filter expression** which will be stored into the FreshRSS system to achieve some automation work. Two major reasons for this:

- Not quite elegant.
- **Users are generally more familiar with the "name" of the feeds/categories/labels than IDs of them.** So we user need to filter by feeds/categories, since there is no "filter by feed name/filter by category name" filter, user need to first work out all IDs of relevant feeds/categories before writing filter expression.
- It could be a more elegant and more convenient approaches to allow users to select these instances. Like a text input UI with dropdown multi-selection & auto-completion based on the name of those feeds/categories/labels. *(Though, I know this may not feasible consider the high complexity of the filter system)*
- IDs could expire.
- If those feeds/categories/labels got deleted. In this case, there's no sense that their ID still appears in the filter expressions *(even if these "dummy" id may not affect the actual filter result of the filter, it's just not elegant)*. It's like require user to manage something like "foreign key" manually.
- Another way to address this may be some "cascade deletion" feature. For example, when a feed with id `x` is about to be deleted, system will check all filter expression used in user query/label filter etc. and inform user "Corresponding Feed ID will be removed in following filters: ..." and automatically remove those unused ID in filter expressions in the system.

## About How Labeling Works

The major inconvenient, as illustrated in the above example, is the complexity of the operations. **If we need to modify `n` tags of a feed, we need to update `n` different query expression in `n` different label settings.**

One better way may be to allow user to operate in another direction: Allow user to specify target label/tag in feed settings.

For example, there could be some settings for feed like:

- **Add following tags to all articles of this feed**: (a list separated by comma or something, like: `github,issue,selfhost`)
- Add following label to all articles of this feed: (a list separated by comma or something, like `label1,another_label_name`, label ID may also be allowed here, like `1,3,4,7`)

By adding this design, we only need to modify settings in one place when we want to edit the tags of a feed.

-----

Above are just some of my own personal thought and there could be some better approaches to solve such issue. I believe tag-like structure is really a common use case and there should be a convenient way for users to achieve that.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.