[#515] Add top websites and window titles#522
Conversation
casaout
left a comment
There was a problem hiding this comment.
great start, thank you!
I now mostly reviewed UI; and will review the code once we've settled on the design
| renderCompactTime(website.totalDurationMs) | ||
| }}</span> | ||
| <span class="top-item-percentage">{{ | ||
| getTopItemPercentage(website, topWebsites) |
There was a problem hiding this comment.
I think we should try to align the design slightly more to the existing design; few suggestions:
- the numbering can be simplified (no rounded border); or maybe even removed as it'll be intuitive which one is the highest one?
- the fonts should be the same as for the other insight boxes
- in the dark mode, i think the light background of the chart is a bit too strong
- i think we don't need to display the percentages (as the timeline chart will imply this anyways), and to have more space for the window title)
- it can be made a bit more compact, to reduce the overall height of the insights
Great that you're using the activity colors; that's awesome!!
There was a problem hiding this comment.
It already looks better, thank you. However, to me still looks a bit like it's in light mode (with the bright colors)...
- I wonder if it'd work better if the barchart was the actual category color
- the font was white (in dark mode) and dark (as is in light mode)? (then it'd look much more similar to the activities timeline (which also helps to clarify the colors)
- And the "white" part could be white in light mode; and a very dark shade (i.e. the background color); so the white font would easily be readable
Also, can we vertically make it slightly more compact, such as by removing some of the top/bottom padding between the text and the barchart?
There was a problem hiding this comment.
It already looks better, thank you. However, to me still looks a bit like it's in light mode (with the bright colors)...
- I wonder if it'd work better if the barchart was the actual category color
- the font was white (in dark mode) and dark (as is in light mode)? (then it'd look much more similar to the activities timeline (which also helps to clarify the colors)
- And the "white" part could be white in light mode; and a very dark shade (i.e. the background color); so the white font would easily be readable
Also, can we vertically make it slightly more compact, such as by removing some of the top/bottom padding between the text and the barchart?
What do you think of this?
There was a problem hiding this comment.
that's great, thanks! Do we need the broders at all? and how dos it look in light mode? thanks!
| <span class="top-item-time">{{ | ||
| renderCompactTime(website.totalDurationMs) | ||
| }}</span> | ||
| <span class="top-item-percentage">{{ |
There was a problem hiding this comment.
once we finalize on the design of these "charts", i think we can uniformly use the same design (and CSS) for all 4 boxes: top apps/activities & websites
| } | ||
|
|
||
| if (processName) { | ||
| const suffixes = [` - ${processName}`, ` — ${processName}`, ` | ${processName}`]; |
|
|
||
| if (processName) { | ||
| const suffixes = [` - ${processName}`, ` — ${processName}`, ` | ${processName}`]; | ||
| const matchingSuffix = suffixes.find((suffix) => title.endsWith(suffix)); |
casaout
left a comment
There was a problem hiding this comment.
thanks for the updates! To understand the "algorithm" for loading the actual datasets, extracting window titles, I think it'd be beneficial to add more documentation and rationale. otherwise, it's difficult to review the code, and also later maintain it. Thanks!
| </div> | ||
| </div> | ||
|
|
||
| <div v-if="topItemsAvailable" class="tile-grid mt-8"> |
|
|
||
| type WindowActivitySessionKeySelector = (activity: WindowActivityEntity) => string | null; | ||
|
|
||
| const BROWSER_PROCESS_NAMES = [ |
There was a problem hiding this comment.
what do we need this list for? (please add a quick comment to remember this later)
also, i wonder if we could reuse the list from https://github.com/HASEL-UZH/PA.WindowsActivityTracker/blob/main/typescript/src/mappings/browsers.ts and then compare the process name instead of app name? (and also extend it with the list from there)
There was a problem hiding this comment.
The tracker doesn't export the list a sa runtime import and it's being used to recognise the browser process names for title cleanup. So, for now, I've mirred the tracker browser mapping instead.
Add in-line comments and doc strings to RetrospectionService
| * | ||
| * Some browsers expose a title that is effectively the URL, for example | ||
| * "github.com/HASEL-UZH/PersonalAnalytics/pull/123". For display we keep the domain plus the last | ||
| * two path parts, producing "github.com/pull/123". This avoids unreadable full paths while still |
There was a problem hiding this comment.
i like that solution a lot! I was, however just wondering, if it should be github.com/.../pull/123 (i.e. add "..." to indicate it's shortened)
and maybe the same for stripPathFragment?
| * 6. If the remaining title is still generic, fall back to the captured URL domain. | ||
| * | ||
| * Examples: | ||
| * "4 or more pages - Overleaf - Microsoft Edge" -> "Overleaf" |
| date: Date, | ||
| limit = 3 | ||
| ): Promise<ActivitySessions[]> { | ||
| const browsingActivities = new Set([ |
There was a problem hiding this comment.
as discussed in the meeting, please also include Coding, Read/Write Document and Planning





Add Top Websites and Window Titles to Retrospection (Closes #515)
Description
Adds two new Retrospection detail cards that summarize where participants spent the most time during the selected day: top websites and top window titles. The cards use compact horizontal bars, durations, and relative percentages to make the details easy to scan alongside the existing Retrospection timeline and insights.
Changes Made
Top websitescard showing the top 3 website domains for the selected dayTop window titlescard showing the top 3 non-browsing window titles for the selected dayWorkRelatedBrowsingactivity and grouped by domain, without showing the browser app nameOther,Unknown, andIdleentries are filtered out before selecting the top 3Implementation Details
processNameoractivity. This allows website domains to be extracted from URLs and window titles to be cleaned before aggregation.getTopWebsiteSessionsonly considersWorkRelatedBrowsingentries, extracts the hostname from each URL, groups active time by domain, filters irrelevant values, sorts by total duration, and returns the top 3.getTopWindowTitleSessionsexcludes browsing categories (WorkRelatedBrowsing,WorkUnrelatedBrowsing, andSocialMedia), strips matching app suffixes from window titles, groups active time by cleaned title, filters irrelevant values, sorts by total duration, and returns the top 3.Screenshots
Closes #515