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

AppChooser: misc design changes and cleanups #14

Closed
wants to merge 1 commit into from

Conversation

danirabbit
Copy link
Member

@danirabbit danirabbit commented Jun 19, 2021

Since we're still kind of prototyping, I just jammed a bunch of shit in here. I can break it up if requested:

  • Change some variable names to be clearer what data they represent
  • Open an app when you click on it instead of requiring a select step. This is mainly due to some early concerns from a user who notes that it's currently very fast and easy to open an app from the context menu and they're concerned about slowing that down
  • Don't include the sender in the list of options to open with
  • Let the dialog be a lot more compact
  • Some minor string changes. Some of this stuff seems like it will need to be changed again even more for localization


private AppButton selected;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since clicking the app button will choice it. there's no need for this anymore.

add_choice (choice);
public void update_choices (string[] app_ids) {
foreach (var app_id in app_ids) {
if (!(app_id in buttons) && app_id != sender_app_id) {
Copy link
Contributor

Choose a reason for hiding this comment

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

need to do this on the last_choice setter too. right now, i got code as the default choice for text files when testing it from code.

Comment on lines +185 to +187
button.clicked.connect (() => {
chosen (button.app_id);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be in one line, like the one for the cancel button.

Suggested change
button.clicked.connect (() => {
chosen (button.app_id);
});
button.clicked.connect (() => chosen (button.app_id));

Comment on lines +145 to +146
grid.attach (switcher, 0, 3, 2);
grid.attach (cancel, 1, 4);
Copy link
Contributor

Choose a reason for hiding this comment

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

without the ButtonBox, the button is really small. i wonder if we can put the switcher in the ButtonBox and have both on the same row.

@danirabbit danirabbit marked this pull request as draft October 19, 2021 17:35
@danirabbit
Copy link
Member Author

danirabbit commented Oct 20, 2021

I think I actually want to reconsider this completely because I'm a bit confused about how we're deciding what to launch and when.

It looks like from the portal spec that OpenURI and AppChooser are two pretty different workflows. OpenURI seems unidirectional, as in an app is requesting to open a thing in another app, whereas AppChooser is redirecting app data back into the app to be used in some way. So it seems like these should be two separate interfaces. I'm a bit confused about why AppChooser is being called at all when OpenURI portal is being invoked in, for example, your code flatpak branch

It seems like if we're doing a unidirectional workflow this would be more like a share sheet design where we're offering apps, actions, and maybe even contacts to carry out

This is a totally different design from GtkAppChooser for example where we're selecting app information to hand back to an application

@Marukesu
Copy link
Contributor

It looks like from the portal spec that OpenURI and AppChooser are two pretty different workflows. OpenURI seems unidirectional, as in an app is requesting to open a thing in another app, whereas AppChooser is redirecting app data back into the app to be used in some way. So it seems like these should be two separate interfaces. I'm a bit confused about why AppChooser is being called at all when OpenURI portal is being invoked in, for example, your code flatpak branch

The AppChooser is the backend for the OpenURI portal, it's the one providing the information that we use and the one with the application interacts, any information that we return is to the OpenURI portal and not to the application.

The OpenURI portal calls the AppChooser if:

  • There's more than one choose and a default aren't defined for the caller.
  • The application asked for it by passing the ASK flag (what i'm doing in code).

It seems like if we're doing a unidirectional workflow this would be more like a share sheet design where we're offering apps, actions, and maybe even contacts to carry out

It's unidirectional for the application, but not for the OpenURI portal, it's stores the selected choice and if a application is chosen more than three times, is set as the default for that caller. and we probably don't want a one time action or contract as the default handle.

So, basically, we don't define when the dialog is shown or what's the chooses in the dialog. we only provide it to for when the frontend needs it.

@danirabbit
Copy link
Member Author

danirabbit commented Oct 20, 2021

@Marukesu okay, I see. In that case, it sounds like this should be more like the GtkAppChooser design with the listbox and possibly a link to AppCenter etc and not a fast/share sheet style design. And we probably want a different sharing portal of some kind for Code and not to use this API

OR have a separate share sheet design when ASK is passed and hand back null if the user chooses an action instead of an app

@danirabbit danirabbit closed this Oct 20, 2021
@Marukesu
Copy link
Contributor

Marukesu commented Oct 20, 2021

@Marukesu okay, I see. In that case, it sounds like this should be more like the GtkAppChooser design with the listbox and possibly a link to AppCenter etc and not a fast/share sheet style design. And we probably want a different sharing portal of some kind for Code and not to use this API

There's a proposal for a Share portal, but no implementation for it right now.

OR have a separate share sheet design when ASK is passed and hand back null if the user chooses an action instead of an app

We can't known when ASK is passed too, so we can't have diferent dialogs in that case.

@danirabbit
Copy link
Member Author

Okay cool then that definitely influenced the direction I'd like to go here a lot!

And I think that cements for me that this isn't the right portal for that Code branch. Maybe we should work on a sharing portal implementation :)

@lenemter lenemter deleted the appchooser-cleanups branch March 27, 2024 11:07
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