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

App Picker for Desktop #4485

Merged
merged 11 commits into from
Jan 15, 2025
Merged

App Picker for Desktop #4485

merged 11 commits into from
Jan 15, 2025

Conversation

nicodh
Copy link
Member

@nicodh nicodh commented Jan 13, 2025

Loads apps (as JSON) from https://apps.testrun.org and shows a picker

Closes #4463.

  • make URL configurable ? not for now, see discussion at #4463
  • show extended details
  • add e2e test

image

closes #4463

'https://apps.testrun.org/xdcget-lock.json'
)
const apps = await runtime.getJsonFromBase64(response.blob)
if (apps) {
Copy link
Member Author

Choose a reason for hiding this comment

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

We could use the same function like in browser.runtime and thus implement that in the frontend, but I'm not really sure if that function is reliable.

Another solution would be to return a JSON string instead of a base64 encoded blob from backend, if the content-type is 'application/json'

Copy link
Member

Choose a reason for hiding this comment

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

I would use the browser version in all cases. if it should have issues, which I don't think o (since you didn't use atob/btoa), then I'll help to find a solution that works just in the browser.

Copy link
Member Author

Choose a reason for hiding this comment

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

since you didn't use atob/btoa

The solution uses atob but fixes the resulting "wrong" characters

I removed it now from runtime

@r10s
Copy link
Member

r10s commented Jan 13, 2025

nice! great you push that forward ❤️

i did not expect to have sth. native here, however, it seems no to be too complex when looking at the line count only :) i also did not follow background discussions here, tbh.

maybe that was the easier approach at the end - otoh, eg. detail view with descriptions is missing, so there is still sth missing compared to using the website. also the order is different from the website, and the search field does not show the characters, but that's probably known

however, for:

make URL configurable

if somehow possible, it would be nice to support a "normal" website for that. otherwise the requirements for users to run alternative stores would be far higher - and would also be different for Android/iOS and Desktop.

the idea of a "configurable store" was also to make that as easy as possible - currently, it would be enough if a user throws some .xdc on a server and let apache/nginx render the directory, without thinking about how to generate a json. otoh, there are no alternative stores atm :) - and on android, it is also to make f-droid happy :)

or was the native approach mainly to avoid running an external website as being regarded too critical? some background about the decision would be good :)

@nicodh
Copy link
Member Author

nicodh commented Jan 13, 2025

detail view with descriptions is missing

Yes that can be added easily. There is an UI question though: is it nicer to have a 1-click to add it or a 2-click like on the website. Also if we should show just an overlay or a separat view (since Desktop is also used on small screens maybe both needs to be provided?)

Maybe an info Icon showing the overlay - but a click on the app adds it directly?

@Simon-Laux
Copy link
Member

Simon-Laux commented Jan 13, 2025

otherwise the requirements for users to run alternative stores would be far higher

if you can host a web server, then you can also write a json file and host it as well. Or use xdcget to generate one.

Why "native"?
Because we don't want to maintain embedded browser views, the one in html email is annoying enough - and I'm not even sure if it can be replicated in tauri. Iframes have their own problems and don't fit nicely into the app.
And if you open an extra window then you could also just directly open a website or use the xdc store bot.
So better have an integrated picker that adheres to the UI design of the rest of desktop and does not need any native/runtime shenanigans like an embedded browser view or special iframe hardening.

Summary

Pro:

  • easier to maintain, since it is only in frontend
  • secure, because we control the code that gets executed
  • fits into the design of desktop, recently seen apps picker can be integrated seamlessly.
  • with multiple json sources there is the possibility to merge the sources and show a store with apps from all sources like f-droid does it

Con:

  • json format needs to somewhat stay stable / only be appended to (don't remove fields desktop app picker uses carelessly)

@Simon-Laux
Copy link
Member

Simon-Laux commented Jan 13, 2025

  • On first open it showed "Offline" until I clicked on a tab (maybe select tools tab by default)
  • Icon in attachment menu is of a map, we should find sth more appropriate on https://fonts.google.com/icons (or maybe design a monochrome variant of webxdc logo? but I guess some icon symbolising puzzle, extension, tool or packet would be user friendlies)
  • I believe the picker should open on the left side, as the context menu it was started from is also on the left side

Some icon examples that might fit (alt attribute contains name):
extension_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 grid_4x4_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 code_blocks_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 interests_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 category_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 cards_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 view_comfy_alt_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 bolt_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 deployed_code_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 apps_24dp_5F6368_FILL0_wght400_GRAD0_opsz24 grid_view_24dp_5F6368_FILL0_wght400_GRAD0_opsz24

- remove jsonFromBase64 from runtime
- esc key to close AppPicker
- show info overlay
@nicodh
Copy link
Member Author

nicodh commented Jan 14, 2025

  • On first open it showed "Offline" until I clicked on a tab (maybe select tools tab by default)

Are you sure it was related to the tab? I see it on first load if the icons are not yet loaded? I also changed the word to "Loading"

@nicodh nicodh merged commit 2de7ce3 into main Jan 15, 2025
14 checks passed
@nicodh nicodh deleted the feature-4463 branch January 15, 2025 08:46
@hpk42
Copy link
Contributor

hpk42 commented Jan 15, 2025 via email

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.

Feature: Provide an app picker similar to mobile apps
5 participants