Give each outcome a color, for its tag in task lists and the severity of the comment shown later
Closes https://www.drupal.org/project/orchestra/issues/3628640
An outcome had no color anywhere: the inbox history showed "rejected" and "approved" as the same plain text, and a context line showed a comment at a severity fixed in the line, so with two validation steps sharing one comment variable an approval and a rejection both showed as a warning.
What changes
- Outcome colors (
outcome_classes, every human node): one status palette class per outcome (Status::getPaletteOptions(): Neutral, Info, Success, Warning, Danger), next to the outcome labels. - Outcome column (
orchestra_work_item_outcome): moves ontoStateLabelFieldBasewith a Render as a styled tag option, colored throughWorkItemManager::getOutcomeClass(); an outcome with no color is the plain tag. The inbox history ships with it on. - Comment severity, written next to the comment in the same write and scope, derived from the color (Danger: error, Warning: warning, the others: status):
Completionaddsseverityto a structured payload (validation.severity) and drops one the submitted payload carried itself.CommentVariableTraitwritesNAME_severitybeside the comment variable (validation_comment_severity). It is always written, empty when the outcome has no color, so a step sharing the variable never keeps another step's severity.OutcomeSignalerhands task types the payload asCompletionwrote it.
- Display: a context line without a severity reads
NAME_severity, then the siblingseverityof a dotted path; an explicit severity still wins; nothing written falls back to status. The webform step now saves a line typed without a severity without one (it used to savestatus, which would have pinned it).
Existing configurations keep their explicit severities and show outcomes as before, except the shipped inbox history (optional config, new installs) which shows the outcome as a tag.
Deploying to an installed site
Context lines saved by the previous settings form always stored severity: status, even when the author typed none, so they keep showing as status and never take the outcome's severity. Re-saving the form does not help: it now shows that stored value back as | status. Remove severity: status from those entries (in the workflow config, or by deleting | status from each line in the form) wherever the outcome's color should apply. The shipped examples (request_validation, request_validation_link) drop theirs in this MR.
The issue first proposed refusing a comment variable name ending in _severity. Dropped: no name collides because of it.
Tests
Kernel, each guard checked to fail when removed:
OutcomeSignalerTest: severity from the color, written in both places; a forged one dropped; an outcome without a color clears the shared variable.ContextMessagesTest: the outcome's severity from both sources, explicit one wins, unknown falls back to status.InboxViewTest: the history colors a colored outcome and leaves an uncolored one plain;StateStatusViewsTest: the outcome column has the shared state-label shape.UserTaskOutcomeTest: one color select per outcome, "- None -" not saved.NodeSettingSchemaTest,TaskConfigRoundTripTest: the setting is typed and survives a modeler save.WebformInteractionValidationTest: a line without a severity is saved without one and shown back as typed.
Docs: human-tasks.md, interaction.md, webform.md, views.md. French translations updated; check-translations passes.