Skip to content

fix: implicitly allow dropping in a component that has a default slot + other slot fixes#199

Merged
ruchamahabal merged 5 commits into
frappe:developfrom
ruchamahabal:fix-drop
Jul 21, 2026
Merged

fix: implicitly allow dropping in a component that has a default slot + other slot fixes#199
ruchamahabal merged 5 commits into
frappe:developfrom
ruchamahabal:fix-drop

Conversation

@ruchamahabal

@ruchamahabal ruchamahabal commented Jul 21, 2026

Copy link
Copy Markdown
Member

The old canHaveChildren() check only allowed you to drop a component inside another one if:

  1. It's a root/container block
  2. It had some slot enabled (even default)

But in actual Vue components, wrapping a component around the other actually renders correctly if it just has a default slot. No explicit slot passing is required in this case.
This PR fixes that behaviour. You can now drop any component in another component if it has a default slot. For any other slot, you have to enable that slot from the Properties panel. This makes composition easier.

drop.mp4

Also fixes:

  • Stale slot options dropdown in properties panel even when you edit the Vue file in code. (needed a reload before this)

  • This PR also caches slots per component so that lookup becomes easier

  • Duplicate default slots shown in selector (all unnamed slots were considered as default branching from v-if regex)

    Before After
    duplicate-slot dedupe-slots

- else the canHaveChildren check won't work until the custom component block is selected
@ruchamahabal
ruchamahabal marked this pull request as ready for review July 21, 2026 08:19
@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge; the change correctly pre-warms slot caches and the only concern is duplicate network requests under concurrent construction of the same custom-component block.

The logic is sound: startup pre-warming via registerCustomComponentPaths covers the common path, and the Block constructor's void getComponentSlots(…) is a belt-and-suspenders guard. Duplicate fetches are a minor efficiency concern, not a correctness one.

frontend/src/utils/components.ts — getComponentSlots in-flight deduplication.

Reviews (2): Last reviewed commit: "fix: register custom component slots & t..." | Re-trigger Greptile

Comment thread frontend/src/utils/components.ts
@ruchamahabal ruchamahabal changed the title fix: allow dropping in a component that has a default slot fix: implicitly allow dropping in a component that has a default slot + other slot fixes Jul 21, 2026
@ruchamahabal
ruchamahabal merged commit 468d624 into frappe:develop Jul 21, 2026
2 checks passed
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.

1 participant