Skip to content

New Textual UI allows dynamic selection of which apps to install / uninstall - #149

Merged
IamJeffG merged 20 commits into
mainfrom
refactor-stack_deploy-2-GUI
Jul 22, 2026
Merged

New Textual UI allows dynamic selection of which apps to install / uninstall#149
IamJeffG merged 20 commits into
mainfrom
refactor-stack_deploy-2-GUI

Conversation

@IamJeffG

@IamJeffG IamJeffG commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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"

Screenshot_2026-07-20_14-14-07

After pressing "Go"

Screenshot_2026-07-20_14-14-36

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 logging emissions).

Drop deploy: boolean from the stack.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.py replaces def deploy_stack() by now delegating to the Deployer instead.

  • The call to _verify_existing_postgres_app is the only piece remaining from deploy_stack(). I'm not happy where it ended up!
  • refactors script entry to add dev_target for 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:

  • Add "uninstall" methods to all AppSpecs. Currently if you try to uninstall an app you just installed, it will raise NotImplementedError()
  • On startup, we need to query CapRover and resolve if any apps are already installed. (Currently it assumes none are installed, and if you try to install one already installed it will mark it FAILED).

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.

@IamJeffG
IamJeffG marked this pull request as ready for review July 20, 2026 21:48
@IamJeffG

Copy link
Copy Markdown
Contributor Author

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.

@IamJeffG
IamJeffG force-pushed the refactor-stack_deploy-2-GUI branch from b8531f9 to 05b61e3 Compare July 21, 2026 13:27

@rudokemper rudokemper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 was Ctrl-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 conservationtimothy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@IamJeffG

Copy link
Copy Markdown
Contributor Author
  • 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 was Ctrl-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?

These are added.

There is a merge conflict.

Thanks, fixed.

@IamJeffG

IamJeffG commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author
  • Could all applications be selected by default for a fresh install (e.g. checked, will install?)
  • 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...)

Done

@IamJeffG
IamJeffG merged commit 4126d35 into main Jul 22, 2026
@IamJeffG
IamJeffG deleted the refactor-stack_deploy-2-GUI branch July 22, 2026 14:52
@IamJeffG

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants