I second the idea of revisiting the calendar. I add events in the calendar of what I’ve been doing every time I context switch. It makes it purposefully annoying to context switch often, and I revisit what I did that week at the end of it. Additionally, I’m able to answer questions such as “What percentage of time do I spend on research vs writing vs coding etc.
I've been using google calendar for the same thing, it make it easy to start dragging to log what task I've been doing, the fact that you can show multiple calendar and easily toggle between them helps with this theoretical plan vs what actually happened. there's also a script/webapp on github that help you sum the total time spent per timeunit per task or calendar.
does anyone know of an open source calendar app with the same ui/ux ?