stretchly
stretchly copied to clipboard
History and Timeline of Breaks
Feature addition
Add a new window with history and timeline for breaks. Acceptance criteria:
- [ ] stretchly has events: break has started, break has finished, user has entered idle time, idle time ended, system went to sleep, wake up of the system, etc...
- [ ] every of this event is saved into local DB file (eg. Event) - SQLite or Postgres?
- [ ] when we are saving event, and we know it's the end of the event (eg end of break), we save new line in DB, let's say Activity (regural break, idle time, skipped break, extra break...)
- [ ] from Activities, we can then have some stats, graphs for skipped break, idle time etc..
Reference #200 and #86
@Sveijk
List
List of all events we could find and actions or state. Here's also an image attached of sketches for a data graph. Items that could be subject of the graph are:
- [ ] Counters (number of breaks, etc during some timeframe)
- [ ] Time (duration total of breaks, etc during some timeframe)
Events
- [ ] Go on break
- [ ] Go on microbreak
- [ ] Pause breaks
- [ ] Pause microbreaks
- [ ] Reset timer on breaks
- [ ] Go to idle mode
- [ ] Come out of idle mode
- [ ] Skip a break
- [ ] Finish break
- [ ] Finish microbreak
- [ ] Skip timer to the next break
- [ ] Skip timer to next microbreak
- [ ] Change settings { microbreaks enabled; microbreaks disabled; breaks enabled; breaks disabled }
- [ ] Reset to defaults
- [ ] Timing changed
- [ ] Skip enabled or disabled breaks / microbreaks
- [ ] Break induced
- [ ] Microbreak induced
- [ ] Manual pause (for an hour; for 2 hours; for 5 hours; indefinately) finished
- [ ] Normal pause finished
- [ ] Postponed
Activity / State
- [ ] Work
- [ ] Idle (computer idle or turned off)
- [ ] Break
- [ ] Suspended / paused
- [ ] Microbreak
- [ ] DND / presentation mode
I wrote a whole explanation of why i would do it a different way, and then I realized that yours is better. Great work!!!
Could you provide a proposal for the Event schema? Example:
{
id: string,
type: string,
timestamp: date
}
Hey folks, so some things I've been thinking about. I've polished your list of States
Activity / State
- work (when user is doing whatever she wants)
- idle/natural break (when we are in idle time - meaning user has been idle longer as 5 minutes - as it it in app right now)
- break (when break is on)
- microbreak (when microbreak is on)
- paused (user has manually paused)
- DND / presentation mode
- suspend (computer is in sleep)
- turned off (pc is turned off)
and questions I am not sure about:
- do we need to differ between suspend and PC turned off?
- what will happen when break is on and PC is suspended/turned off?
- do we need to differ between break and microbreak and natural break? (I guess we want to differ)
- do we want to have manually started breaks separately?
More specific stats that we would like to have in the end should help us answer this.
Events
We do not need events like user changed some settings and so on. I think the Event
should be an event inside application that causes one user State
to change to another.
We researched which database could be used with an Electron App. A database that wouldn't make the user install anything extra other than Stretchly. It seems that there're two options here that we know of: Sqlite and NeDB.
I'm for SQLite
I don’t think you need to use a full fledged database, couldn’t you just store things in the default app.getPath('userData')
data folder?
Are there any updates on this? I would love to add this to the current statistics I am tracking to analyze my productivity.
For my use case, the same stats that workrave tracks for breaks (micro and long) would be perfect:
- Daily Number of prompted breaks taken
- Daily Number of breaks skipped
- Daily Number breaks postponed
Hi @nicolae-stroncea , no progress. There was some work done by RGSoC students few years ago, but that would be much outdated now.
I ran stretchly
form the CLI and noticed that the logs are very detailed and would provide me exactly the information that I need:
17:24:27.186 › Stretchly: starting Mini Break
17:24:57.192 › Stretchly: finishing Mini Break
17:30:03.993 › Stretchly: pausing breaks because of idle time
17:31:00.055 › Stretchly: resuming breaks after idle time
17:40:50.055 › Stretchly: showing Mini Break notification
17:41:00.519 › Stretchly: showing window 1 of 1
17:41:00.521 › Stretchly: starting Mini Break
17:41:31.580 › Stretchly: finishing Mini Break
Are the logs permanently written to some file by any chance? For me, a persistent log file containing the above would be enough to parse and extract the useful information I need.
As a side note, feels like the same place where this is logged, events could also just be sent to a SQLite database with very little changes (one col for start time, end time, and one for event type)
Yes, it is saved to log file. More info in README, log is rotated, though. In debug info of About page, you can see file location.
I'm so tempted to have a go at this but will probably end up reading from the existing log file as previous adventurers have concluded. Looking at there 2018 PR, you'd really need to split this up into more finely grained PRs IMO:
- Add SQLite with flexible events format
- Start adding different event types (basically follow where existing electron log messages are)
- Add option to export stats as CSV (low lift, would unblock most people interested in this right now anyway I suspect)
- Add new section under preferences to show stats / graphs etc
With possible follow up:
- Make stat collection opt-in
- Clear stats option
- Compaction to avoid this growing too quickly
- More ways to show / visualise stats
Yes, I think I agree this is a huge thing to implement. SQLite would definitely need testing, if it were working on packaged app etc. Remember when we were looking into it few years ago, it was not unproblematic.
Starting with UI/wireframes is good in a way that it gives sense what data we need from "backend"
Solving this would obviously require major efforts, so it's unlikely to happen shortly. Meanwhile, Workrave offers good usage statistics. These cover breaks:
...as well as activity:
I realize as I write this that these statistics are unreliable (the proportion of natural breaks I take is surely not 15 on 15), and usage time has always been largely underestimated for me, but still, I'm afraid it will take a while before Stretchly gets to that level. I find weekly and monthly usage to be the most useful metrics.
Appreciated.