Skip to content

Commit

Permalink
Quick Inserter: Restore pattern search and insertion (#69028)
Browse files Browse the repository at this point in the history
Unlinked contributors: xpurichan.

Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: yogeshbhutkar <[email protected]>
Co-authored-by: fabiankaegy <[email protected]>
  • Loading branch information
5 people authored Feb 6, 2025
1 parent 9b90569 commit 96b12e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { store as blockEditorStore } from '../../store';

const SEARCH_THRESHOLD = 6;
const SHOWN_BLOCK_TYPES = 6;
const SHOWN_BLOCK_PATTERNS = 2;

export default function QuickInserter( {
onSelect,
Expand Down Expand Up @@ -106,7 +107,9 @@ export default function QuickInserter( {
rootClientId={ rootClientId }
clientId={ clientId }
isAppender={ isAppender }
maxBlockPatterns={ 0 }
maxBlockPatterns={
!! filterValue ? SHOWN_BLOCK_PATTERNS : 0
}
maxBlockTypes={ SHOWN_BLOCK_TYPES }
isDraggable={ false }
selectBlockOnInsert={ selectBlockOnInsert }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ function InserterSearchResults( {
] = useBlockTypesState( destinationRootClientId, onInsertBlocks, isQuick );
const [ patterns, , onClickPattern ] = usePatternsState(
onInsertBlocks,
destinationRootClientId
destinationRootClientId,
undefined,
isQuick
);

const filteredBlockPatterns = useMemo( () => {
Expand Down

1 comment on commit 96b12e5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 96b12e5.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13180695255
📝 Reported issues:

Please sign in to comment.