Skip to content

Webhook payload dialog#722

Merged
elie222 merged 7 commits intomainfrom
cursor/implement-new-feature-4606
Aug 28, 2025
Merged

Webhook payload dialog#722
elie222 merged 7 commits intomainfrom
cursor/implement-new-feature-4606

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Aug 27, 2025

Add comprehensive webhook documentation and integrate it into the UI to improve the developer experience.

This PR addresses the need for better webhook documentation and user experience, providing developers with easy access to payload schemas, examples, and best practices directly within the application, thereby eliminating guesswork during configuration.


Open in Cursor Open in Web

Summary by CodeRabbit

  • New Features

    • Added in-app Webhook payload documentation with copyable examples and a “View payload structure” link.
    • Added tooltip explaining the “Send to Webhook” action.
    • Added placeholder for Webhook URL input.
  • UI/Style

    • Improved spacing in Rules tab.
    • Aligned Webhook secret controls for better layout.
  • Documentation

    • Clarified settings text to guide configuring per-rule Webhook URLs in Assistant → Rules.
  • Chores

    • Bumped version to v2.6.13.

Co-authored-by: eliesteinbock <eliesteinbock@gmail.com>
@cursor
Copy link

cursor bot commented Aug 27, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Aug 27, 2025

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

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Aug 28, 2025 7:20am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

Introduces webhook-specific UI enhancements: tooltip for CALL_WEBHOOK action, input placeholder and a “View payload structure” link in RuleForm, a new WebhookDocumentation component with dialog and copyable payload examples, minor spacing and settings text tweaks, action field type updated to support placeholders, and version bump to v2.6.13.

Changes

Cohort / File(s) Summary
Assistant UI: CALL_WEBHOOK tooltip & Rule form enhancements
apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx, apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx, apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
Adds tooltip text for CALL_WEBHOOK; RuleForm inputs use per-field placeholders and render WebhookDocumentationLink under the URL field for CALL_WEBHOOK; applies mt-8 top margin to Rules tab wrapper.
Webhook documentation components (new)
apps/web/components/WebhookDocumentation.tsx
Adds WebhookDocumentationDialog, WebhookPayloadDocumentation, and WebhookDocumentationLink with example payload, copy-to-clipboard, and descriptive sections.
Settings copy/layout
apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
Updates description to reference per-rule URLs; wraps RegenerateSecretButton in a flex container for alignment.
Action input metadata
apps/web/utils/action-item.ts
Extends field descriptor with optional placeholder; sets placeholder: "https://example.com/webhook" for CALL_WEBHOOK URL.
Version
version.txt
Bumps version from v2.6.12 to v2.6.13.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant RulesTab as Rules Tab
  participant RuleForm as RuleForm
  participant DocLink as WebhookDocumentationLink
  participant Dialog as WebhookDocumentationDialog

  User->>RulesTab: Open Rules
  RulesTab->>RuleForm: Render action fields
  Note over RuleForm: CALL_WEBHOOK URL shows placeholder and tooltip enabled
  User->>DocLink: Click "View payload structure"
  DocLink->>Dialog: Open dialog
  Dialog-->>User: Display example payload + copy action
  User->>Dialog: Copy payload JSON
  Dialog-->>User: Copied state (check icon)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • edulelis

Poem

A rabbit taps the webhook door,
With placeholders and docs galore.
A dialog pops—“Copy this, please!”—
Tooltips whisk by on gentle breeze.
Rules hop neat with mt-8 flair,
v2.6.13’s in the air. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/implement-new-feature-4606

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@CLAassistant
Copy link

CLAassistant commented Aug 27, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ elie222
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

@elie222
Copy link
Owner Author

elie222 commented Aug 27, 2025

@cursor @cursoragent we already had existing webhook functionality in the project. the main thing was to just tell the dev how to use the feature.
users can generate a webhook secret on the /settings page already. the only thing missing was some notes on the payload the webhook sends. we didn’t need new pages added to the project

@cursor
Copy link

cursor bot commented Aug 27, 2025

I streamlined the webhook documentation experience by removing a dedicated page and simplifying the in-app dialog to focus solely on the webhook payload structure. This makes the information more accessible and concise directly within the settings.

  • I deleted the standalone webhook documentation page at apps/web/app/(app)/[emailAccountId]/settings/webhooks/page.tsx.
  • I refactored apps/web/components/WebhookDocumentation.tsx:
    • I renamed the main component from WebhookDocumentation to WebhookPayloadDocumentation and the dialog wrapper to WebhookDocumentationDialog to reflect its new focus.
    • I simplified the component to display only the webhook payload structure, removing tabs for TypeScript types, code examples, URL variables, and security best practices.
    • I introduced a new WebhookDocumentationLink component to provide a concise link to the payload dialog.
  • I updated apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx to use the new WebhookDocumentationLink component, replacing the previous button and dialog trigger.
  • I removed the apps/web/types/webhook.ts file, as the detailed types and examples are no longer displayed in the UI.

3 tasks completed

  • Remove unnecessary webhook documentation pages that weren't requested
  • Simplify webhook documentation to just show payload info inline
  • Focus documentation on payload structure only, not full implementation guides
Open in Cursor Open in Web

Learn more about Cursor Agents

Co-authored-by: eliesteinbock <eliesteinbock@gmail.com>
@elie222 elie222 marked this pull request as ready for review August 28, 2025 07:14
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (6)
apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx (1)

17-17: Copy nit: use a readable breadcrumb arrow.
Replace ASCII "=>":

-        description="API webhook secret for request verification. Include this in the X-Webhook-Secret header when setting up webhook endpoints. Set webhook URLs for individual rules in the Assistant=>Rules tab."
+        description="API webhook secret for request verification. Include this in the X-Webhook-Secret header when setting up webhook endpoints. Set webhook URLs for individual rules in the Assistant → Rules tab."
apps/web/utils/action-item.ts (1)

141-144: Clarify label as “Webhook URL”.
Minor UX clarity improvement in forms.

-        label: "URL",
+        label: "Webhook URL",
apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx (1)

217-217: Prevent long webhook URLs from overflowing.
Add Tailwind word-break to the summary wrapper.

-        <div className="whitespace-pre-wrap">{summaryContent}</div>
+        <div className="whitespace-pre-wrap break-all">{summaryContent}</div>
apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx (1)

1269-1276: Use type="url" for webhook URL input; keep inline docs link

Improve UX/validation for the webhook URL by using the URL input type. The docs link integration looks good.

Apply this diff:

-                      <Input
-                        type="text"
+                      <Input
+                        type={field.name === "url" ? "url" : "text"}
                         name={`actions.${index}.${field.name}.value`}
                         registerProps={register(
                           `actions.${index}.${field.name}.value`,
                         )}
                         placeholder={field.placeholder}
                       />

Also applies to: 1277-1282

apps/web/components/WebhookDocumentation.tsx (2)

75-87: Add accessible label/title to icon-only copy button

Icon-only controls need an accessible name.

Apply this diff:

-          <Button
-            variant="ghost"
-            size="sm"
-            onClick={() => copyToClipboard(payloadJson)}
-          >
+          <Button
+            variant="ghost"
+            size="sm"
+            aria-label={copied ? "Copied payload JSON" : "Copy payload JSON"}
+            title={copied ? "Copied payload JSON" : "Copy payload JSON"}
+            onClick={() => copyToClipboard(payloadJson)}
+          >

66-72: Clarify HTTP details (method and content type)

Explicitly state Content-Type to remove ambiguity.

Apply this diff:

       <div className="text-sm text-muted-foreground">
         When a rule with a webhook action is triggered, we'll send a POST
         request to your URL with the following payload:
       </div>
+      <div className="text-xs text-muted-foreground">
+        HTTP details: Method <code>POST</code>, <code>Content-Type: application/json</code>.
+      </div>
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0581f55 and ad8beeb.

📒 Files selected for processing (7)
  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx (2 hunks)
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx (2 hunks)
  • apps/web/components/WebhookDocumentation.tsx (1 hunks)
  • apps/web/utils/action-item.ts (2 hunks)
  • version.txt (1 hunks)
🧰 Additional context used
📓 Path-based instructions (18)
apps/web/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Path aliases: Use @/ for imports from project root
Use proper error handling with try/catch blocks
Format code with Prettier
Leverage TypeScript inference for better DX

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/utils/action-item.ts
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/components/WebhookDocumentation.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
apps/web/app/**

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

NextJS app router structure with (app) directory

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
apps/web/**/*.tsx

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

apps/web/**/*.tsx: Follow tailwindcss patterns with prettier-plugin-tailwindcss
Prefer functional components with hooks
Use shadcn/ui components when available
Ensure responsive design with mobile-first approach
Follow consistent naming conventions (PascalCase for components)
Use LoadingContent component for async data
Use result?.serverError with toastError and toastSuccess
Use LoadingContent component to handle loading and error states consistently
Pass loading, error, and children props to LoadingContent

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/components/WebhookDocumentation.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
!{.cursor/rules/*.mdc}

📄 CodeRabbit inference engine (.cursor/rules/cursor-rules.mdc)

Never place rule files in the project root, in subdirectories outside .cursor/rules, or in any other location

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/utils/action-item.ts
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/components/WebhookDocumentation.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
  • version.txt
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/form-handling.mdc)

**/*.tsx: Use React Hook Form with Zod for validation
Validate form inputs before submission
Show validation errors inline next to form fields

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/components/WebhookDocumentation.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)

**/*.{ts,tsx}: Use createScopedLogger for logging in backend TypeScript files
Typically add the logger initialization at the top of the file when using createScopedLogger
Only use .with() on a logger instance within a specific function, not for a global logger

Import Prisma in the project using import prisma from "@/utils/prisma";

**/*.{ts,tsx}: Don't use TypeScript enums.
Don't use TypeScript const enum.
Don't use the TypeScript directive @ts-ignore.
Don't use primitive type aliases or misleading types.
Don't use empty type parameters in type aliases and interfaces.
Don't use any or unknown as type constraints.
Don't use implicit any type on variable declarations.
Don't let variables evolve into any type through reassignments.
Don't use non-null assertions with the ! postfix operator.
Don't misuse the non-null assertion operator (!) in TypeScript files.
Don't use user-defined types.
Use as const instead of literal types and type annotations.
Use export type for types.
Use import type for types.
Don't declare empty interfaces.
Don't merge interfaces and classes unsafely.
Don't use overload signatures that aren't next to each other.
Use the namespace keyword instead of the module keyword to declare TypeScript namespaces.
Don't use TypeScript namespaces.
Don't export imported variables.
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.
Don't use parameter properties in class constructors.
Use either T[] or Array consistently.
Initialize each enum member value explicitly.
Make sure all enum members are literal values.

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/utils/action-item.ts
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/components/WebhookDocumentation.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
apps/web/app/(app)/*/**

📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)

Components for the page are either put in page.tsx, or in the apps/web/app/(app)/PAGE_NAME folder

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
apps/web/app/(app)/*/**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)

If you need to use onClick in a component, that component is a client component and file must start with 'use client'

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
apps/web/app/(app)/*/**/**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)

