Overview

Steps to reproduce:

  1. Navigate to a page in XB (e.g., /xb/xb_page/1)
  2. Modify the page title and/or alias
  3. See title update in the top bar
  4. Open the navigator by clicking the title in the top bar
  5. See that the title and/or alias wasn't reflected there

Proposed resolution

User interface changes

CommentFileSizeAuthor
CleanShot 2025-02-14 at 21.18.16.gif529.7 KBlauriii
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

lauriii created an issue. See original summary.

omkar-pd’s picture

anjali rathod’s picture

Assigned: Unassigned » anjali rathod
anjali rathod’s picture

const {
    data: pageItems,
    isLoading: isPageItemsLoading,
    error: pageItemsError,
  } = useGetContentListQuery('xb_page');

in PageInfo.tsx file.

Here we are getting the pageItems from ApiContentControllers::list() , which returns content values from $this->entityTypeManager->getStorage('xb_page'); entity . But since these are not published yet the value shows the last saved title or Untitled Page incase of new page. Inorder to reflect the immediate changes in the title in navigation drop down, we need to call and generate similar pageItems from AutoSaveManager::getAllAutoSaveList() .
This is my POV . Any feedback or suggestions are appreciated!

wim leers’s picture

Assigned: anjali rathod » lauriii
Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs product manager review

#4 is accurate. I can see how the title should update in the top bar where the Draft indicator is present. But I don't think it makes sense for it to be updated in the list of pages.

lauriii’s picture

Status: Postponed (maintainer needs more info) » Active
Issue tags: -Needs product manager review

The page title should update both in the top bar in the list. This is a common pattern many tools similar to XB. If we don't show name in the list once it has been changed, it is really hard to find the right page when creating several pages in a single publish, since all of them would show up as "Untitled page".

lauriii’s picture

Assigned: lauriii » Unassigned
wim leers’s picture

Component: Page builder » Page

@anjali rathod: I think @lauriii gave the answer you needed in #6? 😊

anjali rathod’s picture

@wim leers Yes. Should I go ahead with the approach I shared in #4 ?

anjali rathod’s picture

Assigned: Unassigned » anjali rathod

anjali rathod’s picture

Status: Active » Needs review

wim leers’s picture

Status: Needs review » Needs work
Issue tags: +openapi

🏓 on the MR. @larowlan's review/suggested direction will also require an update to openapi.yml.

P.S.: why the term navigator? 😅 That doesn't appear anywhere in the codebase.

wim leers’s picture

Issue tags: +sprint

parthbcharya made their first commit to this issue’s fork.

tedbow made their first commit to this issue’s fork.

tedbow’s picture

Assigned: anjali rathod » tedbow

working on the js test

tedbow’s picture

Assigned: tedbow » Unassigned
jessebaker’s picture

The page title should always reflect the autosave version of the page title.

The page title exists in 4 places -

  1. The value in the page data form field
  2. The title shown on the dropdown button in the top middle
  3. The title shown in the list of pages when you click the navigator
  4. The title shown in the list of autosaves in the review changes dropdown.

I think the CURRENT page title can only be updated from two places

  • Changing the value in the form field
  • Publish all changes in the rare situation that the page was renamed in another tab/by another user

Other pages' titles (shown in the navigator) can be updated in one place

  • When publishing all changes

Furthermore and not mentioned thus far in this issue, the navigator also shows the pages' url alias.

So, my proposed solution

  1. When user types in page title, in real time, purely on the client-side we update the value in the dropdown button. This is already in place in 0.x
  2. When user types in page title (or any field in the form on the right) we update the preview by calling the server This is already in place in 0.x
  3. When user types in page title, we invalidate the cache of the pages list (/xb/api/content/xb_page) in the navigator (using invalidateTags)
  4. We also invalidate the cache of the pages list when user types in the URL alias,
  5. We also invalidate the cache of the pages list when a user "publishes all"
  6. On the server side, when fetching the list of pages, the page title and url alias of each page returned should be that of the autosave if there is one.

Then we must ensure that when the navigator is opened, if the cache has been invalidated, we re-fetch the list of pages.

jessebaker’s picture

I've done most of the refactor that I suggested in #20

