Skip to content

Fix add Page interaction in Blocks App#895

Merged
johbaxter merged 6 commits intodevfrom
fix-add-page
Apr 15, 2025
Merged

Fix add Page interaction in Blocks App#895
johbaxter merged 6 commits intodevfrom
fix-add-page

Conversation

@johbaxter
Copy link
Copy Markdown
Contributor

Description

Changes Made

How to Test

  1. Steps to reproduce/test the behavior
  2. Expected outcomes

Notes

@johbaxter johbaxter requested a review from a team as a code owner April 15, 2025 17:26
@github-actions
Copy link
Copy Markdown

@CodiumAI-Agent /describe

@QodoAI-Agent
Copy link
Copy Markdown

Title

Fix add Page interaction in Blocks App


User description

Description

Changes Made

How to Test

  1. Steps to reproduce/test the behavior
  2. Expected outcomes

Notes


PR Type

  • Enhancement

Description

  • Added "Route" input in page block config.

  • Defaulted page block route to block id.

  • Made add page handler asynchronous with selection.


Changes walkthrough 📝

Relevant files
Enhancement
config.tsx
Add route input setting in page block config.                       

libs/renderer/src/components/block-defaults/page-block/config.tsx

  • Imported InputSettings for route input.
  • Added "Route" field in content menu.
  • +7/-0     
    state.store.ts
    Default page route set to block id.                                           

    libs/renderer/src/store/state/state.store.ts

  • Set block route to id for page widget.
  • Return block id when no position provided.
  • +6/-0     
    LayersPanel.tsx
    Async add page handling with selection.                                   

    packages/client/src/components/blocks-workspace/panels/LayersPanel.tsx

  • Converted add page handler to async.
  • Managed page selection with new block id.
  • +10/-2   

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /review

    @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /improve

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Syntax Error

    An extra comma in the Route configuration object may cause a syntax error during runtime. Please verify the intended structure.

    {
        description: 'Route',
        render: ({ id }) => (
            <InputSettings id={id} label="Route" path="route" />
        ),
    },,

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Remove redundant comma

    Remove the extra comma after the route configuration object to fix the syntax error.

    libs/renderer/src/components/block-defaults/page-block/config.tsx [49-54]

     {
         description: 'Route',
         render: ({ id }) => (
             <InputSettings id={id} label="Route" path="route" />
         ),
    -},,
    +},
    Suggestion importance[1-10]: 9

    __

    Why: The suggestion correctly identifies and fixes a syntax error caused by an extra comma in the route configuration, which is critical for correct rendering.

    High

    @johbaxter johbaxter merged commit 14c19dd into dev Apr 15, 2025
    3 checks passed
    @johbaxter johbaxter deleted the fix-add-page branch April 15, 2025 17:53
    @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /update_changelog

    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.

    3 participants