Commit 84de69d
Fix handling of array content format in user messages
Claude Code v2.0.76+ uses array content format like:
{"type": "user", "message": {"content": [{"type": "text", "text": "..."}]}}
The code was only handling string content format, causing sessions with
array content to show "0 prompts, 0 pages".
Added extract_text_from_content() helper function that handles both formats
and updated all locations that extract text from user message content.
https://gistpreview.github.io/?95c8fedc49e3a34e83559c1ed352287d/index.html
Closes #14
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 262a882 commit 84de69d
File tree
2 files changed
+69
-14
lines changed- src/claude_code_transcripts
- tests
2 files changed
+69
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
51 | 78 | | |
52 | 79 | | |
53 | 80 | | |
| |||
75 | 102 | | |
76 | 103 | | |
77 | 104 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
82 | 110 | | |
83 | 111 | | |
84 | 112 | | |
| |||
117 | 145 | | |
118 | 146 | | |
119 | 147 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
126 | 153 | | |
127 | 154 | | |
128 | 155 | | |
| |||
1144 | 1171 | | |
1145 | 1172 | | |
1146 | 1173 | | |
1147 | | - | |
| 1174 | + | |
| 1175 | + | |
1148 | 1176 | | |
1149 | | - | |
| 1177 | + | |
1150 | 1178 | | |
1151 | 1179 | | |
1152 | 1180 | | |
| |||
1558 | 1586 | | |
1559 | 1587 | | |
1560 | 1588 | | |
1561 | | - | |
| 1589 | + | |
| 1590 | + | |
1562 | 1591 | | |
1563 | | - | |
| 1592 | + | |
1564 | 1593 | | |
1565 | 1594 | | |
1566 | 1595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
94 | 120 | | |
95 | 121 | | |
96 | 122 | | |
| |||
0 commit comments