Skip to content

Conversation

@ameer2468
Copy link
Contributor

@ameer2468 ameer2468 commented Aug 12, 2025

This PR: make sure to show required TXT record.

Summary by CodeRabbit

  • New Features
    • Added TXT record verification instructions in the custom domain verification step, showing per-record Type/Name/Value and one-click copy when TXT verification is required and the domain is unverified.
  • Bug Fixes
    • Adjusted Remove/Setup button so loading and disabled states apply only when removing a verified domain, avoiding spinners during setup.
  • Style
    • Minor text-order adjustment in a development-mode warning for visual consistency.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 12, 2025

Walkthrough

Adds TXT DNS verification UI to the verify step (shown when TXT records exist and domain is not verified) and changes the CustomDomain action button to show spinner/disabled only when the domain is verified and the remove mutation is pending. No public API changes.

Changes

Cohort / File(s) Summary of changes
Custom domain action button
apps/web/app/(org)/dashboard/settings/organization/components/CustomDomain.tsx
Reordered className text token and made the Remove/Setup button pass spinner and disabled only when isVerified (uses removeDomainMutation.isPending). onClick behavior unchanged.
Verification step UI (TXT records)
apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx
Adds TXT verification support: reads domainConfig.verification into verificationRecords, computes showTXTRecord when records exist and domain is not verified, adds TXTDomainValueHandler to compute record Name, renders a TXT Record panel (Type/Name/Value with Copy button) above the A-record block, reuses existing copy-to-clipboard logic; A/CNAME sections unchanged. Also imports DomainVerification for typing.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant VS as VerifyStep
  participant DC as domainConfig.verification
  participant CB as Clipboard

  U->>VS: Open Verify Step
  VS->>DC: Read verification records
  DC-->>VS: TXT records (if any)
  alt has TXT and not verified
    VS->>U: Render TXT Records panel
    U->>VS: Click Copy on a record
    VS->>CB: Write value to clipboard
    CB-->>VS: Success
    VS-->>U: Show copied feedback
  else No TXT or already verified
    VS-->>U: Skip TXT panel
  end
Loading
sequenceDiagram
  participant U as User
  participant CD as CustomDomain
  participant RM as removeDomainMutation

  U->>CD: View domain row
  alt isVerified
    CD->>RM: Observe isPending
    CD-->>U: Show Remove button (spinner/disabled if pending)
    U->>CD: Click Remove
    CD->>RM: mutate(remove)
  else not verified
    CD-->>U: Show Setup button (no spinner/disabled)
    U->>CD: Click Setup
    CD-->>U: Proceed to setup flow
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

Poem

I nibble lines of TXT with care,
Records shown when proof is there.
A click — the value leaps to hand,
Spinner waits when bunnies stand.
Hop, verify, then on we go. 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 961f7bd and e9e4c89.

📒 Files selected for processing (1)
  • apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
  • GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch custom-domain-records

🪧 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 @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai 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:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai 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 @coderabbitai help to get the list of available commands.

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8b4bf6 and e4a6784.

📒 Files selected for processing (2)
  • apps/web/app/(org)/dashboard/settings/organization/components/CustomDomain.tsx (2 hunks)
  • apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
  • GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
🔇 Additional comments (6)
apps/web/app/(org)/dashboard/settings/organization/components/CustomDomain.tsx (2)

98-98: Minor CSS class ordering change

The class order change from "text-white text-xs" to "text-xs text-white" doesn't affect functionality but improves consistency with typical utility-first ordering patterns.


148-149: Improved button state management for unverified domains

Good improvement! The conditional spinner and disabled states now only apply when the domain is verified, preventing the button from being disabled during the setup flow. This ensures users can interact with the "Setup" button even if other operations are pending.

apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx (4)

34-37: LGTM: Clean extraction of verification records

The extraction of verificationRecords and hasTXTVerification flag follows the existing pattern and provides clear semantic meaning for the TXT verification feature.


69-69: Proper conditional rendering logic for TXT records

The showTXTRecord condition correctly shows TXT records only when verification records exist and the domain is not yet verified, maintaining consistency with the A and CNAME record logic.


118-184: Well-structured TXT record configuration panel

The TXT record configuration panel follows the established UI patterns from A and CNAME record sections. The implementation includes:

  • Consistent styling and layout
  • Proper copy-to-clipboard functionality
  • Clear labeling and instructions
  • Responsive grid layout

The code reuses existing components and maintains visual consistency across the verification UI.


131-180: DomainVerification fields are correctly typed

The DomainVerification type explicitly defines type, domain, and value, so the JSX mapping over verificationRecords is safe and no changes are needed.

@ameer2468 ameer2468 merged commit b835391 into main Aug 12, 2025
9 checks passed
@ameer2468 ameer2468 deleted the custom-domain-records branch August 12, 2025 15:49
This was referenced Aug 26, 2025
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