Module save_status
Expand description
A document’s save status, said in the window’s bar
(crate::window_toolbar::notify).
A save that lands within SAVE_STALL says nothing, however long it
took: a document that autosaves needs no “Saving…” and no “Saved”.
Unconfirmed after SAVE_STALL, the bar’s notice says “Couldn’t save
yet. Retrying…” and the surface asks for one more submission
(SaveStatusSurface::take_retry); the save that then lands says
“Saved” for a notice’s lifetime. After SAVE_GIVE_UP the notice says
“Not saved” with “Try again” beside it, and stays. If nobody sees the
window then (the document is out of sight), the surface asks the host to
raise a notification (SaveStatusSurface::take_notice), since the
person could lose work they cannot see.
A save that failed with a reason is an error notice with the reason and
“Try again”. It stays, through the retries it asks for, until a save
succeeds; that save says “Saved” once, however quickly it landed. The
state itself stays readable through SaveStatusSurface::state for an
app’s accessibility status and automation. A framework window gets a
surface from its root, fed and routed with no app code (tilo-app’s
framework::Saves).
Structs§
- Save
Notice - What to tell a person who cannot see a document whose save gave up:
post it as a notification whose action is “Try again”, and route that
action to
SaveStatusSurface::retry_from_notice. SeeSaveStatusSurface::take_notice. - Save
Status Surface - A document’s save status, in the window’s bar (see the module).
Enums§
- Save
Action - What a person did about a save.
- Save
State - What a document’s save state is, as the save status surface says it.
Constants§
- SAVE_
GIVE_ UP - How long a save may stay unconfirmed before the surface stops waiting
and asks the person to try again: the first submission’s
SAVE_STALL, then as long again for the retry it asked for, so the retry gets the same chance before the person is asked. - SAVE_
RETRY_ ACTION - The bar action id of the save notice’s “Try again”.
- SAVE_
STALL - How long a save may wait for the store to confirm before the surface says so in plain words and asks the host to submit the changes again. Until then it says nothing: a document whose every change is a CRDT operation saves continuously, and a save that is merely slow is a performance bug to fix where it happens, never news for the person.