If we're in a deeply nested component we will use swr to fetch via API

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
apps/web/app/**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Components with onClick must be client components with use client directive

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{js,jsx,ts,tsx}: Don't use elements in Next.js projects.
Don't use elements in Next.js projects.
Don't use namespace imports.
Don't access namespace imports dynamically.
Don't use global eval().
Don't use console.
Don't use debugger.
Don't use var.
Don't use with statements in non-strict contexts.
Don't use the arguments object.
Don't use consecutive spaces in regular expression literals.
Don't use the comma operator.
Don't use unnecessary boolean casts.
Don't use unnecessary callbacks with flatMap.
Use for...of statements instead of Array.forEach.
Don't create classes that only have static members (like a static namespace).
Don't use this and super in static contexts.
Don't use unnecessary catch clauses.
Don't use unnecessary constructors.
Don't use unnecessary continue statements.
Don't export empty modules that don't change anything.
Don't use unnecessary escape sequences in regular expression literals.
Don't use unnecessary labels.
Don't use unnecessary nested block statements.
Don't rename imports, exports, and destructured assignments to the same name.
Don't use unnecessary string or template literal concatenation.
Don't use String.raw in template literals when there are no escape sequences.
Don't use useless case statements in switch statements.
Don't use ternary operators when simpler alternatives exist.
Don't use useless this aliasing.
Don't initialize variables to undefined.
Don't use the void operators (they're not familiar).
Use arrow functions instead of function expressions.
Use Date.now() to get milliseconds since the Unix Epoch.
Use .flatMap() instead of map().flat() when possible.
Use literal property access instead of computed property access.
Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.
Use concise optional chaining instead of chained logical expressions.
Use regular expression literals instead of the RegExp constructor when possible.
Don't use number literal object member names th...

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/utils/action-item.ts
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/components/WebhookDocumentation.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
!pages/_document.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

!pages/_document.{js,jsx,ts,tsx}: Don't import next/document outside of pages/_document.jsx in Next.js projects.
Don't import next/document outside of pages/_document.jsx in Next.js projects.

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/utils/action-item.ts
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/components/WebhookDocumentation.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
  • version.txt
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{jsx,tsx}: Don't destructure props inside JSX components in Solid projects.
Don't use both children and dangerouslySetInnerHTML props on the same element.
Don't use Array index in keys.
Don't assign to React component props.
Don't define React components inside other components.
Don't use event handlers on non-interactive elements.
Don't assign JSX properties multiple times.
Don't add extra closing tags for components without children.
Use <>...</> instead of ....
Don't insert comments as text nodes.
Don't use the return value of React.render.
Make sure all dependencies are correctly specified in React hooks.
Make sure all React hooks are called from the top level of component functions.
Don't use unnecessary fragments.
Don't pass children as props.
Use semantic elements instead of role attributes in JSX.

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/components/WebhookDocumentation.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
**/*.{html,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{html,jsx,tsx}: Don't use or elements.
Don't use accessKey attribute on any HTML element.
Don't set aria-hidden="true" on focusable elements.
Don't add ARIA roles, states, and properties to elements that don't support them.
Only use the scope prop on elements.
Don't assign non-interactive ARIA roles to interactive HTML elements.
Make sure label elements have text content and are associated with an input.
Don't assign interactive ARIA roles to non-interactive HTML elements.
Don't assign tabIndex to non-interactive HTML elements.
Don't use positive integers for tabIndex property.
Don't include "image", "picture", or "photo" in img alt prop.
Don't use explicit role property that's the same as the implicit/default role.
Make static elements with click handlers use a valid role attribute.
Always include a title element for SVG elements.
Give all elements requiring alt text meaningful information for screen readers.
Make sure anchors have content that's accessible to screen readers.
Assign tabIndex to non-interactive HTML elements with aria-activedescendant.
Include all required ARIA attributes for elements with ARIA roles.
Make sure ARIA properties are valid for the element's supported roles.
Always include a type attribute for button elements.
Make elements with interactive roles and handlers focusable.
Give heading elements content that's accessible to screen readers (not hidden with aria-hidden).
Always include a lang attribute on the html element.
Always include a title attribute for iframe elements.
Accompany onClick with at least one of: onKeyUp, onKeyDown, or onKeyPress.
Accompany onMouseOver/onMouseOut with onFocus/onBlur.
Include caption tracks for audio and video elements.
Make sure all anchors are valid and navigable.
Ensure all ARIA properties (aria-*) are valid.
Use valid, non-abstract ARIA roles for elements with ARIA roles.
Use valid ARIA state and property values.
Use valid values for the autocomplete attribute on input eleme...

Files:

  • apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx
  • apps/web/components/WebhookDocumentation.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/form-handling.mdc)

