Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Jan 16, 2026

Summary

  • added deepwiki to readme, consolidated utils
  • streamlined dialog sizing, copy, and styling

Type of Change

  • Code Hygiene
  • Documentation

Testing

N/A

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 Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 16, 2026 11:40pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 16, 2026

Greptile Summary

This PR consolidates workflow utility functions and standardizes modal UI patterns across the application.

Key Changes:

  • Utility Consolidation: Created start-block-types.ts to centralize start block type definitions (VALID_START_BLOCK_TYPES, isValidStartBlockType) and prevent circular imports. All hardcoded block type checks across 8+ files now use this centralized utility.
  • Modal Standardization: Unified modal styling and copy patterns - standardized cancel button variants from active to default, destructive action buttons use destructive variant, and error text size consistently set to 12px
  • Enhanced UX: Added confirmation modal for "Leave Workspace" action in workspace-header.tsx to prevent accidental departures
  • UI Improvements: Replaced basic input elements with proper Input components in custom tool modal, added submit buttons with ArrowUp icons for schema/code generation
  • Documentation: Added DeepWiki badge to README

The refactoring improves code maintainability by eliminating duplicate logic and provides a single source of truth for start block type validation.

Confidence Score: 5/5

  • This PR is safe to merge with no blocking issues
  • The changes are well-structured code hygiene improvements with proper consolidation patterns. The new utility module correctly exports all necessary functions and types, all import paths have been updated consistently, and the modal standardization follows established UI patterns. No functional logic changes that could introduce bugs.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/lib/workflows/triggers/start-block-types.ts New utility module to centralize start block type definitions and prevent circular imports
apps/sim/lib/workflows/triggers/trigger-utils.ts Moved start block type definitions to dedicated module, imports from start-block-types.ts
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsx Added confirmation modal for leave workspace action, improving UX and preventing accidental departures
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx Standardized modal button variants (active to default) and improved text formatting consistency
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx Enhanced schema/code generation UI with proper Input components and submit buttons, standardized text sizes

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as UI Components
    participant Utils as start-block-types.ts
    participant TriggerUtils as trigger-utils.ts
    participant API as API Routes
    
    Note over Utils: New centralized module<br/>exports VALID_START_BLOCK_TYPES,<br/>ValidStartBlockType, isValidStartBlockType()
    
    User->>UI: Interacts with workflow
    UI->>Utils: isValidStartBlockType(blockType)
    Utils-->>UI: boolean (type guard)
    
    User->>UI: Opens modal (delete/leave/edit)
    Note over UI: Standardized modal patterns:<br/>- variant='default' for cancel<br/>- variant='destructive' for dangerous actions<br/>- Consistent text sizing (12px)
    UI-->>User: Shows confirmation modal
    
    User->>API: Submits form/workflow
    API->>Utils: isValidStartBlockType(block.type)
    Utils-->>API: Validates start block
    API->>TriggerUtils: getTrigger() / generateMockPayload()
    TriggerUtils->>Utils: isValidStartBlockType()
    Utils-->>TriggerUtils: Validation result
    TriggerUtils-->>API: Mock payload
    API-->>User: Response
    
    Note over UI,API: All hardcoded checks replaced<br/>with centralized utility:<br/>- input-format.ts<br/>- workflow-tool-schema.ts<br/>- get-block-upstream-references.ts<br/>- use-accessible-reference-prefixes.ts
Loading

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1 waleedlatif1 merged commit 3768c63 into staging Jan 17, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/readme branch January 17, 2026 00:07
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.

2 participants