feat(m4b): add vault selection UI, enable/disable toggle, missing-installed UI
- Add VaultSelection.svelte: first-run vault create/open/recent UI - Update App.svelte: vault check on startup, show VaultSelection when needed - Update PluginCard.svelte: enable/disable buttons, vault state awareness - Update PluginManager.svelte: enable/disable handlers, missing-installed section - Add SetCurrentVault Wails API binding - Add RecordDesiredPlugin Wails API binding - Record desired plugins on discovery (only when vault open) - Fix addRecent: remove duplicate sort, clean up unused import - Update smoke-platform.sh: enable/disable lifecycle test - Add runEnableDisableTest: vault create/open, disable/enable, plugins.json verify
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@@ -237,19 +236,11 @@ func addRecent(list []string, path string, max int) []string {
|
||||
filtered = append(filtered, p)
|
||||
}
|
||||
}
|
||||
// Prepend
|
||||
// Prepend (most recent first)
|
||||
result := append([]string{path}, filtered...)
|
||||
// Trim
|
||||
if len(result) > max {
|
||||
result = result[:max]
|
||||
}
|
||||
sort.SliceStable(result, func(i, j int) bool {
|
||||
return result[i] < result[j]
|
||||
})
|
||||
// Actually keep insertion order: prepend is correct, just trim
|
||||
result = append([]string{path}, filtered...)
|
||||
if len(result) > max {
|
||||
result = result[:max]
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user