Problem/Motivation

A step's page is titled by a chain of fallbacks, and the two doorways that open a step do not use the same chain.

  • The link of an External interaction: its Page title, else the interaction's own default title (InteractionInterface::getDefaultTitle()), else the step label.
  • A task or an operation: the action title, else the action label, else the step label (StepTitle::resolve()). The interaction's default title is never asked.

Example: a task whose action interaction is a payment, with no action title and no action label. Opened from the External interaction link, its page reads "Complete your payment". Opened as a task, the same page reads the step label.

Proposed resolution

Ask the interaction's default title before the step label on task and operation pages:

action title → action label → the interaction's default title → step label

  • A text the author wrote still wins over a plugin default, so every page that shows an action title or an action label today keeps it.
  • StepTitle lives in the base module and cannot name an interaction, so StepTitle::resolve() and resolveWaitingStepTitle() take an optional closure that returns the default title. It is called only when the chain reaches it.
  • The task and operation page passes the interaction it already built to render the step, so no extra interaction is built.
  • The route's title callback (what a breadcrumb asks) and the comment page opened from a task or an operation build the interaction only when the chain reaches the default title, so the page heading and the breadcrumb keep giving the same answer.
  • The user task form (inbox) and the user operation form have no interaction: unchanged.

Remaining tasks

  • Implement, with kernel tests on the task page, the operation page, the route title and the comment page.
  • Update the documentation of the title chain.

User interface changes

A task or operation page whose step has no action title and no action label shows the interaction's default title, when it has one, instead of the step label. Today only the payment interaction has one.

API changes

StepTitle::resolve() and StepTitle::resolveWaitingStepTitle() take an optional default title closure.

Data model changes

None.

AI-Generated: Yes (Claude Code was used to help draft this issue summary. I reviewed it.)

Issue fork orchestra-3631383

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review
mably’s picture

Title: Title a task or operation page with its interaction's default title when the step has no action title or action label » 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"

  • mably committed a55101a6 on 1.x
    feat: #3631383 Title a step's page with its interaction's own heading...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.