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

Allow saving of filters #401

Open
HollaG opened this issue Jan 28, 2025 · 5 comments
Open

Allow saving of filters #401

HollaG opened this issue Jan 28, 2025 · 5 comments
Assignees

Comments

@HollaG
Copy link
Contributor

HollaG commented Jan 28, 2025

Is your feature request related to a problem? Please describe.
There already exists two "default" custom views for users. Let's allow users to save a custom selection of filters.

Describe the solution you'd like
A save button can be provided (location TBC). This could open a dialog asking the user to choose a label. Upon save, this would appear in the current dropdown (for contributions / currently active). As we have no backend, we can potentially simply save the configs in localstorage (non-sensitive, anyway)

@HollaG HollaG added the category.Feature a new feature label Jan 28, 2025
@HollaG HollaG self-assigned this Jan 28, 2025
@Eclipse-Dominator
Copy link
Contributor

Eclipse-Dominator commented Feb 3, 2025

Good idea!

Right now, we can "transfer" filters via image URLs, as shown here. This means we could technically store all filters and repositories by saving the URL.
Image

Adding a customizable view is a good enhancement, but here are some key considerations:

  • What should be saved versus what can be saved?
  • Some filters depend on the repository. How should these be stored to ensure consistency?

Would love to hear your thoughts on how you'd approach handling such filters!

@HollaG
Copy link
Contributor Author

HollaG commented Feb 4, 2025

Some initial ideas~

  • As mentioned, we can store the url parameters (perhaps in LocalStorage - it doesn't have to be secure)
  • It should be repository-specific. We can allow users to set a custom name for the saved filter.
    a potential enhancement is that we can allow them to choose a default view / default filter to be applied on load
  • CR D operations should be allowed ( no need for update as they can simply delete the filter and re-add it)

we could use the following schema:
[in localstorage]
key=repositoryname
value: type

{ 
  name: String,
  filter: String // the url
}[]

@HollaG
Copy link
Contributor Author

HollaG commented Feb 4, 2025

Upon further inspection, there already exists a repo-url-cache-service.ts that caches repository names. We can make use of the same name to save the custom filters.

Image

@HollaG
Copy link
Contributor Author

HollaG commented Feb 5, 2025

Behaviour upon filters becoming invalid
Use case: when a label or milestone gets deleted / closed
Option 1: ignore and filter based on other options

  • this is the current behaviour, same when sharing URL

Option 2: Remove the saved filter set

  • THere is currently no behaviour implemented in the URL parser to tell if there is an invalid filter applied.
  • This could perhaps be a new PR to remove it from the URL as well upon detecting invalid filter

@nknguyenhc
Copy link
Contributor

Some initial ideas~

  • As mentioned, we can store the url parameters (perhaps in LocalStorage - it doesn't have to be secure)
  • It should be repository-specific. We can allow users to set a custom name for the saved filter.
    a potential enhancement is that we can allow them to choose a default view / default filter to be applied on load
  • CR D operations should be allowed ( no need for update as they can simply delete the filter and re-add it)

we could use the following schema: [in localstorage] key=repositoryname value: type

{ 
  name: String,
  filter: String // the url
}[]

Not sure if milestones and labels are a strong-enough reason for making preset filters repo-specific, but making the preset filters repo-specific only makes it more confusing. There are cases where users want to make preset filters that can applied across repos. Furthermore, user can switch to another preset filters if he needs to change the preset filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants