showSessionProgress shows files edited so far in this session
(root string)
| 1050 | |
| 1051 | // showSessionProgress shows files edited so far in this session |
| 1052 | func showSessionProgress(root string) { |
| 1053 | state := watch.ReadState(root) |
| 1054 | if state == nil || len(state.RecentEvents) == 0 { |
| 1055 | return |
| 1056 | } |
| 1057 | |
| 1058 | // Count unique files and unique hub files edited |
| 1059 | filesEdited := make(map[string]bool) |
| 1060 | hubFiles := make(map[string]bool) |
| 1061 | for _, e := range state.RecentEvents { |
| 1062 | filesEdited[e.Path] = true |
| 1063 | if e.IsHub { |
| 1064 | hubFiles[e.Path] = true |
| 1065 | } |
| 1066 | } |
| 1067 | hubEdits := len(hubFiles) |
| 1068 | |
| 1069 | if len(filesEdited) == 0 { |
| 1070 | return |
| 1071 | } |
| 1072 | |
| 1073 | fmt.Println() |
| 1074 | fmt.Printf("📊 Session so far: %d files edited", len(filesEdited)) |
| 1075 | if hubEdits > 0 { |
| 1076 | fmt.Printf(", %d hub edits", hubEdits) |
| 1077 | } |
| 1078 | fmt.Println() |
| 1079 | } |
| 1080 | |
| 1081 | // hookPreCompact saves hub state before context compaction |
| 1082 | func hookPreCompact(root string) error { |