-
Notifications
You must be signed in to change notification settings - Fork 11
Poc gui #739
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
base: dev
Are you sure you want to change the base?
Poc gui #739
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #739 +/- ##
==========================================
+ Coverage 47.78% 48.74% +0.96%
==========================================
Files 31 44 +13
Lines 2890 3315 +425
==========================================
+ Hits 1381 1616 +235
- Misses 1509 1699 +190 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I give it a try and this time I got blanc terminal when I ran "dds gui". No error in the container log.
it worked again (without the user functionality obviously). So it must be something in the last two commits. |
@ebba-eliasson I'm also getting an empty terminal atm |
I had an empty terminal and what, I suspect, helped was to first run the dds command normally without the |
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.
This looks great, you've done an awesome job! 🎉
I've added a bunch of comments and sometimes they may be in the wrong place so sorry about that, but I think it's fairly understandable what I mean. If not, just ask!
Also, I didn't dive in to all the code details atm, I mainly went on functionality now, so I'll do another review, but this review is already quite wordy so I think lets start there. I have focused on details though. I think before we continue with any more of the functionality (e.g. projects etc) we should decide on what we have atm.
@@ -168,6 +171,16 @@ def dds_main(click_ctx, verbose, log_file, no_prompt, token_path): | |||
# Create context object | |||
click_ctx.obj = {"NO_PROMPT": no_prompt, "TOKEN_PATH": token_path} | |||
|
|||
### GUI COMMAND ### | |||
|
|||
@dds_main.command(name="gui") |
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.
Should be able to make an "executable" for only GUI right? Which in this case would start the GUI command after clicking the file?
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.
I just want to make sure that the GUI actually avoids commands all together
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.
Should be the case, will look into that though. Right now it uses the click context for getting the token path, so we would just need some util for getting that.
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.
@i-oden from the textual documentation it is suggested to use https://textual.textualize.io/how-to/package-with-hatch/#installing-the-calculator, but other options seems to work as well Textualize/textual#4512
|
||
### Issues with the PyQt implementation | ||
|
||
The idea was to use PyQt6 as a framework for building the GUI for the DDS but Pyqt dont work on alpine and hence would not install in the container enviroment. In addition to this, there is benfifits using a TUI (Terminal UI) as some users are **only** able to run dds in the terminal. There is no loss in functionallity switching from pyqt to textualize. Textualize is confirmed to work with the current docker setup. |
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.
We have been discussing switching from Alpine -- if we think that PyQT is better than we should switch.
Re: some users only being able to run the dds in the terminal -- as long as the users don't have to run any commands to start the GUI (as in they can, but they don't have to), then I'm ok with Textualize.
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.
- After working with both frameworks I would not say that pyqt is better than textualize or vice versa, they are good at different things and functionality wise both would work fine.
- It generally seems to be some issues sometimes with the pyqt build.
- As per previous discussion, will look at stating textualize without terminal.
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.
Update on the pyqt build: There is additional problems, with builds timing out running the instalment of pyqt on say python:3.12 image.
FROM python:3.12
RUN apt-get update && apt-get install -y \
g++ \
gcc \
make \
cmake \
musl-dev \
libffi-dev \
qt6-base-dev \
qt6-base-private-dev
ENV PATH="/usr/lib/qt6/bin:${PATH}"
RUN pip install PyQt6
self.user_info = {"Not authenticated": "Please login to DDS."} | ||
|
||
if self.user_info: | ||
self.add_column("Key") |
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.
We need to think of either another display or changing to something else than "Key" and "Value"
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.
Should be possible to have a table display without a header
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.
Or use a list view or something.
if self.user_info: | ||
self.add_column("Key") | ||
self.add_column("Value") | ||
for key, value in self.user_info.items(): |
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.
I'd also like us to rearrage the order of these at some point so that they are displayed in the following order:
- username
- role
- name
- primary email
- all emails
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.
Will leave right now until we decide on how to display.
### Comments | ||
|
||
- For some cli functions it's enough to just add a return statement in the method | ||
- The authentication would need to be either reformated or adding a parallel authentication for the gui --> could be a better solution to rewrite the authenticatin flow all together |
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.
Yes we don't want the parallel authentication, we want to reduce the amount of duplicate code as much as possible, so I agree that the better solution is to refactor the authentication flow
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.
We would need to have a discussion about the whole auth flow of the application
|
||
### Text | ||
|
||
There is no support for different fontsizes in textual. |
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.
This ties into one of my other comments -- the bar at the bottom. The size itself isn't a huge problem, but we definitely need to make those buttons clearer by moving them somewhere else and also possibly changing some other layout if not hte font size
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.
We could probably make a sidebar, but generally textualize is much more limited when it comes to customisation, compared to what we might be used with from web development. I don't think the bar itself is a problem, you get used to it quite fast, but I agree that it can be complicated when first using, or if you are not experienced with the system.
Group commands (in this case user) is availible through the footer bindings and have a layout using a sidebar corresponding to commands. The sidebar can have a title (now "DDS Sidebar") and a help button displaying a modal with markdown. This type of layput could be applied to all command groups. | ||
|
||
 | ||
 |
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.
I don't really understand what this image shows
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.
Which part? The help or "group page"?
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 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.
It shows the help pop up and an example of how markdown looks in textualize
Co-authored-by: Ina Odén Österbo <35953392+i-oden@users.noreply.github.com>
Read this before submitting the PR
If there is a field which you are unsure about, enter the edit mode of this description or go to the PR template; There are invisible comments providing descriptions which may be of help.
1. Description / Summary
Add a summary here: What does this PR add/change and why?
POC fot the DDS CLI new GUI/TUI
2. Jira task / GitHub issue
Is this a GitHub issue? --> Add the link to the github issue
Is this from a Jira task? --> If your branch does not contain info regarding the Jira task ID, put it here.
HMS-2332
3. Type of change - Add label
What type of change(s) does the PR contain? For an explanation of the different options below, enter edit mode of this PR description template.
If you do not want this change to be included in release notes, add the label
skip-changelog
.breaking
feature
feature
or none at all.Remember the to include a new migration version, or explain here why it's not needed.
bug
dependency
skip-changelog
skip-changelog
4. Additional information
master
branch: If checked, read the release instructions5. Actions / Scans
Make sure that the following checks/actions have passed.
If an action does not pass and you need help with how to solve it, enter edit mode of this PR template or go to the PR template.