**/*.ts: The same validation should be done in the server action too
Define validation schemas using Zod

Files:

  • apps/web/utils/action-item.ts
apps/web/utils/**

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Create utility functions in utils/ folder for reusable logic

Files:

  • apps/web/utils/action-item.ts
apps/web/utils/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

apps/web/utils/**/*.ts: Use lodash utilities for common operations (arrays, objects, strings)
Import specific lodash functions to minimize bundle size

Files:

  • apps/web/utils/action-item.ts
apps/web/components/**/*.tsx

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

Use React Hook Form with Zod validation for form handling

Use the LoadingContent component to handle loading and error states consistently in data-fetching components.

Use PascalCase for components (e.g. components/Button.tsx)

Files:

  • apps/web/components/WebhookDocumentation.tsx
🧬 Code graph analysis (2)
apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx (1)
apps/web/app/(app)/[emailAccountId]/settings/WebhookGenerate.tsx (1)
  • RegenerateSecretButton (8-43)
apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx (1)
apps/web/components/WebhookDocumentation.tsx (1)
  • WebhookDocumentationLink (152-164)
🔇 Additional comments (10)
version.txt (2)

1-1: Version bump looks good.
No functional impact.


1-1: Guardrail passed: no <img>/<picture> tags in the docs UI code. Searches in apps/web (tsx, jsx, mdx, html) returned no instances; the only <img> is in README.md (outside code).

apps/web/app/(app)/[emailAccountId]/assistant/RulesTabNew.tsx (1)

8-8: Layout spacing tweak LGTM.
The added mt-8 improves visual rhythm without side effects.

apps/web/app/(app)/[emailAccountId]/settings/WebhookSection.tsx (2)

29-34: Button layout wrapper LGTM.
The flex container aligns the Copy and Regenerate buttons cleanly.


17-17: Verify backend verification logic uses ‘X-Webhook-Secret’. The header name is consistent across frontend code and docs; confirm the backend webhook handler expects the same casing and name to avoid doc drift.

apps/web/utils/action-item.ts (1)

25-26: Additive placeholder field is safe and useful.
Type addition is backward-compatible; placeholder on CALL_WEBHOOK improves DX.

Also applies to: 141-144

apps/web/app/(app)/[emailAccountId]/assistant/ActionSummaryCard.tsx (1)

176-178: Good tooltip copy—concise and actionable.
No logic changes; improves discoverability.

apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx (2)

99-99: Webhook docs link import — LGTM

Import path and usage align with project aliases. No issues.


1275-1276: Contextual placeholders for action fields — LGTM

Passing field-specific placeholders from actionInputs improves clarity without coupling.

apps/web/components/WebhookDocumentation.tsx (1)

46-63: No changes needed: documentation matches implementation
The example payload fields (strings for cc/bcc, no “to” property) and the headerMessageId naming align exactly with the WebhookPayload type in apps/web/utils/webhook.ts, and the header is correctly cased as X-Webhook-Secret.

