feat(ui): Add dialog for installing missing dependencies

When users click on modules with missing dependencies (orange tiles),
show a dialog listing the missing dependencies and their install
commands. This helps users quickly identify what they need to install
to enable the module.
This commit is contained in:
Stu Leak 2025-12-31 13:25:59 -05:00
parent d7175ed04d
commit 62dd39347a

35
main.go
View File

@ -2673,10 +2673,45 @@ func (s *appState) showBenchmarkHistory() {
s.setContent(view)
}
func (s *appState) showMissingDependenciesDialog(moduleID string) {
missing, _ := getModuleDependencyStatus(moduleID)
if len(missing) == 0 {
return // No missing dependencies
}
// Build message with missing dependencies and install commands
var message strings.Builder
message.WriteString("This module requires the following dependencies:\n\n")
for _, depName := range missing {
if dep, ok := allDependencies[depName]; ok {
message.WriteString(fmt.Sprintf("• %s\n", dep.Name))
if dep.InstallCmd != "" {
message.WriteString(fmt.Sprintf(" Install: %s\n\n", dep.InstallCmd))
}
}
}
// Create dialog
dialog.ShowInformation(
"Missing Dependencies",
message.String(),
s.window,
)
}
func (s *appState) showModule(id string) {
if id != "queue" {
s.stopQueueAutoRefresh()
}
// Check if module has missing dependencies
if !isModuleAvailable(id) && id != "settings" {
s.showMissingDependenciesDialog(id)
return
}
// Track navigation history
s.pushNavigationHistory(id)