You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8899bb5
Browse filesBrowse the repository at this point in the historyBrowse files
Normalize the Navigation block appender behavior between canvas and list view contexts (#71163)
* refactor: eliminate prop drilling for directInsert in PrivateListView
- Add directInsert to ListViewContext to eliminate prop drilling
- Update ListViewBranch to use context instead of props
- Update Appender to use context instead of props
- Maintain directInsert prop at PrivateListView level to set context value
- Cleaner component interfaces and centralized configuration
* Use block list settings api
* Use original const def
* Access setting directly in appender
* Revert branch component to match trunk
* Revert another file to trunk
* Pass entire block to callback
* Revert changes to menu controls
* Properly handle cleanup if no link selected
* Allow for setting blocks inserterd by Add block Quick Inserter
* fix: clean up original nav link block when selecting different block in list view
When using the 'Add block' feature in the Navigation block's list view context,
the original auto-inserted navigation link block was not being cleaned up when
a different block was selected via the QuickInserter. This caused duplicate
blocks to remain in the list view.
The fix adds a wrapper function handleSetInsertedBlock that removes the
original inserted block before setting the new selected block, ensuring
only the newly selected block remains in the list view.
This aligns the list view behavior with the canvas context behavior.
* fix: prevent focus stealing when selecting blocks in Navigation list view
When selecting a different block from the QuickInserter in the Navigation block's
list view context, the original auto-inserted block was being removed with
automatic block selection enabled. This caused focus stealing that closed the
list view and switched to the canvas.
The fix adds preventBlockSelection = false to removeBlock() calls to prevent
automatic block selection, keeping the list view open and maintaining proper
focus behavior.
* refactor: rename setInsertedBlock prop to onBlockInsert for better clarity
Rename the setInsertedBlock prop to onBlockInsert across the Navigation block
components to make the prop name more generic and descriptive of its purpose
as a callback function that's called when a block is inserted.
This improves code readability and makes the prop name more reusable across
different contexts while maintaining all existing functionality.
* fix: add iframe-aware cleanup for LinkUI in Navigation block List View
- Add useEditorCanvasCleanup hook to handle iframe interaction cleanup
- Fixes issue where auto-inserted Navigation Link blocks weren't cleaned up when clicking on canvas blocks in List View context
- Uses standardized iframe selector approach consistent with rest of codebase
- Hook automatically manages event listener lifecycle based on LinkUI visibility
* fix: add iframe-aware cleanup for LinkUI in Navigation block List View
- Add useEditorCanvasCleanup hook to handle iframe interaction cleanup
- Fixes issue where auto-inserted Navigation Link blocks weren't cleaned up when clicking on canvas blocks in List View context
- Uses standardized iframe selector approach consistent with rest of codebase
- Hook automatically manages event listener lifecycle based on LinkUI visibility
* Fix test to expect directly inserted page link
* Fix another test to expect direct inserted Page block
* tweak comments
* Remove hacky fix to onClose failure
* Revert alteration to hook
* Optimise useSelect calls
* Simplify cleanup function to avoid passing functions around
* Fix mess up from rebase
0 commit comments