Skip to content

Experiments panel: starting or stopping an experiment leaves the editor's banner and tag stale #37763

Description

@oidacra

Problem Statement

The Universal Visual Editor shows two things about a page's experiment: the warning banner at the top of the shell, and the running-experiment tag in the toolbar. Both read one value, pageExperiment in the editor store, and that value is written in exactly one place — the page-load response. Nothing writes it again.

The experiments panel, which now lets an editor start and stop an experiment without leaving the page, does not write it either, and closing the panel does not reload the page. So any experiment transition made from the panel leaves both surfaces showing the state the page had when it loaded.

Two consequences, both reported from the editor:

  1. Stop an experiment in the panel, close the panel. The yellow banner still says the page is running an experiment. The toolbar tag also stays.
  2. Start an experiment in the panel. Neither the banner nor the tag appears.

Impact: the editor is told something false about the page they are editing, and the banner exists precisely to be trusted while they edit. It corrects itself only on a reload, which nothing prompts them to do.

Steps to Reproduce

  1. Open a page with a running experiment in the editor.
  2. Confirm the yellow banner is shown and the toolbar carries the running tag.
  3. Open the experiments panel and stop the experiment.
  4. Close the panel.
  5. The banner and the tag are still there. Reload the page and both disappear.

For the second case, start from a page with no running experiment, create and start one from the panel, close it, and observe that neither surface appears until reload.

Acceptance Criteria

  • Stopping an experiment from the panel removes the banner and the tag without a reload.
  • Starting an experiment from the panel shows the banner and, if it is kept, the tag, without a reload.
  • The same holds for every transition the panel offers that changes whether an experiment is live, including scheduling and cancelling a scheduled one.
  • Neither surface is left showing a stale experiment after the panel is closed.
  • A page with no experiment is unaffected.

dotCMS Version

Latest from main.

Additional Context

Root cause is one thing, not two. pageExperiment is written only in the page-load path in withPageApi. The shell's banner condition and the toolbar's tag computed both derive from it. The panel's transitions go through the experiments configuration store and never reach the editor store, and the panel's close only resets its own state.

One open product question, worth deciding before implementing. Is the running-experiment tag still worth keeping? Since the experiments panel shipped, the tag's only job is to open that panel on the experiment's results, and the banner already states the same fact and carries a link to the same place. If the tag goes, this defect is half the size and the toolbar loses a duplicate. If it stays, it needs the same refresh as the banner.

Related: #37478 (experiments panel in the editor), #37308 (the banner).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions