Skip to content

improvement(copilot): add subblock enums to block metadata#870

Merged
Sg312 merged 2 commits intostagingfrom
improvement/copilot-metadata-subblock-enums
Aug 5, 2025
Merged

improvement(copilot): add subblock enums to block metadata#870
Sg312 merged 2 commits intostagingfrom
improvement/copilot-metadata-subblock-enums

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Aug 5, 2025

Summary

Adds subblock enums to give the copilot more context for each block

Type of Change

  • Bug fix - bug fix/improvement

Testing

Manual testing

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Aug 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2025 1:54am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Aug 5, 2025 1:54am

@Sg312 Sg312 changed the title Add subblock enums to metadata improvement(copilot): add subblock enums to block metadata Aug 5, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR enhances the copilot's understanding of block configurations by adding comprehensive subblock metadata extraction. The change introduces a new processSubBlocks function that extracts detailed UI configuration properties from block subBlocks, including dropdowns, sliders, inputs, and other UI elements. A helper function resolveSubBlockOptions safely handles both static arrays and function-based options configurations.

The implementation adds extensive property mapping to capture UI element details like labels, descriptions, options, default values, and conditional visibility settings. Special hardcoded metadata is included for 'loop' and 'parallel' blocks since these core workflow control blocks aren't in the standard registry but are essential for the copilot to understand.

The main metadata extraction flow is enhanced to include additional block properties (longDescription, category, bgColor, hideFromToolbar) and integrates the new subblock processing. This provides the copilot AI assistant with complete visibility into block UI structure, enabling it to better assist users with workflow configuration by understanding all available block capabilities and their configuration options.

Confidence score: 4/5

  • This PR is safe to merge with minimal production risk as it primarily adds metadata extraction without changing core functionality
  • Score reflects comprehensive implementation with proper error handling, though the large amount of hardcoded metadata introduces some maintenance overhead
  • Pay close attention to the hardcoded SPECIAL_BLOCKS_METADATA section for accuracy and completeness

1 file reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

…data.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – docs August 5, 2025 01:50 Inactive
@Sg312 Sg312 merged commit 48b32a3 into staging Aug 5, 2025
5 checks passed
waleedlatif1 pushed a commit that referenced this pull request Aug 5, 2025
* Add subblock enums to metadata

* Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
waleedlatif1 added a commit that referenced this pull request Aug 5, 2025
…ing and styling (#872)

* fix(copilot-ui): added user scrolling, fixed code block, fixed code copying and styling

* use console logger instead of console

* fix(copilot): make chat history non-interfering (#869)

* Add basic personalizatoin

* Make chat history non-interfering

* Always personalize

* improvement(copilot): add subblock enums to block metadata (#870)

* Add subblock enums to metadata

* Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix(copilot): fix state message sent on move to background (#871)

* Initial fix

* Add execution start time to message

* Lint

* autofocus on new tab open

---------

Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
waleedlatif1 pushed a commit that referenced this pull request Aug 5, 2025
* Add subblock enums to metadata

* Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
waleedlatif1 added a commit that referenced this pull request Aug 5, 2025
…ing and styling (#872)

* fix(copilot-ui): added user scrolling, fixed code block, fixed code copying and styling

* use console logger instead of console

* fix(copilot): make chat history non-interfering (#869)

* Add basic personalizatoin

* Make chat history non-interfering

* Always personalize

* improvement(copilot): add subblock enums to block metadata (#870)

* Add subblock enums to metadata

* Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix(copilot): fix state message sent on move to background (#871)

* Initial fix

* Add execution start time to message

* Lint

* autofocus on new tab open

---------

Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@waleedlatif1 waleedlatif1 deleted the improvement/copilot-metadata-subblock-enums branch August 6, 2025 00:22
waleedlatif1 pushed a commit that referenced this pull request Aug 6, 2025
* Add subblock enums to metadata

* Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
waleedlatif1 added a commit that referenced this pull request Aug 6, 2025
…ing and styling (#872)

* fix(copilot-ui): added user scrolling, fixed code block, fixed code copying and styling

* use console logger instead of console

* fix(copilot): make chat history non-interfering (#869)

* Add basic personalizatoin

* Make chat history non-interfering

* Always personalize

* improvement(copilot): add subblock enums to block metadata (#870)

* Add subblock enums to metadata

* Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix(copilot): fix state message sent on move to background (#871)

* Initial fix

* Add execution start time to message

* Lint

* autofocus on new tab open

---------

Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
…ai#870)

* Add subblock enums to metadata

* Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
…ing and styling (simstudioai#872)

* fix(copilot-ui): added user scrolling, fixed code block, fixed code copying and styling

* use console logger instead of console

* fix(copilot): make chat history non-interfering (simstudioai#869)

* Add basic personalizatoin

* Make chat history non-interfering

* Always personalize

* improvement(copilot): add subblock enums to block metadata (simstudioai#870)

* Add subblock enums to metadata

* Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix(copilot): fix state message sent on move to background (simstudioai#871)

* Initial fix

* Add execution start time to message

* Lint

* autofocus on new tab open

---------

Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.

1 participant