feat(android): saving works without a connection
The save used to start from the network: without it, nothing was kept. But what someone has just typed is already theirs - publishing is a consequence, not a condition. The cache is written first, always, and the repository follows when it can. A failed publish no longer loses anything. It raises a flag, and the toast says both things: that it is kept, and that the repository does not know yet. A bare "failed" would have people retype what is already there. On conflict the two snapshots are now MERGED rather than the change replayed. Replaying one edit onto the fresh snapshot was right while writing required being online; with offline saving several changes can be waiting here, and replaying one would drop the others. Sync publishes what is pending BEFORE fetching. Fetching first would overwrite our cache with the repository's version and the offline change would vanish without a word - exactly what offline saving promises to prevent. A dot on the padlock says changes are waiting: discreet until looked for, present at every glance.
This commit is contained in:
@@ -179,6 +179,14 @@
|
||||
.btn.ico-btn svg { width: 22px; height: 22px; }
|
||||
/* Le retour d'appui ne peut plus venir du fond : il vient du trait. */
|
||||
.btn.ico-btn:active { opacity: .45; }
|
||||
/* Le point des modifications en attente. Sur le cadenas parce qu'il est
|
||||
toujours a l'ecran de la liste, et qu'il parle deja de l'etat du coffre. */
|
||||
.ico.pending { position: relative; }
|
||||
.ico.pending::after {
|
||||
content: ''; position: absolute; top: 6px; right: 6px;
|
||||
width: 9px; height: 9px; border-radius: 50%;
|
||||
background: #ffb44d; box-shadow: 0 0 0 2px var(--bg-top);
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
/* L'ENREGISTREMENT DURE UNE A DEUX SECONDES, et le bouton doit le dire. Le
|
||||
mot "Saving..." le disait ; une coche immobile ne dirait rien, et c'est
|
||||
@@ -1459,6 +1467,12 @@ var PM = {
|
||||
/// Delphi l'appelle des qu'il part travailler et des qu'il revient. Le
|
||||
/// filet est son minuteur de 25 s : meme si une operation ne rend jamais la
|
||||
/// main, le voile se leve.
|
||||
/// DES MODIFICATIONS ATTENDENT ICI. Un point sur le cadenas : discret tant
|
||||
/// qu'on ne le cherche pas, mais present a chaque coup d'oeil - c'est la
|
||||
/// seule facon de savoir que le depot ignore encore ce qu'on vient de taper.
|
||||
setPending: function (on) {
|
||||
document.getElementById('lock').classList.toggle('pending', !!on);
|
||||
},
|
||||
setBusy: function (on) {
|
||||
if (on) document.getElementById('busy').firstChild.innerHTML =
|
||||
ico('loader', 'Working') + '<span>Please wait...</span>';
|
||||
|
||||
Reference in New Issue
Block a user