Add sequencing to new layers (pages & blocks)#1498
Conversation
|
@CodiumAI-Agent /describe |
|
@CodiumAI-Agent /review |
TitleAdd sequencing to new layers (pages & blocks) User descriptionDescriptionThis PR implements the feature, when user add new layers like pages they should count up numerically based on when they are added. Changes Made
How to Test
PR TypeEnhancement Description
Changes diagramflowchart LR
A["ADD_BLOCK action"] --> B["StateStore.generateBlock"]
B -- "widget == 'page'" --> C["Compute next page--N"]
B -- "widget != 'page'" --> D["Compute next widget--N"]
C --> E["Return page--N ID"]
D --> E["Return widget--N ID"]
Changes walkthrough 📝
|
|
@CodiumAI-Agent /improve |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
| private generateBlock = (json: BlockJSON, parent?: Block["parent"]) => { | ||
| // generate a new id | ||
| const id = `${json.widget}--${Math.floor(Math.random() * 10000)}`; | ||
| let id: string; |
There was a problem hiding this comment.
Overall i think we can split this logic out into its own private function.
With this we should probably be a bit more optimal, and not do a loop through blocks and rather do a check.
Will put this in the next commit
|
@CodiumAI-Agent /update_changelog |
|
Changelog updates: 🔄 2025-07-18 *Added
|

Description
This PR implements the feature, when user add new layers like pages they should count up numerically based on when they are added.
This PR also implements the feature, when user add new blocks they should count up numerically based on when they are added to the page.
Changes Made
How to Test