Title a step's page with its interaction's own heading when no title is written for it, and give the comment page "Add a comment"

Closes https://www.drupal.org/project/orchestra/issues/3631383

A task or operation page now falls back to the heading its interaction gives itself (InteractionInterface::getDefaultTitle(), e.g. a payment's "Complete your payment") before the step label.

Each way into a step is titled by a class of its own, which spells out its order:

Way in Class Order
Simple action (user task, user operation forms) StepTitle (base module) action page title → action label → step label
Interaction task or operation (page, route title, comment page) ActionInteractionTitle (new) action page title → action label → interaction's heading → step label
External interaction (visitor's page, its comment page) ExternalInteractionTitle (new) Page title → interaction's heading → step label
  • StepTitle keeps the parts the other two reuse: findActionTitle(), fillTitle(), getStepLabel() and isWaitingStep(). The base module still never names an interaction.
  • The interaction is built only when the author wrote no title. The task and operation page passes the interaction it already built; the route title and the doorway let ActionInteractionTitle build it from the step.
  • CapabilityGateway::resolveTitle() and ActionInteractionTrait::resolveTitle() each delegate in one line. New InteractionResolver::getDefaultTitle() builds an interaction from its descriptor and asks its heading.
  • The task and operation page builds its interaction from getActionInteraction(), the same lookup the doorway uses, instead of a copy of it.
  • The action page title's help text, its French translation, the getDefaultTitle() contract and the docs (human-tasks.md, interaction.md) describe the new order.

Tests: InteractionOperationTest::testTheInteractionsHeadingComesAfterTheAuthoredTitles (page, route title, doorway) and testTheInteractionIsAskedOnlyWhenNoTitleIsWritten (never asked when a title is written; an empty heading falls through to the step label). Mutants checked locally, each failing a test: heading never asked, heading before the action titles, empty heading kept, route title lost, External heading before the Page title (InteractionAccessTest::testTitleUsesParkedInteraction).

AI-Generated: Yes (Claude Code was used to write the change, its tests and this description. I reviewed them.)

Edited by Frank Mably

Merge request reports

Loading
Loading