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:
parent
0a687a6ad7
commit
1c402a0be7
35
main.go
35
main.go
|
|
@ -2673,10 +2673,45 @@ func (s *appState) showBenchmarkHistory() {
|
||||||
s.setContent(view)
|
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) {
|
func (s *appState) showModule(id string) {
|
||||||
if id != "queue" {
|
if id != "queue" {
|
||||||
s.stopQueueAutoRefresh()
|
s.stopQueueAutoRefresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if module has missing dependencies
|
||||||
|
if !isModuleAvailable(id) && id != "settings" {
|
||||||
|
s.showMissingDependenciesDialog(id)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Track navigation history
|
// Track navigation history
|
||||||
s.pushNavigationHistory(id)
|
s.pushNavigationHistory(id)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user