-
Notifications
You must be signed in to change notification settings - Fork 89
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
Context Menu #949
Context Menu #949
Conversation
Nice. Although it seems this popup is for installation? We want it for |
Ouch! I got confuse in the conversation. If the new feature is for |
I think we're going to run out of hotkeys. I suggest something like "context menu", maybe defaulting to |
I think I am missing some For reference I've tried to implement this comment ideas. |
Let's say the context menu for now will have only one button that leads you to said compile menu. We can add more stuff as we go. |
I am playing around with this. Would it be useful to add an small Menu widget utilities? It would be some default widgets for easily creating/composing menus. I am thinking three options -- Missing internal state bits for each variant
data MenuEntry = Button | EditBox | CheckBox
-- oversimplification
data CompileMenu = CompileMenu {gitRefEditBox :: MenuEntry, setCheckBox :: MenuEntry, okButton :: MenuEntry}
newCompileMenu = CompileMenu EditBox CheckBox Button |
Yeah, why not. We can always change things. Code decisions here are low impact, because they can be easily reverted. It's harder with our decisions on how to organize installed files. They are hard to revert. |
Hi @lsmor Thank you for your efforts in getting this implemented! I want to help you get this over the finish line. To achieve this, I think we first need a clear specification of exactly what it is we want to implement. I have read the linked issue (#706) as well as the comments in this PR, and below is my suggestion for a final spec (for this PR):
Example context menu for GHC 8.10.7:
Note that the above is only about the nature of the "context menu", which allows putting more advanced features into the TUI without cluttering the main view and adding additional hot keys. Does this sound reasonable? @hasufell @arjunkathuria @david-christiansen @Kleidukos If we agree on this, then it's up to you @lsmor to decide which of the above context menu features you want to implement. It looks like you've started to implement the "advanced installation"-item feature. The goal of this PR can then be adding (1) the context menu itself; and (2) whatever context menu feature @lsmor wants to implement. If @lsmor wants to continue with the "advanced installation"-item feature then a subsequent PR can add the "compile HLS for this GHC version"-feature. |
Well, given the amount of features for this (I wont implement all of them in this PR though), I think It is worth to split the
Thanks, actually I had somethings wrong. This design helped to get things clearer |
Great! I'm happy to hear that.
I'm not that familiar with the GHCup codebase, but after looking around a bit, I can see that all the relevant options are contained in the data type So I would prefer to go a few levels up from Generally speaking, I prefer to call some sort of @hasufell does the above sound reasonable to you? I'm not familiar with how various options are passed around by GHCup, so calling |
I'm not sure I agree. My approach in such cases, where it's not clear what the design overlap is, usually is to rather duplicate code and let us explore what actually ends up similar. Abstraction is, imo, discovered and not actively sought. Here I'm not sure what a good design is that abstracts over cli and tui. A pre-existing interface may just skew your creativity when coming up with a good API for the tui to consume. Also remember that this creates coupling and refactors over the optparse code would also affect the tui. That said, I'd probably expect a small common denominator between cli and tui in a separate sublibrary or the main library, if one really wants to avoid code/logic duplication. So you might end up with 3 ADTs:
And now I'm not sure it's worth it. But feel free to give it a try. |
@hasufell thank you for your input! You make several good points.
I agree. Let's go with the simple solution for now. @lsmor I will try again to answer your question — please ignore my comment above :-)
As you've figured out, the parameters If the ghcup-hs/lib-opt/GHCup/OptParse/Install.hs Lines 342 to 348 in df192ee
Excepts actions with the noVerify setting set to True : ghcup-hs/lib-opt/GHCup/OptParse/Install.hs Line 340 in df192ee
For the ghcup-hs/lib-opt/GHCup/OptParse/Install.hs Line 349 in df192ee
Let me know whether this clears things up. |
d54958f
to
01427b8
Compare
I am force pushing a commit with a big (but easy) change. I have moved the BrickMain.hs into its own library and split it in many modules. The original BrickMain.hs remains as in master branch. The reasons for this are:
If any of you have concerns about the commit please ask. In general what I've done is to move "sections" from |
@lsmor I think this kind of change makes a lot of sense. Separating into smaller modules increases readability and the sub-library increases testability. I don't have enough knowledge of the codebase to judge whether this particular organization of modules is the "right" one, but IMO if it works then it's good enough. |
@hasufell what do you think about merging this as-is (without the "context menu"-changes)? It works for me, and I think it's a useful change. |
Hi there! I'll be pushing some funcitonality soon. For now I've implemented only the visual part, without logic. Before continuing I'd like to have some feedback. Each tools has its own "Context Menu" (I'd prefer advance options, honestly), from there you can go to other settings like "compile", "install", etc... Code is very messi, I am cleaning it a liitle bit before pushing. |
@lsmor awesome! Looks great. I would make some small changes — provided it's not too difficult:
|
I think it should be possible to put that help text inside the input fields (if said input field is not focused). I think that's similar to how many web input fields work and saves space.
Maybe the same as in the main window, which by default is Otherwise I think this goes into the right direction. |
@lsmor if you rebase this branch against master, then CI should succeed. |
@lsmor let us know if you need any further feedback for the design. I believe this is a major improvement to the TUI. |
6a19d75
to
231341b
Compare
I am pushing (only) the visuals after rebasing. TODOS:
|
@lsmor what's the timeline you think you will have this finished? I'm evaluating whether to wait for it before making a release or doing a release sooner than later. |
um... I don't expect it to have it soon. the first two points are easy, and I can have them in the next week, but I still don't know how difficult will be to have the last two point working. + There should be some extensive testing which I don't know how to approach actually. So I would expect to have something testable in about 1,5 month. From there, fixing all possible bugs, etc... let say 2 or 3 months to merge. Btw, I am terrible at ETA. Notice #850 , took me 5+ months (summer in the middle) and I estimated 3 months (and it was merge with a bug on my side!!!)... Also I am more familiar with the code base now. |
Well, I'm not trying to be a manager :D Just trying to understand when to schedule releases. I think I'll start setting up a milestone then and only merge smaller stuff. |
I just recall, why this isn't a good Idea. You can either type
AS @hasufell said, adding a different key for exit, is risky as something like ¿is it ok if we keep the cancell button?
I am adding this to the check list |
To have frequently used fields shown first.
INTERNAL_DOWNLOADER, and BRICK are not used in ghcup-tui
a31ac44
to
8fb4ec0
Compare
Hi there: I have rebased master and think about @dfordivam feedback. In particular, these two suggestions:
The current design is that the target to compile is the version the cursor is over. So if you open the context menu of I think is ok if this PR includes most of the functionality of the cli provides, sacrificing it a little bit of it for a better UX.
I wasn't... sorry for the late response. 😅 |
Hi @lsmor
I think there is a slight confusion here, if you put the cursor on GHC, the advanced compile menu will open the options for compiling the GHC. The user needs to put the cursor over HLS to open the options for compiling HLS. "Allow specifying comma or space separated list of multiple target GHC" option is only valid in the case of HLS compilation, as HLS can be compiled for multiple GHC targets. For GHC this does not make sense. Nevertheless, this is a usability related issue, and both of these can be tackled later, after merging this PR. The remaining fixes necessary for this PR are:
|
Done. There is a check failing but is I think is a problem with the host machine:
Up to internet, is because of Apple's M1 chip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of minor fixes necessary.
Other than that looks good to me!
Thanks @lsmor. Great work. |
Create popUp widget: widget state, widget drawing and widget handler. The widget is pretty straigthfoward
I have to implement the instalation logic still. I am gonna need some help with it. I understand how to pass some advance parameters, but not others. The whole list of parameters is:
If we translate that into code