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 simple menu for better UX #660

Merged
merged 25 commits into from
Dec 2, 2021
Merged

Add simple menu for better UX #660

merged 25 commits into from
Dec 2, 2021

Conversation

svartkanin
Copy link
Collaborator

@svartkanin svartkanin commented Oct 12, 2021

This PR adds the simple menu (https://github.com/IngoMeyer441/simple-term-menu) as a new selection menu to enhance the UX of the guided user flow.

It has been suggested in issue #655 and this PR changes most selection menus to use the new layout.

The only part where it still uses the old one is during manual partitioning. The reason for that is that I think there are some bugs in the partitioning code and it kept exploding when I was going through the flow in master. Therefore, I decided to leave that one as is and fix the bugs first and only after switch it over to the new layout as well.

Edit: This will fix #173 (I can't link earlier issues to newer PR's because the issues was created before the move from Torxed/archinstall to archlinux/archinstall)

@Torxed
Copy link
Member

Torxed commented Oct 12, 2021

I haven't tested this yet. And I'm generally speaking against external dependencies.
Which is why we've spent some time integrating code that produces menus etc.
Seeing how complex that code is growing, and how shaky especially my handling of input is from time to time - this might enhance the user experience quite significantly.
Perhaps I revisit the refusal to use external libraries and evaluate a plan to keep or remove it in the future - saving us some time on menu management etc.

Again, I have to see how this looks and what it actually does. Just throwing my thought out there that I'm not against it (we just need to keep in mind that some packages are not on the ISO and we don't want to grow the ISO more than we have too even if we're just talking about a few Kb here and there).

@svartkanin
Copy link
Collaborator Author

Thanks for the feedback.
All the code in the simple-menu dependency is actually all in a single file. If you want to avoid dependencies then there's the simple option to copy that in manually as well.
Updates have to be done manually as well then tho.

@mhussaincov93
Copy link

mhussaincov93 commented Oct 14, 2021 via email

@Torxed
Copy link
Member

Torxed commented Oct 14, 2021

hi there, blind user here, what inpact will this simple menu have on the accessibility of archinstall?

Hi, I'm glad you took this up.
I will make sure to test this! And if it breaks anything I'll report it :)

@svartkanin
Copy link
Collaborator Author

Hey @Torxed ,
Did you have a chance to look at this already?

archinstall/lib/user_interaction.py Outdated Show resolved Hide resolved
archinstall/lib/user_interaction.py Outdated Show resolved Hide resolved
archinstall/lib/user_interaction.py Show resolved Hide resolved
archinstall/lib/menu.py Outdated Show resolved Hide resolved
@Torxed
Copy link
Member

Torxed commented Oct 26, 2021

Hey @Torxed , Did you have a chance to look at this already?

I've tried to run it a couple of times, due to my debugging setup it took a bit longer than expected.
There are some imports that needs to be cleaned up (i think, please notify if i'm wrong so I can improve).

Once those changes are done, I'll test again and I'll test availability with screen reader as well : )

@svartkanin
Copy link
Collaborator Author

@Torxed I updated the PR, I think I addressed all comments. Let me know if you have any other concerns or questions
Cheers

@Torxed
Copy link
Member

Torxed commented Oct 27, 2021

Looks better, while I run a few more tests. Can you updated requirements.txt so that we don't loose the dependency?

@svartkanin
Copy link
Collaborator Author

svartkanin commented Oct 27, 2021

You mean create a requirements.txt ? I did add it to the pyproject.toml but I guess it depends how one installs the dependencies. So I thought installing it with flit install --deps all does the trick there, but honestly I haven't used flit before...

@Torxed
Copy link
Member

Torxed commented Oct 27, 2021

You mean create a requirements.txt ? I did add it to the pyproject.toml but I guess it depends how one installs the dependencies. So I thought installing it with flit install --deps all does the trick there, but honestly I haven't used flit before...

Ah yea my bad. Forgot we moved from requirements.txt to flit installs :) Ignore my previous comment!

@svartkanin
Copy link
Collaborator Author

