Skip to content

Filter apps by user agent#535

Merged
dessalines merged 8 commits intomainfrom
filter-apps-ua
Jan 20, 2026
Merged

Filter apps by user agent#535
dessalines merged 8 commits intomainfrom
filter-apps-ua

Conversation

@Nutomic
Copy link
Copy Markdown
Member

@Nutomic Nutomic commented Jan 16, 2026

This is quite tricky, and I dont have a good way to test all of it.

It would also be neat if Desktop showed Web apps as there are very few desktop apps available right now. The obvious solution would be to turn state.platform into an array, but that gets awkward to manage.

Requires #517

);
}

seeAllBtn() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This shouldn't be necessary; there is already an All Platforms option in the dropdown.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The list is filtered by default now, and for someone who sees it for the first time, it may not be obvious where to change the filters. Especially if you scroll down a bit and dont find what youre looking for. Better to have an explicit button than having the user close the page.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Then add it to the filterAndTitleBlock since it is a filter. Probably to the left of the dropdown.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That would also work. But the idea is that you open the page, scroll down the list, and at the end notice that it doesnt have what youre looking for. At that point you might not think of scrolling all the way up again, and its very convenient if you can directly "show all". I also made it like this for the instance list (https://github.com/LemmyNet/joinlemmy-site/pull/534/files#diff-64ddea6fc06e051736ae2ea16ee2d1378833a0b0758e9ea701bd84bd4300f312R525).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alright I spose that's fine.

Comment thread src/shared/components/apps.tsx Outdated
<div className="flex justify-center p-8">
<button
className="btn btn-secondary text-white normal-case"
onClick={linkEvent(this, handleSeeAll)}
Copy link
Copy Markdown
Member

@dessalines dessalines Jan 19, 2026

Choose a reason for hiding this comment

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

I'm trying to move away from all linkEvent, because it calls functions without any parameters in an untyped way. Rust would not let us get away with stuff like this but unfortunately typescript does.

Better to do:

Suggested change
onClick={linkEvent(this, handleSeeAll)}
onClick={() => handleSeeAll(this)}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done, although its used in lots of places and needs a separate cleanup PR then. We should also enable more lints for this repo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This still needs to be done I think.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Forgot to push

@dessalines dessalines merged commit 2a7b2cd into main Jan 20, 2026
2 checks passed
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.

On apps page parse user-agent and only show apps for current platform by default

2 participants