accumulator / Quickddit

Reddit client for Jolla's SailfishOS, Ubuntu Touch and Nokia N9
GNU General Public License v3.0
53 stars 21 forks source link

SendLinkpage: Use plattform-style gestures instad of button #70

Open Thaodan opened 4 years ago

Thaodan commented 4 years ago

Use a Dialog and DialogHeader instead of a button to make the creation of posts easier and more native. Fixes a common pitfall as described in the sailfishos documentation: https://sailfishos.org/develop/docs/silica/sailfish-application-pitfalls.html/#Using%20buttons%20instead%20of%20platform-style%20gestures

accumulator commented 4 years ago

It was this way a long time ago, but changed to buttons to better handle the error cases (rate limit, connection issues). With this change, you lose your text when an error occurs.

Thaodan commented 4 years ago

Hm maybe a pulley menu then? Piepmatz uses a pulley menu and avoids this issue. Can't you go back a page once the error occurs?

accumulator commented 4 years ago

I don't think a pulley menu is any better than a normal button.

You can reopen the page when an error occurs, but you need to keep the text outside of the SendLinkPage, as it gets destroyed as that page is removed from the pagestack, and reopen that page from wherever the user is at that moment, which can be anywhere in the app.. As you can see this is a can of worms, and not an easy fix.

Thaodan commented 4 years ago

Hm a pulley-menu at least can depend on the condition to push the pagestack only when the api call was successful.

HenkKalkwater commented 3 years ago

I have the same situation in my Sailfin application, where I needed to implement a login flow. What I do is when the user submits their login details, I push a new page to the stack with just a loading indicator instead of popping the current page. When the link is successfully submitted, I pop the two pages of the stack, but if an error occurs, I only pop the page with the spinner icon.

See https://github.com/HenkKalkwater/harbour-sailfin/blob/17d4b2c24bc7b8b9977e0743f0edf9d7dc4a6f01/sailfish/qml/pages/setup/LoginDialog.qml#L30