Implement ContactPage submission flow and remove placeholder TODO - #4
Merged
Merged
Conversation
Co-authored-by: naved42 <237417103+naved42@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
naved42
September 3, 2026 16:25
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
naved42
marked this pull request as ready for review
September 3, 2026 16:26
Owner
|
Fixed |
There was a problem hiding this comment.
🟡 Changes recommended
The current isSubmitting/error-handling logic is ineffective due to synchronous state batching and a try/catch that likely never triggers for mailto: navigation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR implements a working submission flow for the ContactPage by replacing the placeholder submit handler with a mailto:-based submission, and adds basic submission UI states (submitting + error feedback).
Changes:
- Replaced the TODO/
console.logsubmit handler with amailto:URL that pre-fills subject/body. - Added
isSubmittingandsubmitErrorUI state, including disabling the submit button and rendering an error message.
File summaries
| File | Description |
|---|---|
| src/components/ContactPage.tsx | Implements mailto: submission flow and adds minimal submission UX state (submitting + error message). |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+29
to
+44
| try { | ||
| // Route submissions through the user's email client until a backend contact endpoint is added. | ||
| const emailSubject = encodeURIComponent(`[WhyAnalyst] ${formData.subject.trim()}`); | ||
| const emailBody = encodeURIComponent( | ||
| `Name: ${formData.name.trim()}\nEmail: ${formData.email.trim()}\n\n${formData.message.trim()}` | ||
| ); | ||
| window.location.href = `mailto:support@whyanalyst.com?subject=${emailSubject}&body=${emailBody}`; | ||
|
|
||
| setSubmitted(true); | ||
| setFormData({ name: '', email: '', subject: '', message: '' }); | ||
| setTimeout(() => setSubmitted(false), 3000); | ||
| } catch { | ||
| setSubmitError('Unable to open your email client. Please email support@whyanalyst.com directly.'); | ||
| } finally { | ||
| setIsSubmitting(false); | ||
| } |
Comment on lines
211
to
215
| <button | ||
| type="submit" | ||
| disabled={isSubmitting} | ||
| className="w-full py-3 bg-brand-primary text-white font-bold rounded-lg hover:bg-brand-primary/90 transition-all flex items-center justify-center gap-2" | ||
| > |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The contact page had a non-functional submit handler with a TODO and debug logging. This change wires the form to a usable submission path and adds minimal UX state handling around submission.
Submission behavior
mailto:-based flow that pre-fills subject and body from form inputs.[WhyAnalyst]for inbound triage consistency.Form state and UX
isSubmittingstate to disable the submit button during submit initiation.submitErrorstate to surface failures when an email client cannot be opened.Code cleanup
console.log-only path) fromContactPage.