-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(notes): add notes #1898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(notes): add notes #1898
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR adds a notes block feature that allows users to add contextual annotations directly to the workflow canvas. Notes support both plain text and Markdown rendering and are treated as annotation-only blocks that don't participate in workflow execution. Key Changes:
Architecture: Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Workflow as Workflow Canvas
participant NoteBlock as NoteBlock Component
participant Core as useBlockCore Hook
participant Dims as useBlockDimensions Hook
participant Store as Workflow Store
participant AutoLayout as AutoLayout System
participant Edge as Edge Manager
User->>Workflow: Add note block to canvas
Workflow->>Store: Create note block
Store->>Store: Check isAnnotationOnlyBlock(type)
Note over Store: Block type: 'note'
Workflow->>NoteBlock: Render NoteBlock component
NoteBlock->>Core: useBlockCore({blockId, data})
Core->>Store: Get block state (enabled, active, focus)
Store-->>Core: Return block state
Core-->>NoteBlock: Return state + ring styles
NoteBlock->>Dims: useBlockDimensions({blockId, calculateDimensions})
Dims->>Dims: Calculate height based on content
Note over Dims: Fixed width: 250px<br/>Dynamic height based on isEmpty
Dims->>Store: updateBlockLayoutMetrics(blockId, dimensions)
Store-->>Dims: Dimensions updated
Dims->>Workflow: updateNodeInternals(blockId)
NoteBlock->>NoteBlock: Render markdown or plain text
NoteBlock-->>Workflow: Display note block
User->>Workflow: Trigger autolayout
Workflow->>AutoLayout: applyAutoLayout(blocks, edges)
AutoLayout->>AutoLayout: filterLayoutEligibleBlockIds(blockIds)
AutoLayout->>AutoLayout: shouldSkipAutoLayout(block)
Note over AutoLayout: Note blocks excluded from layout
AutoLayout->>AutoLayout: Layout only non-note blocks
AutoLayout-->>Workflow: Return positioned blocks
User->>Workflow: Attempt to connect edge to note
Workflow->>Edge: addEdge(edge)
Edge->>Store: Check source and target blocks
Edge->>Edge: isAnnotationOnlyBlock(sourceType)?
Edge->>Edge: isAnnotationOnlyBlock(targetType)?
Note over Edge: Connection blocked if note block
Edge-->>Workflow: Edge creation prevented
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx, line 3-4 (link)syntax: unused imports added to wrong file
13 files reviewed, 1 comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
18 files reviewed, no comments
* Notes v1 * v2 * Lint * Consolidate into hook * Simplify workflow code * Fix hitl casing * Don't allow edges in note block and explicitly exclude from executor * Add hooks * Consolidate hook * Consolidate utils checks * Consolidate dimensions
* Notes v1 * v2 * Lint * Consolidate into hook * Simplify workflow code * Fix hitl casing * Don't allow edges in note block and explicitly exclude from executor * Add hooks * Consolidate hook * Consolidate utils checks * Consolidate dimensions
Summary
Adds notes block as core block.
Supports plain text or markdown (new markdown format, could possibly reuse existing)
No ports, etc
Does not get affected by autolayout
Type of Change
Testing
Manual testing
Checklist