Hey @Torxed ,
did you manage to test this again?
Cheers

@Torxed
Copy link
Member

Torxed commented Nov 1, 2021

Hey @Torxed , did you manage to test this again? Cheers

Not yet, I'll test this one and my other 3-4 PR's I submitted today. Most likely on Wednesday when I'm back at a computer with proper internet. I'm limited to 56k modem speeds for a few days.

@svartkanin
Copy link
Collaborator Author

Awesome thanks!

@Torxed
Copy link
Member

Torxed commented Nov 5, 2021

This PR adds a bit of flare to the menu by adding colors and a better interactive selector.
I'm not sure if it's the old if/else we have, but skipping a hard drive will still prompt for wiping or configure individual partitions.

The Text to Speech still works. But it will need some modification to the text output. For instance it's a bit unclear that you can/should use the arrow keys to navigate the menu items, and that you start on the first menu item.
I'm not a frequent TTS user, but this might be an improvement.

screenshot

One drawback is that it always clears the previous output (something some of our menu screens do as well) and is not desirable I think. It's not the end of the world, but it does mean that some overview of the process gets removed. And with the removal of tty history the config at the end can not be viewed fully either, which maybe makes the clearing of the screen a bit more of a problem today.

I think I'm still in favor of this PR.
But perhaps we hard-link in the single-file menu library to ensure we don't get breakage further down the road?

@svartkanin
Copy link
Collaborator Author

Thanks for the review.
I'm happy to include the menu file directly and remove the dependency.
Is there anything else specifically you would like to get changed or updated in this PR?

I'm planning on a next PR to address the remaining old menu selection in the manual partitioning process.

Also I can play around with displaying already chosen options while going through the menu which could serve as a history in a way. But it would be something in a subsequent PR if there's interest to merge this one and worth the effort that way :)

examples/guided.py Outdated Show resolved Hide resolved
profiles/desktop.py Outdated Show resolved Hide resolved
profiles/i3.py Outdated Show resolved Hide resolved
profiles/server.py Outdated Show resolved Hide resolved
@Torxed
Copy link
Member

Torxed commented Nov 7, 2021

Thanks for the review. I'm happy to include the menu file directly and remove the dependency. Is there anything else specifically you would like to get changed or updated in this PR?

I'm planning on a next PR to address the remaining old menu selection in the manual partitioning process.

Also I can play around with displaying already chosen options while going through the menu which could serve as a history in a way. But it would be something in a subsequent PR if there's interest to merge this one and worth the effort that way :)

I think that would be good for now, unless someone else has objections (they might after your finished, it happens) I don't see why this isn't a better step towards handling menus. Instead of trying to save the previous menu options, perhaps we can have a final menu at the end outputting the result config.json data. And tie entries to calling the function responsible for that entry. It would mean keeping and updating a map of what entries comes from which function. But that would allow people to "go back" and re-edit a entry before installing.

Obviously, that would be for the next version of the menu handling perhaps.
For stability reasons, I'll wait until 2.4.0 to include this PR, as I'm already struggling a bit with stability issues re-working a lot of the disk code base. So you would have until the January ISO to do any work on this, if you choose to do so : )

@svartkanin
Copy link
Collaborator Author

@Torxed
I've added the simple menu library as a >= dependency so it will always be updated. To keep it more stable we could either lock it to the current version (==) or copy it into the package. I'm generally leaning towards the locking approach since future updates will be a simple version change, however, the external dependency remains. If we copy it into the package, updating will result in bigger diffs.
I'm happy with either option though, so if the goal is to try to keep the package without dependencies then let's copy it over.

I like the idea of having a final version of the options displayed with the possibility to change them again.
To take it a step further, would it make sense to actually have it as a global menu instead? Meaning, instead of going through the single menus sequentially, we could have a root menu where all these options are displayed and can be edited and after all required ones have been chosen the installation can be triggered?

Just to understand, if you would like to wait until 2.4.0 to include it, would we keep it open until then or is it possible to merge it and just not release it? Not sure how the release process works, if it's taking the most recent master it will be tricky I suppose...

