Open tleyden opened 8 years ago
Do you think this could be done with the new pendingDocuments
method in 1.2? It'd then be possible to show a notification badge with the number of docs that have not been pushed. Maybe the replication event can also be used to trigger the different title color when it's pushed.
There's also an isDocumentPending method.
REF: https://github.com/couchbase/couchbase-lite-ios/issues/442
Yes, this is exactly what that 1.2 feature is for.
@pasin / @PaulCapestany what about this approach?
We assume that the item will sync, and the first 5 seconds after an item was created we just show it as black no matter what the state of repl.isDocumentPending(task)
. After 5 seconds, we will check the repl.isDocumentPending(task)
state, and if it's still pending, we'll show it as grey. But rather than using a timer, we just compare the timestamps. So the code becomes:
# showing a table cell
delta = time.Now() - task.CreatedAt()
if delta < 5.seconds:
textColor = black
else
textColor = repl.isDocumentPending(task)
The user experience will be very similar to the current user experience on the master branch, in that any items added will immediately appear as black (and no flickering), but if the item hasn't sync'd for 5 seconds, they will flip to grey to alert the user that something might be wrong with the replication (very useful for QE testing)
@tleyden, I think we still need a kind of timer (timer, kvo, or prrform with delay) to keep checkingtbe status after 5 secs. I plan to take the current PR and feel the flickering first.
It doesn't have to turn to grey (if it doesn't sync) exactly 5 seconds later, as long as that table cell callback gets called at some point, then it would turn to grey.
I plan to take the current PR and feel the flickering first.
ok sounds good. Btw, expect buggy behavior until https://github.com/couchbase/couchbase-lite-ios/issues/1132 is resolved.
Indicate todo lists and todo items that have not been pushed up to Sync Gw yet by changing the font to light grey (as is done in the Evernote app)