Comment on lines +35 to +43
const copyToClipboard = async (text: string) => {
try {
await navigator.clipboard.writeText(text);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch (err) {
console.error("Failed to copy text: ", err);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove console usage; add clipboard fallback + user feedback

Project guideline forbids console usage. Add a graceful fallback when navigator.clipboard is unavailable/blocked and surface an error toast.

Apply this diff:

 import { useState } from "react";
 import { Copy, Check } from "lucide-react";
 import { Button } from "@/components/ui/button";
+import { toastError } from "@/components/Toast";
@@
   const copyToClipboard = async (text: string) => {
     try {
       await navigator.clipboard.writeText(text);
       setCopied(true);
       setTimeout(() => setCopied(false), 2000);
-    } catch (err) {
-      console.error("Failed to copy text: ", err);
+    } catch {
+      // Fallback for insecure contexts or denied permissions
+      try {
+        const el = document.createElement("textarea");
+        el.value = text;
+        el.setAttribute("readonly", "");
+        el.style.position = "absolute";
+        el.style.left = "-9999px";
+        document.body.appendChild(el);
+        el.select();
+        document.execCommand("copy");
+        document.body.removeChild(el);
+        setCopied(true);
+        setTimeout(() => setCopied(false), 2000);
+      } catch {
+        toastError({ description: "Failed to copy to clipboard." });
+      }
     }
   };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const copyToClipboard = async (text: string) => {
try {
await navigator.clipboard.writeText(text);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch (err) {
console.error("Failed to copy text: ", err);
}
};
import { useState } from "react";
import { Copy, Check } from "lucide-react";
import { Button } from "@/components/ui/button";
import { toastError } from "@/components/Toast";
const copyToClipboard = async (text: string) => {
try {
await navigator.clipboard.writeText(text);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch {
// Fallback for insecure contexts or denied permissions
try {
const el = document.createElement("textarea");
el.value = text;
el.setAttribute("readonly", "");
el.style.position = "absolute";
el.style.left = "-9999px";
document.body.appendChild(el);
el.select();
document.execCommand("copy");
document.body.removeChild(el);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch {
toastError({ description: "Failed to copy to clipboard." });
}
}
};
🤖 Prompt for AI Agents
In apps/web/components/WebhookDocumentation.tsx around lines 35 to 43, remove
the console.error usage and implement a graceful clipboard fallback and
user-facing error toast: first try navigator.clipboard.writeText if available,
otherwise copy by creating a hidden textarea, selecting its content and using
document.execCommand('copy'); on success setCopied(true) and clear it after 2s
as before; on any failure call the project's toast/error notification API (do
not use console) with a clear message like "Failed to copy to clipboard" and
include optional error detail, and ensure any created DOM nodes are cleaned up
and proper permission errors are handled.

Comment on lines +25 to 26
placeholder?: string;
}[];
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify placeholder is actually rendered and URL is validated.
Ensure RuleForm passes field.placeholder to the Input and Zod validates https URLs for CALL_WEBHOOK.


🏁 Script executed:

#!/bin/bash
# 1) Confirm placeholder is wired into RuleForm inputs
rg -nP -C3 'placeholder\s*=' apps/web/app/\(app\)/\[emailAccountId]/assistant/RuleForm.tsx

# 2) Locate rule.validation and check CALL_WEBHOOK url uses z.string().url()
fd -t f 'rule.validation.*\.ts' apps/web | xargs -I {} rg -nP -C3 'CALL_WEBHOOK|url\s*:\s*z\.string\(\)\.url\(\)' {}

Length of output: 2072


Enforce URL format in Zod schema for CALL_WEBHOOK
Placeholder wiring in RuleForm is correct. In apps/web/utils/rule.validation.ts, the url field for ActionType.CALL_WEBHOOK only checks !data.url?.value?.trim(); replace this manual check with a Zod constraint such as z.string().url() (or restrict to HTTPS) to validate URL format.

🤖 Prompt for AI Agents
In apps/web/utils/action-item.ts around lines 25 to 26, the current handling
leaves URL format validation to a manual check elsewhere; replace that with a
Zod constraint on the CALL_WEBHOOK url field by using z.string().url() (or
z.string().regex(/^https:\/\//) if you want to enforce HTTPS only), ensuring the
schema requires a non-empty string and validates format, update any optional
chaining to match the schema (make the field required if needed) and provide a
clear Zod error message for invalid URLs so the manual !data.url?.value?.trim()
check can be removed.

@elie222 elie222 changed the title Implement new feature Webhook payload dialog Aug 28, 2025
@elie222 elie222 merged commit 89f3e55 into main Aug 28, 2025
11 of 12 checks passed
@elie222 elie222 deleted the cursor/implement-new-feature-4606 branch August 28, 2025 07:53
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

Comments