-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Feat: Added Terminal User Interface (TUI) for Sugar #165
base: main
Are you sure you want to change the base?
Conversation
Implement a TUI for Sugar using the Textual library to provide a visual and interactive way to manage containers. The interface includes: - Dashboard for overview of profiles and services - Profile management screen with detailed configuration view - Services management with status and control capabilities - Real-time log viewer with filtering and auto-refresh functionality - Clean dark UI theme with consistent styling across screens Currently uses mock data for development and demonstration purposes. Integration with the Sugar backend will be implemented in future updates. This feature allows users to manage their containers with a more intuitive interface directly from the terminal, similar to k9s for Kubernetes.
@xmnlab Please review |
Hey @akshayw1 , Ivan is planning to make stats.py ( ie .. there is a extra is available under poetry install named |
@@ -7,6 +7,8 @@ | |||
from sugar.extensions.base import SugarBase | |||
from sugar.extensions.compose import SugarCompose | |||
from sugar.extensions.compose_ext import SugarComposeExt | |||
from sugar.extensions.tui import TUIExtension # Add this import |
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.
Please don't add unnecessary comments
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.
@akshayw1 , thanks for working on that.
I added a few comments here, but I realized that there are a bunch of small issues, so please fix that first and ping me again for a new round of review.
- all the files need to have an empty line at the end of the file. you probably should configure that in your IDE. Ref: https://dev.to/documendous/why-you-should-end-your-source-files-with-a-new-line-156g
- avoid adding unnecessary comments in the code (usually created by llvms)
from sugar.extensions.base import SugarBase | ||
|
||
|
||
class TUIExtension(SugarBase): |
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.
Please, rename it to SugarTUI
print("Starting Sugar TUI...") | ||
try: | ||
from sugar.tui.app import run | ||
print("Successfully imported run function") |
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.
avoid using print
s inside the code.
@docparams({}) # Empty dict since we don't have parameters | ||
def _cmd_tui(self) -> None: | ||
"""Launch the Sugar Terminal User Interface.""" | ||
print("Starting Sugar TUI...") |
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.
avoid using prints inside the code.
run() | ||
print("TUI has completed") # This will only print if run() completes/exits | ||
except Exception as e: | ||
print(f"Error launching TUI: {e}") |
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.
instead of using print, please use the proper method from logs.py
Pull Request description
This PR adds a new Terminal User Interface (TUI) for Sugar, providing a visual and interactive way to manage containers directly from the terminal. The design was inspired by k9s for Kubernetes and aims to make Sugar's functionality more accessible through an intuitive interface.
Solves #42
How to test these changes
pip install -e .
sugar tui
p
)s
)l
)I have added screenshots demonstrating UI and functionality.




Pull Request checklists
This PR is a:
About this PR:
Author's checklist:
Additional information
Currently, the TUI uses mock data for development and demonstration purposes. Integration with the actual Sugar backend will be implemented in future updates.
The new TUI features include: