New Textual UI allows dynamic selection of which apps to install / uninstall - #149
Conversation
|
Textual has a way to split the CSS into its own file (not inlined as a Python class variable), but I haven't looked into that. |
TODO: refresh state of all apps from caprover
b8531f9 to
05b61e3
Compare
There was a problem hiding this comment.
Tried this in runtime for a real deployment!
- Could all applications be selected by default for a fresh install (e.g. checked, will install?) I expect the most common use case will be a one-time installation of the full stack, after which the tool will almost never be run again. Selecting everything by default would save the user eight clicks.
- Let’s add some basic usage documentation to
INSTALL_GC_STACK.md, possibly with a screenshot. It was not immediately obvious to me how to exit the interface. I initially thought I could click the O in the top-left corner or click Go with nothing selected. In my terminal, the correct command wasCtrl-Q. This could also be made more explicit in the UI instructions. - When the script is run with
--dry-run, could the UI display a notice indicating that it is in dry-run mode and briefly explain what that means? - As a nice-to-have, when an application is installed successfully, could its status update from will install to installed while the script is still running? (I imagine not, or that it's not worth the effort, but still thought to ask...)
Approving the PR but feel free to decide on what to do with this feedback before merging.
And just for posterity (we discussed this on chat): it would be good to have a way to uninstall an app from the GUI, in case something goes wrong (like the NodeId error) and the app is technically installed but with caprover-placeholder-app.
EDIT: forgot to mention, overall a massive improvement!
conservationtimothy
left a comment
There was a problem hiding this comment.
I think this is a huge improvement. I do think it's worth documenting as imo it is a huge change from how it was before. Far simpler tbh and nicer but worth documenting this new pattern.
Our GUI, what it does, why it exists
Note: There is a merge conflict.
These are added.
Thanks, fixed. |
i.e. "Will install"
Done |
stop deriving checkbox value from status. This hardens the idea that we track desired/intended checked-state separately from displayed status.
|
Thanks for your suggestions! Having to think them through forced me to clarify my mental model of how this TUI app works, and I think the result is both more correct and more straightforward code. |
Goal
New Textual UI allows dynamic selection of which apps to install / uninstall
The motivation is that this will be the mechanism by which users can choose to uninstall an app (as opposed to only install) -- added in #150
Screenshots
Before pressing "Go"
After pressing "Go"
What I changed and why
+316 new lines are in gui.py. The three components here are Deployer (the fullscreen GUI), ChecklistScreen (the left-side, which takes user interaction), and RawLog (which shows logs, intercepting
loggingemissions).Drop
deploy:boolean from thestack.yamls, since that determination is now made in the UI at runtime. This is the only change in most of the other files touched in this PR.stack_deploy.pyreplacesdef deploy_stack()by now delegating to the Deployer instead._verify_existing_postgres_appis the only piece remaining fromdeploy_stack(). I'm not happy where it ended up!dev_targetfor local development: see its docstring.Note to reviewers: The commit history is not organized well enough to recommend commit-by-commit review.
How I convinced myself this is right
I am convinced it still installs the stack successfully.
That said, I'm less convinced that all this is necessary, is the right solution. It might be overkill.
I also wonder if it's a problem that this change DISABLEs unattended / fire-and-forget script runs. You MUST use the UI.
What I'm not doing here
Added in #150:
raise NotImplementedError()I have daydreams of splitting the log lines into a separate tab for each app. That may not happen anytime soon.
LLM use disclosure
Claude Sonnet 5 wrote most of the textual code, with a fair amount of editing by me.