@@ -3,7 +3,8 @@ local renderer = require("codeme.ui.renderer")
33
44local M = {}
55
6- function M .render (stats , width , height )
6+ function M .render (stats , width )
7+ stats = require (" codeme.util" ).apply_privacy_mask (stats )
78 local lines = {}
89
910 -- Helper for safe padding (local to avoid nil field errors)
@@ -168,7 +169,10 @@ function M.render(stats, width, height)
168169 end
169170 local ls = records .longest_session or {}
170171 if ls .duration and ls .duration > 0 then
171- table.insert (record_list , { " ⏱️ Longest Session" , util .format_duration (ls .duration ), util .format_date (ls .date or " " ) })
172+ table.insert (
173+ record_list ,
174+ { " ⏱️ Longest Session" , util .format_duration (ls .duration ), util .format_date (ls .date or " " ) }
175+ )
172176 end
173177 local hdo = records .highest_daily_output or {}
174178 if hdo .lines and hdo .lines > 0 then
@@ -196,15 +200,36 @@ function M.render(stats, width, height)
196200 table.insert (lines , { { " 📊 Fun Facts" , " exgreen" } })
197201 table.insert (lines , {})
198202 if earliest_start .time then
199- table.insert (lines , { { " 🌅 Early Bird: " , " commentfg" }, { earliest_start .time , " exgreen" }, { " (" .. (earliest_start .date or " " ) .. " )" , " commentfg" } })
203+ table.insert (
204+ lines ,
205+ {
206+ { " 🌅 Early Bird: " , " commentfg" },
207+ { earliest_start .time , " exgreen" },
208+ { " (" .. (earliest_start .date or " " ) .. " )" , " commentfg" },
209+ }
210+ )
200211 end
201212 if latest_end .time then
202- table.insert (lines , { { " 🌙 Night Owl: " , " commentfg" }, { latest_end .time , " exgreen" }, { " (" .. (latest_end .date or " " ) .. " )" , " commentfg" } })
213+ table.insert (
214+ lines ,
215+ {
216+ { " 🌙 Night Owl: " , " commentfg" },
217+ { latest_end .time , " exgreen" },
218+ { " (" .. (latest_end .date or " " ) .. " )" , " commentfg" },
219+ }
220+ )
203221 end
204222 if most_languages_day and most_languages_day .date ~= " " then
205223 local langs_count = util .safe_length (most_languages_day .languages )
206224 if langs_count > 0 then
207- table.insert (lines , { { " 🌍 Polyglot Day: " , " commentfg" }, { langs_count .. " languages" , " exgreen" }, { " (" .. most_languages_day .date .. " )" , " commentfg" } })
225+ table.insert (
226+ lines ,
227+ {
228+ { " 🌍 Polyglot Day: " , " commentfg" },
229+ { langs_count .. " languages" , " exgreen" },
230+ { " (" .. most_languages_day .date .. " )" , " commentfg" },
231+ }
232+ )
208233 end
209234 end
210235 table.insert (lines , {})
@@ -218,10 +243,16 @@ function M.render(stats, width, height)
218243 local challenges = {}
219244
220245 if mpd .time and today_time > 0 and mpd .time > today_time then
221- table.insert (challenges , { icon = " 🎯" , text = util .format_duration (mpd .time - today_time ) .. " to beat your best day" , hl = " exyellow" })
246+ table.insert (
247+ challenges ,
248+ { icon = " 🎯" , text = util .format_duration (mpd .time - today_time ) .. " to beat your best day" , hl = " exyellow" }
249+ )
222250 end
223251 if ls .duration then
224- table.insert (challenges , { icon = " ⏰" , text = " Can you beat " .. util .format_duration (ls .duration ) .. " in one session?" , hl = " normal" })
252+ table.insert (
253+ challenges ,
254+ { icon = " ⏰" , text = " Can you beat " .. util .format_duration (ls .duration ) .. " in one session?" , hl = " normal" }
255+ )
225256 end
226257 if # challenges > 0 then
227258 for _ , ch in ipairs (challenges ) do
0 commit comments