Repository navigation
OMNIS-32: Toggle modules in the TUI - #40
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
YouTrack: https://youtrack.xn--wrm-hoa.li/issue/OMNIS-32 (sub-task of OMNIS-14)
In
omnishell tui, Space now enables or disables the selected module inconfig.toml, throughmodedit.Enable/Disable(the same rules asomnishell enable/disable). Modules that cannot run on this host are dimmed with the reason shown, the header counts the changes since start, and a rejected toggle shows its reason on a status line and leaves the checkbox alone. No new dependencies.Changes
modedit:ModuleView.Unavailableexplains why a module cannot run here (unsupported OS, or none of the managed shells can run it). The shell rule is shared withEnable, and a test pins that dimming andEnablenever disagree. NewEditor.Statuses()reads onlyconfig.toml.tui:BackendgainsEnable,DisableandStatuses.Updatestays free of I/O: Space returns atea.Cmdthat writes and then re-reads the statuses. One write runs at a time (a "saving…" marker shows in the footer), and the cursor stays where the user moved it.tuiview: change counter in the header (net difference from the start, so toggling back counts as no change), status line in place of the help text, dimmed rows, aHost:line in the detail pane. Backend text on the status line goes throughsanitize.cli: the backend adapter shortensconfig.Errorto its message (the config path would push the reason off a one-line status bar). Thetuicommand builds its engine withio.Discardwriters.CLAUDE.mddescribe the behaviour; the implementation plan is underdocs/superpowers.Commits
Review findings fixed before this PR
brew list --versions,dpkg-query) was copied onto the terminal the UI was drawing on, because the runner writes to the writers it is given. Thetuiengine now getsio.Discard.Behaviour to know about
enablefail. A module dimmed for its OS can still be enabled (applyskips it), exactly as withomnishell enable; this PR does not changeenable.Test plan
make vetandmake test(race detector) pass locally.golangci-lintv2.13.2 (the CI version, viago run) reports 0 issues.CGO_ENABLED=0 go build ./cmd/omnishellsucceeds for linux/amd64, linux/arm64, linux/armv6, linux/armv7, darwin/amd64 and darwin/arm64.go.modandgo.sumare unchanged.golangci-lint,govulncheckand the build matrix pass.HOME(never a real config), runomnishell init, thenomnishell tui. Press Space on a few modules and check thatconfig.tomlchanges at once and keeps its comments, that the counter and checkboxes follow, that a zsh-only module on a bash-only host is dimmed and shows the rejection, that pressing Space twice quickly does not undo itself, and that no stray text appears on screen.Known gaps (not in this PR)
omnishell liststill passes its real stdout to the engine, so package-manager probe output can end up inlistand corruptlist --json. It predates this change; the sameio.Discardfix applies.applyhandoff are the next sub-tasks (OMNIS-33, OMNIS-34).