I’d love to add two sort options:
- Sort by how many times a note has been views
- Sort by how many times a note has been edited
It’d be added here:
This would entail adding some tracking of the number of times a file is opened/viewed. Perhaps this counter could be stored somewhere similar to how the settings are stored?
If we add this, wouldn’t the user except this information to be synced? Otherwise it means the same sort settings will give different orders in different devices, which might be confusing?
Apologies, I missed the notification of your response! Good point, that would happen if we stored it the same way as the settings.
How about we store it as a counter alongside the other note metadata? We could add
num_views: 0 and
num_edits: 0 as the default metadata and then increment them each time they’re viewed/opened.
Hmm, that would make sense but my concern is that it means a note will have to sync every time it is viewed, which seems heavy.
Or perhaps the views should only be saved locally, then written to the note object every x hours. So for example a note that’s been viewed 10 times in an hour will only get one sync and not 10. But of course that’s some additional complexity.
The easiest would be to write the view count to the note as you’ve suggested though, and maybe that’s fine, but I’m not sure. I guess it’s hard to know without knowing the usage patterns. For example if it means on average users will transfer 3 times more data, that’s a problem. But if it’s only 10% more that’s fine. Basically it’s hard to decide as we don’t have any metrics to work with. If you have any suggestion though let me know.