[object Object]

← back to Homesonspec

homesonspec: home detail contact ties to builder-as-firm — 📞 phone (salesPhone→builder fallback) · 🏢 builder site · 🔗 listing; outside-agent layer drafted as gated migration

adcc2318a2208dd83cea123ffd5a69570937093e · 2026-08-06 11:18:50 -0700 · Steve Abrams

Files touched

Diff

commit adcc2318a2208dd83cea123ffd5a69570937093e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Aug 6 11:18:50 2026 -0700

    homesonspec: home detail contact ties to builder-as-firm — 📞 phone (salesPhone→builder fallback) · 🏢 builder site · 🔗 listing; outside-agent layer drafted as gated migration
---
 apps/web/src/app/homes/[id]/page.tsx | 39 +++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 10 deletions(-)

diff --git a/apps/web/src/app/homes/[id]/page.tsx b/apps/web/src/app/homes/[id]/page.tsx
index e4ad3096..d26b1950 100644
--- a/apps/web/src/app/homes/[id]/page.tsx
+++ b/apps/web/src/app/homes/[id]/page.tsx
@@ -298,16 +298,35 @@ export default async function HomeDetailPage({ params }: { params: Promise<{ id:
             <p className="mt-1 text-sm text-neutral-600">
               This builder is actively selling this home — send a note and they&rsquo;ll follow up. No obligation.
             </p>
-            {home.community.salesPhone ? (
-              <>
-                <a href={`tel:${home.community.salesPhone.replace(/[^0-9+]/g, "")}`}
-                  className="btn-accent mt-3 w-full justify-center" data-testid="sales-phone">
-                  📞 Call {home.community.salesPhone}
-                </a>
-                <p className="mt-2 rounded-lg bg-brand-50 px-3 py-2 text-center text-xs font-medium text-brand-800" data-testid="mention-hos">
-                  💬 When you call, mention you saw it on <span className="font-semibold">HomesOnSpec.com</span>
-                </p>
-              </>
+            {/* For spec homes the BUILDER is the firm/broker of record (sold builder-direct),
+                so the contact card ties the home to the builder and links its firm site + the
+                listing page. Phone falls back to the builder's own line when the community
+                sales-office phone is absent. (agent-own-site layer = the drafted migration.) */}
+            {(() => {
+              const phone = home.community.salesPhone ?? home.builder.contactPhone;
+              return phone ? (
+                <>
+                  <a href={`tel:${phone.replace(/[^0-9+]/g, "")}`}
+                    className="btn-accent mt-3 w-full justify-center" data-testid="sales-phone">
+                    📞 Call {phone}
+                  </a>
+                  <p className="mt-2 rounded-lg bg-brand-50 px-3 py-2 text-center text-xs font-medium text-brand-800" data-testid="mention-hos">
+                    💬 When you call, mention you saw it on <span className="font-semibold">HomesOnSpec.com</span>
+                  </p>
+                </>
+              ) : null;
+            })()}
+            {home.builder.websiteUrl ? (
+              <a href={home.builder.websiteUrl} rel="nofollow noopener noreferrer" target="_blank"
+                className="mt-2 block text-center text-sm font-medium text-brand-700 hover:underline" data-testid="builder-site">
+                🏢 Visit {home.builder.name} ↗
+              </a>
+            ) : null}
+            {home.sourceUrl ? (
+              <a href={home.sourceUrl} rel="nofollow noopener noreferrer" target="_blank"
+                className="mt-1 block text-center text-sm font-medium text-brand-700 hover:underline" data-testid="listing-link">
+                🔗 View this listing ↗
+              </a>
             ) : null}
             <div className="mt-3">
               <LeadForm homeId={home.id} communityId={home.communityId} builderName={home.builder.name} />

← af17a415 auto-save: 2026-08-05T15:43:31 (1 files) — ops/drain-dr-hort  ·  back to Homesonspec  ·  scaffold apps/mobile Expo SDK 57 iOS app for App Store onboa f6ad8bc6 →