aboutsummaryrefslogtreecommitdiff
path: root/internal/app/state.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-30 08:47:29 +0000
committerFuwn <[email protected]>2026-01-30 08:47:29 +0000
commit75fa492c7268b02ef3586d97c40121c791f60f7f (patch)
treed46a2c05f53ecbc986a971c3504b40f8cc16a8d3 /internal/app/state.go
parentfeat(claude:session): Support orphaned sessions (diff)
downloadfaustus-75fa492c7268b02ef3586d97c40121c791f60f7f.tar.xz
faustus-75fa492c7268b02ef3586d97c40121c791f60f7f.zip
fix: improve orphaned session handling
Diffstat (limited to 'internal/app/state.go')
-rw-r--r--internal/app/state.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/internal/app/state.go b/internal/app/state.go
index 82e186d..cebd672 100644
--- a/internal/app/state.go
+++ b/internal/app/state.go
@@ -72,10 +72,19 @@ func (m *Model) updateFilteredFromOriginal() {
func (m *Model) reloadSessions() {
sessions, loadError := claude.LoadAllSessions()
- if loadError == nil {
- m.sessions = sessions
+ if loadError != nil {
+ m.setMessage("Reload error: " + loadError.Error())
- m.updateFiltered()
+ return
+ }
+
+ m.sessions = sessions
+
+ m.updateFiltered()
+ m.invalidatePreviewCache()
+
+ if m.cursor >= len(m.filtered) {
+ m.cursor = max(0, len(m.filtered)-1)
}
}