The list of pages that is returned from /xb/api/content/xb_page was previously updated to include a key autoSaveTitle . Can the same be done to also return an autoSavePath?

anjali rathod’s picture

@jessebaker by autoSavePath do you mean a path similar to /xb/xb_page/1/editor ?
Because the path key value pair returned from /xb/api/content/xb_page gives the path for the autosave entity.

tedbow’s picture

Assigned: Unassigned » tedbow

I chatted with @jessebaker about this.

This is about updating the path in the navigation to match the alias field if it was changed by the user

I am working on this

tedbow’s picture

Title: Updating page title does not get reflected inside the navigator » Updating page title or alias does not get reflected inside the navigator
Issue summary: View changes

updated title and summary for alias updates

tedbow’s picture

Assigned: tedbow » Unassigned
Status: Needs work » Needs review
wim leers’s picture

This is working around the problem introduced in #3500052, identified at #3500052-27: Provide HTTP API for listing Page content entities that can be updated by the current user, then discussed by @lauriii, @mglaman and I, and which @mglaman wanted to see solved in #3503446: Define xb_path entity key for identifying entity path field. At minimum, this MR's work-around needs to point to #3503446: Define xb_path entity key for identifying entity path field. But the consequence is that this MR will have to do some cache context trickery.

But it'd be better still to just do that first, to avoid having to introduce another layer of work-arounds here. I'm fine with being pragmatic and landing this first.

wim leers’s picture

Note that "alias" was not in scope until #24 — @lauriii's original title didn't match the issue summary. 😞

tedbow’s picture

Assigned: Unassigned » wim leers
Status: Needs work » Needs review

@wim leers re #26

But the consequence is that this MR will have to do some cache context trickery.

I don't actually need to calls base_path() so hopefully this issue won't have extra cache problems. see https://git.drupalcode.org/project/experience_builder/-/merge_requests/7...

also I added a todo to #3503446: Define xb_path entity key for identifying entity path field to figure out the 'path' key dynamically

tedbow’s picture

Issue tags: +stable blocker

Seems like this needs to be fixed by stable

wim leers’s picture

Reviewing…

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Needs work
Related issues: +#3501847: Send entity keys to the editor from the mount controller

Great work on this one — this looks very close! 😄

I wanted to merge it, but I couldn't help but agreeding with @larowlan's feedback WRT #3501847: Send entity keys to the editor from the mount controller .🫣

Raised 2 additional code clarity concerns (nullability instead of empty string, and autoSaveTitleautoSaveLabel, which makes more sense once Lee's feedback is addressed).

tedbow’s picture

Assigned: Unassigned » tedbow

@wim leers @larowlan thanks for the reviews, will address

tedbow’s picture

Assigned: tedbow » wim leers
Status: Needs work » Needs review

setting to Needs Review. I think I have addressed the feedback but the pipeline is failing because of 403 errors in UI and Composer jobs. I think it is related to cloudflare issues https://www.cloudflarestatus.com/incidents/gshczn1wxh74

Will try to re-run the job in a bit

wim leers’s picture

Assigned: wim leers » tedbow
Status: Needs review » Reviewed & tested by the community

LGTM, but the UI eslint CI job has been consistently failing. Probably a trivial change is needed :)

wim leers’s picture

Status: Reviewed & tested by the community » Needs work
tedbow’s picture

Assigned: tedbow » Unassigned
Status: Needs work » Needs review
wim leers’s picture

Assigned: Unassigned » tedbow
Status: Needs review » Reviewed & tested by the community

RTBC, but won't be mergeable until the UI eslint CI job is fixed.

wim leers’s picture

Status: Reviewed & tested by the community » Needs work
tedbow’s picture

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

Looks like @wim leers just set this back to Needs Work for the ES Lint fail which @jessebaker fixed, thanks!

tedbow’s picture

Ok. all e2e tests passed beside media-library, reran and media-library just passed🎉

  • tedbow committed 50f5d277 on 0.x authored by anjali rathod
    Issue #3506854 by tedbow, anjali rathod, jessebaker, wim leers, lauriii...
tedbow’s picture

Status: Reviewed & tested by the community » Fixed

2 e2e tests but re-tested and those have now passed

nagwani’s picture

Issue tags: -sprint

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.