New sleep start/end times feature is overeager
In short since I'm typing and walking, I think this feature should not count several hours of awake time after a short nap (or in this case, a misdetectrd nap) as just an awakening during sleep, resulting in the idea that I sleep from 17:00.
I think this should be solved by considering only awakenings briefer than about an hour, or half the time of the preceding sleep (whichever is shorter) as being "part of" the sleep session.
@elagin Do you have an idea how to fix this? In theory one can have many separate sleep periods during a day. One could take the longest period. A sleep period could still be interrupted by wakeups (short enough to be tolerable). Maybe we need some more structure ini the ActivityAnalysis classes to express this.
By the way, I'm not sure if it's worth opening a separate issue, but I've thought for a while that the way total slept time is computed should probably be rethought: typically, I look at my asleep time after waking up, but if I've waken up earlier than I did the previous day, it will consider part of the previous day's sleep in the calculation, resulting in an overestimate of the night's slept time. This estimate will then go down later during the day, which is a bit counterintuitive.
So perhaps, aside from the sleep start/end time, the total slept time should only consider the past 12 hours, or if that's not appropriate because it'd miss naps, at least the past 20 hours? Something that makes reasonably sure the previous day's sleep isn't tacked in, at any rate.
Deleting a branch is permanent. It CANNOT be undone. Continue?