Overview

When composing a prompt in Canvas AI, if any page metadata (such as meta description) is modified before submitting the prompt, all previously entered text in the Canvas AI prompt field is erased.

Proposed resolution

  • Updating any metadata field (title, description, etc.) should not clear the text entered in the Canvas AI prompt field.
  • The data in the Canvas AI prompt and in the metadata fields should be managed independently without interference from one another.

Steps to Reproduce (Refer attached video)

  1. Open a page using Canvas AI.
  2. Enter text in the page meta description
  3. Enter a prompt in the Canvas AI prompt field on the canvas but do not hit the "up arrow" icon yet.
  4. Change the metadata text by modifying description again.
  5. Observe that all the text previously entered in the Canvas AI prompt field disappears.
CommentFileSizeAuthor
Canvas AI input disappear.mov17.2 MBvipin.mittal18

Issue fork canvas-3558257

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

vipin.mittal18 created an issue. See original summary.

scott falconer made their first commit to this issue’s fork.

scott falconer’s picture

Status: Active » Needs review

Overview

While composing a prompt in the Canvas AI sidebar, changing page metadata (for example, meta description) clears the in-progress prompt text.

Steps to reproduce

1) Open a Canvas page with Canvas AI enabled.

2) Enter a meta description.

3) Type a prompt in the Canvas AI prompt field, but do not submit.

4) Change the meta description again.

Expected

The prompt text remains intact after metadata edits.

Actual

The prompt text is cleared after metadata edits.

Proposed resolution

Preserve prompt input across metadata updates by stabilizing DeepChat props and restoring the prompt content if the input is reset.

User interface changes

None.

Tests

ddev phpcs (pass)

ddev phpunit web/modules/custom/canvas_3558257/tests/src/Functional/BlockComponentFormTest.php (fail: expected size 0, got 1; matches issue 3570699)

ddev exec drush ev '\Drupal::currentUser()->setAccount(\Drupal\user\Entity\User::load(1)); $h=\Drupal::service("canvas_ai.page_builder_helper"); print $h->getComponentContextForAi();' (output missing block props use_site_logo/use_site_name/use_site_slogan; likely related to issue 3569120)

Intent testing via compare_runs: baseline prompt cleared, modified prompt preserved (artifacts in .intent_artifacts/issue_3558257/)

AI disclosure

Drafted with AI assistance; reviewed and tested by a human.

mglaman’s picture

Status: Needs review » Needs work

MR conflict needs to be resolved

mglaman’s picture

Status: Needs work » Needs review

Rebased, needs review

mglaman’s picture

Status: Needs review » Reviewed & tested by the community

I tested and it worked. I approved the MR but I'd like jessebaker to sign off on changes to ui/src/app/hooks.ts at least

wim leers’s picture

Assigned: Unassigned » jessebaker

Per #7.

tim.plunkett made their first commit to this issue’s fork.

rakhimandhania’s picture

wim leers’s picture

Assigned: jessebaker » Unassigned
Issue tags: +triaged

@jessebaker no longer works at Acquia.

Who should review this?

mglaman’s picture

Assigned: Unassigned » mglaman
Status: Reviewed & tested by the community » Needs work

MR is conflicted and "The source branch is 216 commits behind the target branch."

I think we can trust an agentic review of the refactor. I was confident with the change but wanted jessebaker as a "yep looks good"

I can poke at this. Probably next week at MidCamp, so someone can steal if sooner if they'd like.