Skip to content

Conversation

@GiantDragon9090
Copy link
Contributor

Description

This PR fixes issue #21232 where newly created block list items were not automatically expanded in inline editing mode, requiring users to manually click to expand them.

Changes

  • Added logic to automatically expand blocks when they are first loaded and not yet exposed (indicating they are newly created)
  • Added a flag (#hasAutoExpanded) to ensure this only happens once per block to prevent re-expanding if the user manually collapses the block

Testing

  1. Create a block list with inline editing mode enabled
  2. Add a new block to the list
  3. Verify that the block is automatically expanded and ready for editing
  4. Collapse the block and verify it stays collapsed (does not auto-expand again)

Related Issue

Fixes #21232

Fixes umbraco#21232

When inline editing mode is enabled, newly created block list items
should be automatically expanded to provide immediate editing access,
matching the behavior from Umbraco 13.

This change adds logic to automatically expand blocks when they are
first loaded and not yet exposed (indicating they are newly created).
A flag ensures this only happens once per block to prevent re-expanding
if the user manually collapses the block.
@github-actions
Copy link

Hi there @GiantDragon9090, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

Gittensor Miner added 5 commits January 26, 2026 16:19
Refines the auto-expand logic to ensure it only triggers for newly created blocks that are not yet exposed.
…hods

Extracts complex logic from constructor into separate private methods to reduce:
- Cyclomatic complexity (from 11 to below threshold of 9)
- Complex conditionals
- Nested conditional logic blocks

This improves code health and maintainability while preserving functionality.
Extracts the complex conditional in #observeExposed() into a separate
#shouldAutoExpand() method using early returns to reduce complexity.
This resolves the code quality issue with complex conditionals exceeding
the threshold of 2 branches.
- Handle exposed being boolean | undefined by checking for undefined before calling #shouldAutoExpand
- Import UmbVariantId type and use it in #updateVariantName method to properly handle culture as string | null
@leekelleher
Copy link
Member

@GiantDragon9090 Thank you for your pull request. I believe issue #21232 may already been resolved by pull request #20836.
(We're still in the process of reviewing PR #20836, once reviewed we will update the status on here too.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline edit : Adding a new blocklist item does not expand it anymore

2 participants