printProfileTimeline renders stances and the milestone timeline.
(profile memory.UserProfile)
| 823 | |
| 824 | // printProfileTimeline renders stances and the milestone timeline. |
| 825 | func printProfileTimeline(profile memory.UserProfile) { |
| 826 | if len(profile.Stances) > 0 { |
| 827 | fmt.Printf("\n %s\n", colorize(i18n.T("mem.cmd.profile.stances"), ColorYellow)) |
| 828 | for _, s := range profile.Stances { |
| 829 | line := s.Position |
| 830 | if s.Reason != "" { |
| 831 | line += " — " + s.Reason |
| 832 | } |
| 833 | fmt.Printf(" %s\n", line) |
| 834 | } |
| 835 | } |
| 836 | if len(profile.Milestones) > 0 { |
| 837 | fmt.Printf("\n %s\n", colorize(i18n.T("mem.cmd.profile.milestones"), ColorYellow)) |
| 838 | ms := profile.Milestones |
| 839 | if len(ms) > 10 { |
| 840 | ms = ms[len(ms)-10:] |
| 841 | } |
| 842 | for _, m := range ms { |
| 843 | fmt.Printf(" [%s] %s\n", m.Date.Format("2006-01-02"), m.Text) |
| 844 | } |
| 845 | } |
| 846 | } |
| 847 | |
| 848 | // sortedStringKeys returns map keys in stable order for deterministic output. |
| 849 | func sortedStringKeys(m map[string]string) []string { |
no test coverage detected