Skip to main content

task_notification

Function task_notification 

Source
pub fn task_notification(
    label: &str,
    outcome: &TaskOutcome,
) -> (NotificationLevel, String)
Expand description

NC.2: how a finished background task reads.

Pure, so the wording is tested without a bus. The label is an imperative phrase naming its object (“push main → origin/main”); the outcome is appended here, in one place, so every producer reads the same way:

OutcomeLevelText
succeededSuccesslabel — summary, or just label
stoppedWarnlabel stopped — message
failedErrorlabel failed — message

Success needs no “finished” — the check says it — and the icon does not stand alone for the other two: the word is what *messages* keeps, and what a reader without colour sees.