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

Add action to command bar information icon #214

Closed
2 tasks done
andrewtavis opened this issue Oct 2, 2022 · 19 comments
Closed
2 tasks done

Add action to command bar information icon #214

andrewtavis opened this issue Oct 2, 2022 · 19 comments
Assignees
Labels
design Relates to UX/UI designs feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Comments

@andrewtavis
Copy link
Member

Terms

Description

Now that a clickable information icon has been added to the keyboard in #166, an action is needed to display a message to the user about Wikidata. The icon appears when the user sees the "Not in Wikidata" message, which to many would be confusing. Clicking the icon should present a tooltip message over the keyboard that explains:

  • What Wikidata is
  • That Scribe gets its data from there
  • That the user can contribute to improve Scribe data

How this is exactly displayed is open to discussion, as well as if this message should be in English or the keyboard language (the latter is preferable).

Contribution

Would be happy to get to this in later versions or support someone with interest!

@andrewtavis andrewtavis added feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed design Relates to UX/UI designs question Further information is requested labels Oct 2, 2022
@andrewtavis andrewtavis changed the title Add action to information button to explain Wikidata Add action to command bar information icon Oct 2, 2022
@andrewtavis andrewtavis added the blocked Another issue is blocking label Oct 5, 2022
@andrewtavis
Copy link
Member Author

@andrewtavis andrewtavis removed the blocked Another issue is blocking label Oct 8, 2022
@andrewtavis
Copy link
Member Author

The variable formKeySingle is the 1x1 display that could be used to send messages to the user. Clicking the icon could change the keyboard to this display and present them with information on Wikidata so they know where the data's (not) coming from :)

@andrewtavis
Copy link
Member Author

It should also be noted that this info button should also appear on conjugation fields with no data.

@gmmoraes
Copy link

gmmoraes commented Nov 26, 2022

@andrewtavis

Heyy, is this taks still available? I would like to help.

I have added some ideas of design for the tooltip. Maybe it could be a modal with 3 pages overall (one for each of the bullet points listed in first post).

  • What Wikidata is
  • That Scribe gets its data from there
  • That the user can contribute to improve Scribe data

Screen Shot 2022-11-26 at 09 36 53
Screen Shot 2022-11-26 at 10 30 57
Screen Shot 2022-11-26 at 10 30 45

@andrewtavis
Copy link
Member Author

Hey @gmmoraes! The task is still available 😊 Regarding your idea for the content:

  • What Wikidata is
  • That Scribe gets its data from there
  • That the user can contribute to improve Scribe data

I think this is perfect! 🚀

A note on the first screen: the location of elements within custom keyboard extensions is limited to the dimensions of the keyboard itself - i.e. we cannot have the tooltip extending above the height of the keyboard. We do have a 1x1 conjugation display that covers the keyboard and has left and right buttons, which I think along with the circles from image 3 could make an intuitive interface for users. Likely best if we one day get rid of the buttons all together and just swipe through all the options, but I think this is fine for now :)

What do you think on the above? Let me know if you'd like me to assign the issue to you, and thanks so much for your thoughtful suggestions with the images and designs! :)

@gmmoraes
Copy link

gmmoraes commented Nov 27, 2022

@andrewtavis, I would love to take this issue.
Regarding your suggestion, i think that the idea is great!

The implementation would be to create a custom card view with a layout similar to image 3 (in my first post) and display it inside the 1x1 conjugation when the information icon is pressed?
The interaction with the left button would show the previous item inside the card view and the right button would show the next item.

Screen Shot 2022-11-27 at 13 12 05

@andrewtavis
Copy link
Member Author

andrewtavis commented Nov 27, 2022

Yes, @gmmoraes, this sounds perfect to me 😊 Let me map this out a bit for you, as it is a good first issue, but definitely on the hard side. Would likely help if I show you how to get that 1x1 view up and running with the enum options for the keyboard :) Assigning you now, and I'll write something up for a more in depth explanation 🙃

@andrewtavis
Copy link
Member Author

andrewtavis commented Nov 27, 2022

Typing this out as I eat 😋