@Torxed
Copy link
Member

Torxed commented Nov 7, 2021

@svartkanin Lets copy it over! : ) Reasoning: Bare in mind that all dependencies has to be a Arch Linux package for the inclusion to work, we don't use/avoid relying on pip or similar alternatives to include dependencies. There for, the source has to be included in archinstall or be left omitted I believe.
Perhaps there's some automagic to the way requirements gets pulled upon build, but I highly doubt it.
(keep in mind that this is a Arch Linux package first and foremost, and python library second)

I'm not sure too which scale that would alter the source code, since the code is written around API calls, and guided serves as a decent example of how to build a installer or a templated installation of a system. That would probably mean guided stopped being a decent example and became just another monster like any other distro - making it harder to add or contribute to individual steps. This is just my fear, not something to take for granted.

Yes, we would keep it open (and work on if you wish) until we'ved released v2.3.0 (which is bound to happen really soon), after which we can happily merged this into master if we deem the PR stable (which it kinda is with the option we've got here). If we merge it into master then any new features or changes to this functionality would be a new PR - but until then it's free for all on this branch and we'll merge once stable again : )

profiles/desktop.py Outdated Show resolved Hide resolved
@Torxed
Copy link
Member

Torxed commented Nov 25, 2021

Fixed and merged in this branch & pr's changes to ask_for_main_filesystem_format() with master changes properly. Also fixed some imports and removed the last generic_select() that I could find.

