InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.64k stars 903 forks source link

RFC: Timeline event packing #1878

Closed Avamander closed 6 months ago

Avamander commented 9 months ago

Problem: It's somewhat difficult to handle long-term and short-term events overlapping in the timeline in user-facing situations.

Proposal: Some of this confusion can be removed by implementing predictable conflict resolution.

We can adjust the timestamp value of the longer event to start at the end of shorter/previous element's timestamp + expiration and shorten expiration of the longer event by the amount shortened.

This packing shouldn't be done for equally-long events, neither should a shorter event be shortened.

Before:

|     |     |     |     |     |     |     |     |     |
|────────────────────────────────────────────────────────────►
  ┌───────────┐
  │Temperature│
  └───────────┘
     ┌────────────────────────────────────────────────┐
     │ Temperature (long-term)                        │
     └────────────────────────────────────────────────┘

After:

|     |     |     |     |     |     |     |     |     |
|────────────────────────────────────────────────────────────►
  ┌───────────┐┌──────────────────────────────────────┐
  │Temperature││ Temperature (long-term)              │
  └───────────┘└──────────────────────────────────────┘

Are there any potential use-cases where this might not work out as intended?

minacode commented 8 months ago

It's somewhat difficult to handle long-term and short-term events overlapping in the timeline in user-facing situations.

Can you explain more, what exactly the problem is?

JF002 commented 6 months ago

Thanks for your work @Avamander. However, I decided to rework the weather service to fix the issues more easily, so I'll close this one in favor of #1924.