So what we want to have happen is for the loadKeys function at this part of the keyboard view controller to be triggered and for the view we're discussing to be displayed to the user:

  1. To see this info button we have commandState = .invalid returned from a command. commandState is to tell the keyboard what kind of interface we want to display and includes options like selectCommand, translate, conjugate, plural - to show the command entry fields - as well as selectVerbConjugation, etc. As this is a different kind of view, maybe we want to add displayInformation as an option for commandState to make it easy on ourselves? That would be here:

  2. We'd then take displayInformation and at it to this part of the view controller:

    if ![.selectVerbConjugation, .selectCaseDeclension].contains(commandState) { // normal keyboard view

The above is the trigger of whether to show the user a normal keyboard or another view for conjugations or declensions. We can have displayInformation also trigger this, which as the lines below show will lead to the shift left and right buttons to be shown, as well as hide the keyboard keys:

We'd have formsDisplayDimensions == .view1x1, and would then be able to set the label for formKeySingle, which is the button that we'd use for this 😊

  1. Then we're coming down to this conditional and adding an option where if commandState == displayInformation, then we'll execute a function like say setInformationState().
    if commandState == .selectVerbConjugation {

We then just make this function setInformationState() where we put the text we want on the 1x1 view, and then change it when the user presses a left or right key. They'd also inherently have the escape key as in your mockups above to get back to the keyboard :) To start the whole process we'd just need to use the tapHandler for infoButton as described here, but I'd say we work on this later?

let infoButton = UIButton(type: .system)

How does this all sound to you? It's honestly a bit more involved than I expected when first writing this, but I think as a baseline you could send along a PR with the work for points 1-3 above, and from there we can plan/work on the rest? Also, do you want me to write the text for the three pages, or would you like to try a first draft? Up to you!

Hope you're having a nice Sunday!

@gmmoraes
Copy link

gmmoraes commented Nov 29, 2022

Thank you so much for the detailed explanation!

How does this all sound to you? It's honestly a bit more involved than I expected when first writing this, but I think as a baseline you could send along a PR with the work for points 1-3 above, and from there we can plan/work on the rest? Also, do you want me to write the text for the three pages, or would you like to try a first draft? Up to you!

This sounds great! I am almost always up for breaking a task into smaller ones haha.
Regarding the text, if possible, I believe the text will have better quality if written by you. I am not a very good writer xD.

@andrewtavis
Copy link
Member Author

I'll get to writing something for these screens later today 😊 Thanks, @gmmoraes!

@andrewtavis
Copy link
Member Author

What I was thinking for the three screens is:

  • Wikidata is a collaboratively edited knowledge graph that's maintained by the Wikimedia Foundation. It serves as a source of open data for projects like Wikipedia.
  • Scribe uses Wikidata's language data for many of its core features. We get information like noun genders, verb conjugations and much more!
  • You can make an account at wikidata.org to join the community that's supporting Scribe and so many other projects. Help us bring free information to the world!

How does this sound, @gmmoraes? :)

@gmmoraes
Copy link

gmmoraes commented Nov 30, 2022

@andrewtavis Thanks! It's great, the amount of text fits well with the space available for the tooltip.

Is there any place recommend to add these texts (like a localization file)?

@andrewtavis
Copy link
Member Author

Really good question, @gmmoraes :) We haven't worked out localization of the app really at all at this point except for making baseline English files that hopefully will the translated. I'd say that for now these strings can go in ENAppText.swift 😊

@gmmoraes
Copy link

gmmoraes commented Dec 1, 2022

@andrewtavis Thanks!

Is it possible to call the methods declared inside ENAppText.swift from KeyboardViewController?
I have declared a new method inside ENAppText which should return NSMutableAttributedString for the tooltip, though I am not being able to call this from KeyboardViewController.

@andrewtavis
Copy link
Member Author

andrewtavis commented Dec 1, 2022

Very welcome, @gmmoraes! Thank you! 😊

I'm thinking that likely you'd need to to add the individual keyboard extensions as targets of ENAppText.swift? Not sure if you've already done that, but as of now only the Scribe app itself is the target, so that means that the individual view controllers wouldn't be able to reference the variables/functions.

Let me know if it's something else and I'm happy to look into this more :)

@gmmoraes
Copy link

gmmoraes commented Dec 3, 2022

@andrewtavis Thanks!

I have added a Pull request for this!
Please let me know if there is any thing to be changed/improved in the PR.

@andrewtavis
Copy link
Member Author

Thanks, @gmmoraes! Will get to this later this evening 😊

@andrewtavis
Copy link
Member Author

Minor changes requested, @gmmoraes 😊 Thanks again so much for all this! You really created a sleek feature that is going to integrate so well with the rest of the app :)

andrewtavis added a commit that referenced this issue Jan 31, 2023
@andrewtavis
Copy link
Member Author

@gmmoraes, thanks again for your work here :) Really did make the rest of this issue much easier. 22484fd closes this issue with alterations to your original code that make it dark mode responsive, make the tooltip background match that of the left and right navigation keys, styles the 1x1 view beneath so it fits with the rest of the UI, scales the text for iPads and changes some of the scaling so that things have a bit more space around them 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Relates to UX/UI designs feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants