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

Filter search page for Free Software only #1409

Merged
merged 10 commits into from
May 1, 2023

Conversation

Lesik
Copy link
Contributor

@Lesik Lesik commented Apr 28, 2023

Decided to have a go at the first part of #1365, too 🙂 wasn't as difficult as I anticipated

This PR adds:

  • is_free_license and project_license to the apps index of Meilisearch. is_free_license to speed up filtering ad the index can be precomputed and no string comparison is needed when the actual search is happening. project_license because I thought it's a useful field to have in general.
  • Ability to the /search endpoint to filter for Free Software only. I left the default behavior at "including proprietary software" because I think that's what most people use Flathub for, getting their Spotifys, Google Chromes and Microsoft Teams in a safe way without messing up their system with half-hearted Linux packages from proprietary vendors. Edit: Not trying to imply here that's all Flathub is good for — in fact I prefer to have all my GUI apps be installed via Flatpak — just saying I have the impression it's most popular for proprietary software.
  • A toggle to the search page to toggle whether to show Free Software only or not. The preference is saved to local storage for persistence. Again, I set the default to false because see bullet above. Other pages and collections are unaffected by this.

@razzeee
Copy link
Member

razzeee commented Apr 29, 2023

It might be nice to not do this in cookies, but in the url, then you could also send a search, to a friend, that's already prefiltered. Then again, it will probably get messy, as I'm planning to add more filters and that might lead to very long urls.

Cookie might also be nice, cause we could filter you experiance down on other pages too, but that would probably cause problems with the prebuild pages or lead to us having to prebuild everything twice.

@@ -290,5 +290,6 @@
"browse": "Browse",
"explore-apps": "Explore apps",
"setup-flathub": "Setup Flathub",
"setup-flathub-description": "Setup Flathub to install and update apps on your system."
"setup-flathub-description": "Setup Flathub to install and update apps on your system.",
"free-software-only": "Only show Free Software"
Copy link
Member

Choose a reason for hiding this comment

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

I know that @ramcq was very pro calling this floss software, but it might be hard for new users to grasp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it's about "free" being confused with "gratis", then perhaps "libre software" would work? I do think FLOSS can be confusing if you haven't heard the term before. To a new user, FLOSS might sound like some boring technical acronym, whereas "libre software" might sound intriguing, prompting the user to google it and learn more about it.

Another thing to consider is that in other languages, the ambiguity between "free" and "gratis" doesn't exist. To stay close to the English translation, would these languages also use the term "FLOSS" then, even though the acronym is not used in that language? And in languages not written in the roman alphabet, would it be e.g. "FLOSS програми" or "ФЛОСС програми"? Both read quite weird. 🤔

Copy link
Member

Choose a reason for hiding this comment

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

As far as I remember it was about the free/gratis thing and FLOSS convieniently side-stepping the libre/free discussions.

I'm not sure I have the answers for translations, I would just trust translators to do the right things, but that might also be wrong :)

Copy link
Member

Choose a reason for hiding this comment

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

I will merge this for now, as I don't want to keep this back due to one translation.

Especially cause I will change this UI later anyway. (Facetes and stuff)

# order of the dict is important for attritbute ranking
search_apps.append(
{
"id": utils.get_clean_app_id(appid),
"name": apps[appid]["name"],
"summary": apps[appid]["summary"],
"keywords": search_keywords,
"project_license": project_license,
"is_free_license": AppStream.license_is_free_license(project_license),
Copy link
Member

Choose a reason for hiding this comment

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

I don't like how we have two terms free license and free software now. Would like them to be aligned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I think on the search result page the term "free software" makes most sense, because you're currently trying to find software, and "Show only software with a free license" is a mouthful. I will change this field to is_free_software.

@razzeee
Copy link
Member

razzeee commented Apr 29, 2023

This looks great, I only have some very minor things, listed above.

Other then this, I don't like how it flickers, when you change the toggle, as it seems to reload everything. Might be cool to just reload the items below and show a loading indicator. I'll probably look into that.

Thanks for working on this.

@razzeee
Copy link
Member

razzeee commented Apr 30, 2023

I've pushed some changes. In general, I'm fine with it now, but let's wait for wording changes.

In the future, I'm hoping to move that filter to the side of the page and do a facet search

@razzeee
Copy link
Member

razzeee commented May 1, 2023

I will rebase this, please be careful, as I will force push to your branch :)

@razzeee razzeee force-pushed the proprietary-software-filter branch from 683c82c to 01bc04d Compare May 1, 2023 13:50
@razzeee razzeee force-pushed the proprietary-software-filter branch from 117039e to c36e55a Compare May 1, 2023 14:37
@razzeee
Copy link
Member

razzeee commented May 1, 2023

Thanks for working on this.

@razzeee razzeee added this pull request to the merge queue May 1, 2023
Merged via the queue into flathub-infra:main with commit 6667b27 May 1, 2023
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.

2 participants