mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 15:04:42 +00:00
fix: enhance overview scan UI and invalidate cache on refresh
- Invalidate disk cache for overview entries on refresh to ensure fresh data. - Show dynamic status messages (e.g., 'Scanning Applications...') instead of static text in Overview. - Adjust spinner animation speed to 100ms for smoother visual experience.
This commit is contained in:
@@ -394,7 +394,7 @@ func (m model) scanCmd(path string) tea.Cmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func tickCmd() tea.Cmd {
|
func tickCmd() tea.Cmd {
|
||||||
return tea.Tick(time.Millisecond*80, func(t time.Time) tea.Msg {
|
return tea.Tick(time.Millisecond*100, func(t time.Time) tea.Msg {
|
||||||
return tickMsg(t)
|
return tickMsg(t)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -683,6 +683,11 @@ func (m model) updateKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
|||||||
m.largeMultiSelected = make(map[string]bool)
|
m.largeMultiSelected = make(map[string]bool)
|
||||||
|
|
||||||
if m.inOverviewMode() {
|
if m.inOverviewMode() {
|
||||||
|
// Explicitly invalidate cache for all overview entries to force re-scan
|
||||||
|
for _, entry := range m.entries {
|
||||||
|
invalidateCache(entry.Path)
|
||||||
|
}
|
||||||
|
|
||||||
m.overviewSizeCache = make(map[string]int64)
|
m.overviewSizeCache = make(map[string]int64)
|
||||||
m.overviewScanningSet = make(map[string]bool)
|
m.overviewScanningSet = make(map[string]bool)
|
||||||
m.hydrateOverviewEntries() // Reset sizes to pending
|
m.hydrateOverviewEntries() // Reset sizes to pending
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func (m model) View() string {
|
|||||||
return b.String()
|
return b.String()
|
||||||
} else {
|
} else {
|
||||||
fmt.Fprintf(&b, "%sSelect a location to explore:%s ", colorGray, colorReset)
|
fmt.Fprintf(&b, "%sSelect a location to explore:%s ", colorGray, colorReset)
|
||||||
fmt.Fprintf(&b, "%s%s%s%s Scanning...\n\n", colorCyan, colorBold, spinnerFrames[m.spinner], colorReset)
|
fmt.Fprintf(&b, "%s%s%s%s %s\n\n", colorCyan, colorBold, spinnerFrames[m.spinner], colorReset, m.status)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hasPending := false
|
hasPending := false
|
||||||
@@ -44,7 +44,7 @@ func (m model) View() string {
|
|||||||
}
|
}
|
||||||
if hasPending {
|
if hasPending {
|
||||||
fmt.Fprintf(&b, "%sSelect a location to explore:%s ", colorGray, colorReset)
|
fmt.Fprintf(&b, "%sSelect a location to explore:%s ", colorGray, colorReset)
|
||||||
fmt.Fprintf(&b, "%s%s%s%s Scanning...\n\n", colorCyan, colorBold, spinnerFrames[m.spinner], colorReset)
|
fmt.Fprintf(&b, "%s%s%s%s %s\n\n", colorCyan, colorBold, spinnerFrames[m.spinner], colorReset, m.status)
|
||||||
} else {
|
} else {
|
||||||
fmt.Fprintf(&b, "%sSelect a location to explore:%s\n\n", colorGray, colorReset)
|
fmt.Fprintf(&b, "%sSelect a location to explore:%s\n\n", colorGray, colorReset)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user