Skip to content

Native Inserter: Improve ordering of blocks and more#206

Merged
kean merged 12 commits intotask/blocks-with-predefined-parametersfrom
task/improve-block-ordering-and-support-for-other-stuff
Oct 29, 2025
Merged

Native Inserter: Improve ordering of blocks and more#206
kean merged 12 commits intotask/blocks-with-predefined-parametersfrom
task/improve-block-ordering-and-support-for-other-stuff

Conversation

@kean
Copy link
Contributor

@kean kean commented Oct 29, 2025

What?

Closes CMM-875: Establish the mobile-specific order for blocks.

How?

  • Refactor the inserter by moving grouping, ordering, contextual blocks, and more from Swift to JS
  • Add support for disabled blocks (isDisabled)
  • Add "Show More" for sections with more than 16 blocks
  • Remove hardcoded core/missing block support (no longer needed since Native Inserter: Implement block insertion #199)
  • Add MOST_USED_BLOCKS section (gbk-most-used)

Screenshots or screencast

Note: screenshots are pre #205

Screenshot 2025-10-29 at 12 42 48 PM Screenshot 2025-10-29 at 12 43 36 PM licable -->

@kean kean requested review from dcalhoun and jkmassel October 29, 2025 16:44
* Optimized for mobile usage patterns where users frequently create content
* with text, media from device cameras, and visual formatting.
*/
const MOST_USED_BLOCKS = [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feedback on MOST_USED_BLOCKS and BLOCK_ORDER_BY_CATEGORY is welcome.
I expect to refine it further in the scope of CMM-915: Add first-class support for Jetpack blocks.

Copy link
Member

Choose a reason for hiding this comment

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

For context, I'll link the ordering for the current editor on web and native. There have also be internal analysis of block usage: P9ugOq-1uL-p2

I think the ordering you propose makes sense. I do not have specific suggestions at this time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the links!

devOnly( code ), – this could be interesting. I added CMM-917: Show core/code block only for developers.

Copy link
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

Tested well for me. Feels really good.

* Optimized for mobile usage patterns where users frequently create content
* with text, media from device cameras, and visual formatting.
*/
const MOST_USED_BLOCKS = [
Copy link
Member

Choose a reason for hiding this comment

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

For context, I'll link the ordering for the current editor on web and native. There have also be internal analysis of block usage: P9ugOq-1uL-p2

I think the ordering you propose makes sense. I do not have specific suggestions at this time.

Comment on lines 34 to 38
Text(name)
.font(.headline)
.foregroundStyle(Color.secondary)
.padding(.leading, padding)
.frame(maxWidth: .infinity, alignment: .leading)
Copy link
Member

Choose a reason for hiding this comment

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

WDYT about making the semantics of this element a heading? It could be convenient when navigating via VoiceOver.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to keep track of accessibly issues in CMM-916: Improve accessibility and address them at the end. Thanks!

@kean kean merged commit 4b459a7 into task/blocks-with-predefined-parameters Oct 29, 2025
8 checks passed
@kean kean deleted the task/improve-block-ordering-and-support-for-other-stuff branch October 29, 2025 19:20
kean added a commit that referenced this pull request Oct 29, 2025
* Add support for block variants

* Rename BlockType

* Capitlize ID

* Update src/components/native-block-inserter-button/index.jsx

Co-authored-by: David Calhoun <github@davidcalhoun.me>

* Native Inserter: Improve ordering of blocks and more (#206)

* Add a note about serializeBlocksForNative

* Remove now redundant core/missing check

* Move ordering to the JS land

* Further refactoring

* Pass displayName for Text

* Localize categories

* Extend most used blocks

* Add gbk-most-used as a separate section

* Add support for disabling blocks

* Collapse long sections

* Update the order of embeds

* Fix linter errors

---------

Co-authored-by: David Calhoun <github@davidcalhoun.me>
kean added a commit that referenced this pull request Oct 29, 2025
* Implement block insertion

* Load bridge only if enabled

* Refactor the component that handles insertion

* Fix inserter not working when selected from tilte

* Fix an issue with editor not restoring focus when block inserter is dismissed

* Fix order of inserts

* Native Inserter: Add support for block variants (#204)

* Add support for block variants

* Rename BlockType

* Capitlize ID

* Update src/components/native-block-inserter-button/index.jsx

Co-authored-by: David Calhoun <github@davidcalhoun.me>

* Native Inserter: Improve ordering of blocks and more (#206)

* Add a note about serializeBlocksForNative

* Remove now redundant core/missing check

* Move ordering to the JS land

* Further refactoring

* Pass displayName for Text

* Localize categories

* Extend most used blocks

* Add gbk-most-used as a separate section

* Add support for disabling blocks

* Collapse long sections

* Update the order of embeds

* Fix linter errors

---------

Co-authored-by: David Calhoun <github@davidcalhoun.me>

---------

Co-authored-by: David Calhoun <github@davidcalhoun.me>
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.

2 participants