This file is copied over from the simple-term-menu project
(https://github.com/IngoMeyer441/simple-term-menu)
In order to comply with installation methods of Arch Linux.
We here by copy the MIT license attached to the project at the time of copy:
Copy link
Contributor

@dylanmtaylor dylanmtaylor Nov 25, 2021

Choose a reason for hiding this comment

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

here by -> hereby.

time of copy -> time of copying.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you, I will correct the phrases!

self.menu_options = [default] + [o for o in self.menu_options if default_option != o]

cursor = "> "
main_menu_cursor_style = ("fg_red", "bold")
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a huge fan of this color scheme. Maybe we could go with something close to the Arch blue to match?

DEFAULT_CYCLE_CURSOR = True
DEFAULT_EXIT_ON_SHORTCUT = True
DEFAULT_MENU_CURSOR = "> "
DEFAULT_MENU_CURSOR_STYLE = ("fg_red", "bold")
Copy link
Contributor

Choose a reason for hiding this comment

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

might need changed here as well.

@dylanmtaylor
Copy link
Contributor

@svartkanin Could you merge in svartkanin#1? I think the look is a lot better and it makes it match the Arch color scheme.

@svartkanin
Copy link
Collaborator Author

@dylanmtaylor That's good, I'll have a look and merge it as soon as I get back to the computer

@dylanmtaylor
Copy link
Contributor

I'm wondering how the accessibility of this menu system is with espeak - just saw an issue from a blind user and it made me think of this change

@Torxed
Copy link
Member

Torxed commented Nov 27, 2021

I'm wondering how the accessibility of this menu system is with espeak - just saw an issue from a blind user and it made me think of this change

I've tried it, so far no issues that I can distinguish.
Works well with espeakup at least.

@svartkanin
Copy link
Collaborator Author

@dylanmtaylor I left a comment on the PR

@dylanmtaylor
Copy link
Contributor

@dylanmtaylor I left a comment on the PR

I suppose it makes sense to not touch the upstream file. I made a commit to remove the change to default menu cursor

@dylanmtaylor
Copy link
Contributor

I'm wondering how the accessibility of this menu system is with espeak - just saw an issue from a blind user and it made me think of this change

I've tried it, so far no issues that I can distinguish. Works well with espeakup at least.

My biggest concern is how it would handle conveying which item is selected.

@Torxed
Copy link
Member

Torxed commented Nov 29, 2021

Oddly enough, it works near realtime.
At least when I tried it. It aborts the previous TTS when changing item and simply starts mentioning the new selection.
Something I'm not sure even our current method of menu system does. The TTS also remembers "where you are" without having to re-read all the entries which we currently trigger by wiping the screen (for some of our menus).

Update color scheme to match Arch style better
@svartkanin
Copy link
Collaborator Author

@Torxed I saw release 2.3.0 is out, are there any more concerns with this PR or could we consider merging it?
When it's merged I'd be happy to work on the things we mentioned in the comments, foremost to add a global menu after the configuration to re-edit certain settings.

@dylanmtaylor
Copy link
Contributor

dylanmtaylor commented Nov 30, 2021

@Torxed I saw release 2.3.0 is out, are there any more concerns with this PR or could we consider merging it? When it's merged I'd be happy to work on the things we mentioned in the comments, foremost to add a global menu after the configuration to re-edit certain settings.

This is currently targeting 2.4.0, I think it'll be part of the n+2 release, as IIRC a 2.3.1 was planned.

@Torxed
Copy link
Member

Torxed commented Dec 1, 2021

@Torxed I saw release 2.3.0 is out, are there any more concerns with this PR or could we consider merging it? When it's merged I'd be happy to work on the things we mentioned in the comments, foremost to add a global menu after the configuration to re-edit certain settings.

This is currently targeting 2.4.0, I think it'll be part of the n+2 release, as IIRC a 2.3.1 was planned.

Correct. A few things that might need patching. But I could potentially crate a branch of 2.3.0 and cherry-pick certain improvements here and there. I don't think 2.3.1 would be very huge or even relate to v2.4.0. so might be worth doing that, merge this PR into master and all master work goes towards v2.4.0 which will be the larger project?

@dylanmtaylor
Copy link
Contributor

dylanmtaylor commented Dec 2, 2021

@Torxed I saw release 2.3.0 is out, are there any more concerns with this PR or could we consider merging it? When it's merged I'd be happy to work on the things we mentioned in the comments, foremost to add a global menu after the configuration to re-edit certain settings.

This is currently targeting 2.4.0, I think it'll be part of the n+2 release, as IIRC a 2.3.1 was planned.

Correct. A few things that might need patching. But I could potentially crate a branch of 2.3.0 and cherry-pick certain improvements here and there. I don't think 2.3.1 would be very huge or even relate to v2.4.0. so might be worth doing that, merge this PR into master and all master work goes towards v2.4.0 which will be the larger project?

I suppose we could make a branch called future-2.3.1 or something and release a version of that which will ship in Jan, and then use master for 2.4.0 development and merge this PR into master. You'd still be able to cherry-pick into 2.3.1 that way.

@Torxed Torxed merged commit 908c7b8 into archlinux:master Dec 2, 2021
@Torxed
Copy link
Member

Torxed commented Dec 2, 2021

Merged, I created v2.3.1-dev for development on the future version v2.3.1 which will contain some minor fixes, and master can continue as usual for "every day development" towards future things to come (v2.4.0 mainly).

@Torxed
Copy link
Member

Torxed commented Dec 2, 2021

@svartkanin Great job on this one, I'm pretty sure it wasn't crystal clear where to change things and replace all the menu options. So thank you for taking the time to dig through the source!

@svartkanin
Copy link
Collaborator Author

Sounds good!

@svartkanin
Copy link
Collaborator Author

@Torxed it's a really great project and i was very happy to start contributing to it. I'll continue updating things on the menu part but would also like to stqrt picking up other things :)
Is there a project plan or anything the like?

@Torxed
Copy link
Member

Torxed commented Dec 2, 2021

@Torxed it's a really great project and i was very happy to start contributing to it. I'll continue updating things on the menu part but would also like to stqrt picking up other things :) Is there a project plan or anything the like?

I'm not perfect at updating this, but the milestones should broadly represent things we know we want in specific releases: https://github.com/archlinux/archinstall/milestones

I usually do most of the partitioning work because it's a PITA, but feel free to pick up anything you want :) All PR's are welcome, not all make it into master but most of them do.

@svartkanin
Copy link
Collaborator Author

Great I'll have a look to see where i can help out

@svartkanin svartkanin mentioned this pull request Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

For timezone selections, give options
5 participants