lichess-org / lichobile

lichess.org mobile application
https://lichess.org/mobile
GNU General Public License v3.0
2.03k stars 318 forks source link

Offline variants help #394

Open veloce opened 8 years ago

veloce commented 8 years ago

Since we have all variant playable offline it would be nice to have the same help pages the website has but embedded in the app to be seen offline.

Help would be accessible from offline games menus and displayed in a modal window (like the one for the tournament FAQ).

gurditsbedi commented 6 years ago

i would like to contribute to this feature. I have good experience with javascript(es6, react, react-native). I have no experience with Cordova. How much difficult will it be to contribute?

veloce commented 6 years ago

Great! If you have good experience with javascript and react there is no difficulty to write this feature in my opinion. You'll want to read more about mithril which has some differences with react but is also a VDOM lib with components. Cordova is not an issue here.

Quick summary of how I see this feature:

gurditsbedi commented 6 years ago

So, Should the information of all chess variants be in rendered in a single modal?

Where should I keep this file? It is going to be referenced by ai and otb screen. I am thinking of src/ui/chessVariantsFaq.tsx

Where should be the trigger button? I think this information should be in offline and also online modes? Going by your idea... The trigger button should be in the start screen(which comes when app is in offline mode), below the buttons computer and over the board.?

veloce commented 6 years ago

There should be one HTML (mithril template) file per variant I think. Then the help modal composant requires the proper file according to the variant prop. So there is one help page per variant.

You're right, this help should also comes with online games. I think the game menu is a good place: screenshot from 2018-01-08 15-50-38

gurditsbedi commented 6 years ago

As per line 10 there is this interface parameter root. What will be the equivalent for the helper variant modal?

veloce commented 6 years ago

It was a way to reference tournament because I needed the tournament infos to display help. But it was not a good idea. You don't need it for the modal. Instead you'll want to delegate modal content creation the modal caller. So your modal component don't know about its content (you pass it via children prop).

hieuxlu commented 4 years ago

@veloce I will continue working on this. I assume the requirement does not change. Please confirm below some points below:

Screenshot from 2020-03-21 23-58-42 Screenshot from 2020-03-22 00-02-44

veloce commented 4 years ago

@hieuxlu thanks for contributing! I'm fine with the button (and the icon) in the modal. You can hardcode 'Rules' as a string directly and not use the i18n function, since we don't have any translation available for this now.

hieuxlu commented 4 years ago

I still want to confirm if we really want to add this button to Menu. There's a lot of different menus, and in each menu, the option list can be different based on game states. We must also only add this button when the game is not standard, and is an actual variant.

So this will bring extra complication when we introduce more menus, more options, we might forget to add this little rule button in the future.

What I'm proposing is instead we can just link the rule directly to variant title just like in the web version as in below screenshot.

Screenshot from 2020-04-12 16-14-59

For mobile, I think we can have these options

  1. (Preferred) Add a question mark to variant title (this looks like the web version) Screenshot from 2020-04-12 16-23-46

  2. Use external link. Screenshot from 2020-04-12 16-22-15

I prefer option 1. And it's better than adding a rule button all over the places in different menus. So what do you think @veloce