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
Automate variable creation for new queries and cells
Auto-add variables for input blocks on addition
Standardize "Notebook Id" error messages
Ensure variables created after duplicating blocks
Changes walkthrough 📝
Relevant files
Enhancement
state.store.ts
Automate variable creation for queries and cells
libs/renderer/src/store/state/state.store.ts
Dispatch ADD_VARIABLE after creating new query
Iterate query cells, dispatch ADD_VARIABLE per cell
The ADD_VARIABLE dispatch for cell variables omits explicit isInput or isOutput flags, which may lead to default behavior and inconsistent variable states.
// Automate variable creation for notebook and new cellthis.dispatch({message: ActionMessages.ADD_VARIABLE,payload: {id: queryId,type: "query",to: queryId,isOutput: true}})
The logic for dispatching ADD_VARIABLE for input blocks is duplicated across components; consider extracting into a shared helper to ensure consistency and maintainability.
// TODO: REFACTOR// Add variables for all blocks that are inputs from userif(INPUT_BLOCK_TYPES.indexOf(item.json.widget)>-1){state.dispatch({message: ActionMessages.ADD_VARIABLE,payload: {id: id,type: 'block',to: id,isInput: true,},});}
The ADD_VARIABLE dispatch occurs immediately after NEW_CELL without verifying the new cell creation succeeded; if the NEW_CELL dispatch fails or returns an unexpected id, the variable creation may fail or be orphaned.
Why: Adding await before state.dispatch ensures the variable is created before calling notebook.selectCell, reducing the risk of race conditions when updating the UI.
Low
General
Destructure entries and catch dispatch errors
Destructure the entries array for clearer intent and safer indexing, and wrap the dispatch call in try/catch to prevent errors from interrupting store initialization.
Why: Destructuring [cId, cell] improves readability over indexing into c, and adding a try/catch around this.dispatch helps prevent a single failed variable creation from breaking the entire store initialization.
Low
Use includes instead of indexOf
Replace the indexOf check with includes for readability and intention clarity.
Why: Switching from INPUT_BLOCK_TYPES.indexOf(...) > -1 to INPUT_BLOCK_TYPES.includes(...) is a straightforward readability improvement with no behavioral change.
Automate variable creation for notebooks, cells, and input blocks
Changed
Streamline variable creation logic in the renderer
Fixed
Handle missing query or cell cases in input settings
to commit the new content to the CHANGELOG.md file, please type:
'/update_changelog --pr_update_changelog.push_changelog_changes=true'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…block
Description
Changes Made
How to Test
Notes