Skip to content

fix: Open the contact mailto with a native anchor - #77

Open
AmrendraTheCoder wants to merge 1 commit into
StabilityNexus:mainfrom
AmrendraTheCoder:fix/69-contact-us-mailto
Open

fix: Open the contact mailto with a native anchor#77
AmrendraTheCoder wants to merge 1 commit into
StabilityNexus:mainfrom
AmrendraTheCoder:fix/69-contact-us-mailto

Conversation

@AmrendraTheCoder

@AmrendraTheCoder AmrendraTheCoder commented Aug 14, 2026

Copy link
Copy Markdown

Addressed Issue

Fixes #69

What I found

I went in expecting a wrong or missing address, but the address is fine. The button renders through next/link:

<Link href="mailto:contact@stability.nexus" ...>Contact Us</Link>

next/link attaches its own click handler and calls preventDefault() on the event, so the browser never performs the default action and the mail client is never invoked. The button swallows the click and nothing happens, which matches the report.

What made it click for me was the Join Discord button sitting right next to it in the same flex row. Same component, same styling, but it is an https link and it navigates fine. I measured both with a listener that only reads the event and never cancels it, so the value below is the one next/link left behind:

link href defaultPrevented after handlers
Contact Us mailto:contact@stability.nexus true
Join Discord https://discord.gg/... false, navigates normally

The fix

next/link is for route navigation, and mailto: is not a route, so the button is now a plain <a> and the browser handles the protocol itself. One element changed. className, aria-label and layout are all untouched.

Running the same probe after the change reports defaultPrevented: false.

Verification

  • npm run typecheck passes.
  • Checked in the browser before and after, as in the table above.
  • The Prettier and Tailwind class-order warnings on components/hero.tsx are already there on main and are unchanged by this.

One thing I was unsure about: CONTRIBUTING asks for npm run format:write, but running it over hero.tsx reformats the whole component and buries a three line fix in unrelated churn. I left it out to keep the diff readable. Would you rather I run it anyway? Happy to either way.

One thing I left alone

While I was in there I noticed Join Discord and Contact Us are the only external links in the hero without target="_blank", when every other external link on the page has it. That looked like it belongs with #37 rather than here, so I did not touch it. Glad to fold it into this PR if you would prefer it in one place.

AI usage

Per the Coding with AI section of CONTRIBUTING: I used Claude (Opus) to help dig into the root cause and draft the fix. I reproduced the behaviour in the browser myself, before and after, and the measurements above are ones I ran.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the email contact button’s behavior while preserving its appearance, accessibility label, and mailto action.

The "Contact Us" button in the hero used next/link. The router attaches
its own click handler and calls preventDefault on that event, so the
browser never performed the default action and the mail client never
opened. The button therefore did nothing when clicked.

next/link exists for route navigation. mailto: is not a route, so the
link is now a plain anchor and the browser handles the protocol itself.

Verified in the browser: before the change the click event reported
defaultPrevented=true after all handlers had run; afterwards it reports
false. Styling and the aria-label are unchanged.
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f2a84362-b296-4cff-b042-f4cd3baf42a5

📥 Commits

Reviewing files that changed from the base of the PR and between 5b27102 and 19f549d.

📒 Files selected for processing (1)
  • components/hero.tsx

Walkthrough

The hero contact button now uses a native <a> element for its mailto URL. Its accessibility label, styling, and displayed text remain unchanged.

Changes

Contact mailto fix

Layer / File(s) Summary
Native mailto anchor
components/hero.tsx
The contact control replaces Next.js Link with a native anchor and keeps its URL, accessibility label, styling, and displayed text.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 19f54

This is a small, localized change that restores native mailto handling without altering the surrounding styling or layout. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested labels: Typescript Lang

Suggested reviewers: piyushbijarania

Poem

A rabbit hops where mailto calls,

The contact button now works for all.

Its label stays, its colors shine,

A tiny anchor makes it fine.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: replacing Next.js Link with a native anchor for mailto behavior.
Linked Issues check ✅ Passed The change directly addresses issue #69 by restoring the Contact Us button’s mailto action while preserving its styling and accessibility.
Out of Scope Changes check ✅ Passed The changes are limited to the Contact Us button implementation and its explanatory comment, with no unrelated code changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


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

Comment @coderabbitai help to get the list of available commands.

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.

[BUG]: The contact us button on home page does not work.

1 participant