Skip to content

feat(renderer): runpixeltwo to runpixel#1503

Merged
neelneelneel merged 2 commits intodevfrom
1457_remove_runpixeltwo
Jul 14, 2025
Merged

feat(renderer): runpixeltwo to runpixel#1503
neelneelneel merged 2 commits intodevfrom
1457_remove_runpixeltwo

Conversation

@KirthikaKumar-K
Copy link
Copy Markdown
Contributor

Description

Remove runPixelTwo and pull from @semoss/sdk

Changes Made

Removed runPixelTwo and replaced it with runPixel that is pulled from @semoss/sdk

@KirthikaKumar-K KirthikaKumar-K requested a review from a team as a code owner July 14, 2025 15:15
@KirthikaKumar-K KirthikaKumar-K linked an issue Jul 14, 2025 that may be closed by this pull request
1 task
@github-actions
Copy link
Copy Markdown

@CodiumAI-Agent /describe

@QodoAI-Agent
Copy link
Copy Markdown

Title

feat(renderer): runpixeltwo to runpixel


User description

Description

Remove runPixelTwo and pull from @semoss/sdk

Changes Made

Removed runPixelTwo and replaced it with runPixel that is pulled from @semoss/sdk


PR Type

Enhancement


Description

  • Replace runPixelTwo with runPixel from SDK

  • Remove deprecated runPixelTwo.ts file

  • Update affected components and pages

  • Adjust ConfigStore to use new SDK call


Changes walkthrough 📝

Relevant files
Dependencies
8 files
BlocksWorkspace.tsx
Swap runPixelTwo import and calls                                               
+2/-2     
BlocksMenuPanel.tsx
Update block menu pixel calls to runPixel                               
+18/-18 
FileEditor.tsx
Use SDK runPixel for file operations                                         
+4/-4     
SharePage.tsx
Replace context setup with runPixel                                           
+2/-2     
JobBuilderModal.tsx
Migrate job builder pixel calls                                                   
+3/-3     
JobsPage.tsx
Update job pause/resume with runPixel                                       
+3/-3     
JobsTable.tsx
Switch execute job call to runPixel                                           
+2/-2     
config.store.ts
Refactor ConfigStore to use runPixel                                         
+4/-7     
Miscellaneous
1 files
runPixelTwo.ts
Remove deprecated runPixelTwo implementation                         
+0/-70   

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
    🔒 Security concerns

    Operation Injection:
    Pixel commands interpolate untrusted values (e.g., builder.name, workspace.appId, blockId) directly into the query strings. Ensure these inputs are sanitized or validated to prevent injection attacks.

    ⚡ Recommended focus areas for review

    Argument order mismatch

    In the custom runPixel wrapper, the parameters are swapped (insightId passed as pixel and pixel string as insight ID), which will break the SDK call. Verify and correct the argument order when invoking the imported runPixel.

    async runPixel<O extends unknown[] | []>(pixel: string) {
        return await runPixel<O>(
            this._store.insightID ? this._store.insightID : 'new',
            pixel,
        );
    }
    Unhandled promise rejections

    The runPixel invocation uses .then(...) without a matching .catch(...), so errors could be swallowed. Add error handling to surface failures and stop the loading screen appropriately.

    // load the app
    runPixel<[SerializedState]>(
        `GetAppBlocksJson ( project=["${workspace.appId}"]);`,
        workspace.insightId ? workspace.insightId : 'new',
    )
        .then(async ({ pixelReturn, errors, insightId }) => {
    Missing await

    In getClientBlocks, runPixel('GetClientBlocks()').then(...) isn’t awaited before clearing loading state, which can hide the loader prematurely. Consider using await or moving setLoading(false) into a finally block.

    const getClientBlocks = async () => {
        setLoading(true);
        runPixel('GetClientBlocks()').then((res) => {
            const { pixelReturn, errors } = res;
            if (errors.length) {

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Swap runPixel arguments

    Swap the argument order when calling runPixel to pass the pixel expression first and
    the insight ID second, matching the SDK signature.

    packages/client/src/stores/config/config.store.ts [756-759]

     return await runPixel<O>(
    -    this._store.insightID ? this._store.insightID : 'new',
         pixel,
    +    this._store.insightID || 'new',
     );
    Suggestion importance[1-10]: 10

    __

    Why: The call currently passes the insight ID before the pixel expression, which breaks the SDK call; swapping to (pixel, insightId) restores correct functionality.

    High
    General
    Handle runPixel errors

    Add error handling inside the .then callback to surface any runPixel errors via
    notification and stop further processing if errors occur.

    packages/client/src/components/blocks-workspace/BlocksWorkspace.tsx [231]

     .then(async ({ pixelReturn, errors, insightId }) => {
    +    if (errors.length) {
    +        notification.add({ color: 'error', message: errors.join(', ') });
    +        workspace.setLoading(false);
    +        return;
    +    }
    Suggestion importance[1-10]: 7

    __

    Why: Adding early error handling ensures runPixel failures are surfaced via notification and prevents further processing when errors occur.

    Medium
    Check errors before using response

    Throw an error or notify if response.errors is non-empty before using
    response.pixelReturn to avoid silent failures.

    packages/client/src/components/common/File/FileEditor.tsx [195]

     const response = await runPixel<[string]>(pixel, insightId);
    +if (response.errors.length) {
    +    throw new Error(response.errors.join(', '));
    +}
    Suggestion importance[1-10]: 7

    __

    Why: Verifying response.errors before accessing pixelReturn prevents silent failures and ensures errors are not ignored.

    Medium
    Reset loading on completion

    Ensure the loading indicator is cleared by adding a .finally() handler to reset
    setLoading(false) after the runPixel promise settles.

    packages/client/src/components/blocks-workspace/panels/BlocksMenuPanel.tsx [135]

    -runPixel('GetClientBlocks()').then((res) => {
    +runPixel('GetClientBlocks()')
    +    .then((res) => {
    +        // existing handling...
    +    })
    +    .finally(() => setLoading(false));
    Suggestion importance[1-10]: 5

    __

    Why: Adding a .finally() to always clear the loading state improves UX by avoiding UI hang-ups when the promise settles.

    Low

    @neelneelneel neelneelneel merged commit 46d1e4f into dev Jul 14, 2025
    3 checks passed
    @neelneelneel neelneelneel deleted the 1457_remove_runpixeltwo branch July 14, 2025 22:57
    @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.

    Remove runPixelTwo and pull from @semoss/sdk

    3 participants