Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/dashboard/headlines/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,15 @@ export default function HomePage() {
<div className="text-xs text-gray-400 mt-3">November 3, 2025</div>
</div>
<div className="bg-white rounded-lg shadow-sm border border-gray-200 border-l-4 border-l-green-500 p-6">

<h3 className="font-semibold text-gray-900 mb-2">Add MultiFamilyOS to Your Safe Senders</h3>
<p className="text-gray-600 text-sm mb-4">Send a quick email to info@multifamilyos.ai from the email address you used to log in. This ensures our support messages, property alerts, and system notifications reach your inbox instead of junk mail.</p>
<a
href="mailto:info@multifamilyos.ai?subject=Adding MultiFamilyOS to Safe Senders"
className="inline-block bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded-lg transition-colors text-sm"
>
Send Email →
</a>
<div className="text-xs text-gray-400 mt-3">December 29, 2025</div>
</div>
</div>
</div>
Expand Down
33 changes: 17 additions & 16 deletions app/discover/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -742,16 +742,17 @@ function DiscoverPageContent() {
searchFilters.house = '';
searchFilters.street = '';
} else {
// Check if any part contains a zip code (5 digits)
const zipMatch = query.match(/\b\d{5}(-\d{4})?\b/);
// Check if any part contains a zip code (5 digits) - but not at the beginning (avoid house numbers)
// Look for zip codes after state abbreviations or in standalone context
const zipMatch = query.match(/(?:^|\s|,)\s*(\d{5}(?:-\d{4})?)\s*$/);
const hasZip = zipMatch !== null;

// Check if first part looks like a street address (contains numbers + text, including hyphenated)
const isStreetAddress = /^\d+(?:-\d+)?\s+.+/.test(locationParts[0]);

if (hasZip && locationParts.length === 1) {
// Just a zip code: "80202"
searchFilters.zip = zipMatch[0];
searchFilters.zip = zipMatch[1];
searchFilters.city = '';
searchFilters.state = '';
} else if (isStreetAddress && locationParts.length >= 3) {
Expand Down Expand Up @@ -787,23 +788,23 @@ function DiscoverPageContent() {
// Convert full state name to abbreviation if needed
const statePartUpper = statePart.toUpperCase();
searchFilters.state = US_STATES[statePartUpper as keyof typeof US_STATES] || statePartUpper;
searchFilters.zip = hasZip ? zipMatch[0] : '';
searchFilters.zip = hasZip ? zipMatch[1] : '';
} else if (locationParts.length === 3) {
// Format: "73 Rhode Island Avenue, Newport, RI" (no USA suffix)
const statePart = locationParts[2].trim(); // "RI" or "RI 02840"
const stateZipMatch = statePart.match(/^([a-zA-Z]{2})\s*(\d{5}(?:-\d{4})?)?$/);

if (stateZipMatch) {
searchFilters.state = stateZipMatch[1].toUpperCase();
searchFilters.zip = stateZipMatch[2] || (hasZip ? zipMatch[0] : '');
searchFilters.zip = stateZipMatch[2] || (hasZip ? zipMatch[1] : '');
} else {
searchFilters.state = statePart.toUpperCase();
searchFilters.zip = hasZip ? zipMatch[0] : '';
searchFilters.zip = hasZip ? zipMatch[1] : '';
}
} else {
// Fallback for unusual formats
searchFilters.state = lastPart.toUpperCase();
searchFilters.zip = hasZip ? zipMatch[0] : '';
searchFilters.zip = hasZip ? zipMatch[1] : '';
}
} else if (locationParts.length >= 2) {
// City, State format: "newport, ri" or "denver, co 80202"
Expand All @@ -820,18 +821,18 @@ function DiscoverPageContent() {
// Handle "State, USA" format - treat first part as state
searchFilters.state = US_STATES[firstPartUpper as keyof typeof US_STATES] || firstPartUpper;
searchFilters.city = '';
searchFilters.zip = hasZip ? zipMatch[0] : '';
searchFilters.zip = hasZip ? zipMatch[1] : '';
} else if (firstPart.toLowerCase().includes('county')) {
// Handle county format
searchFilters.county = capitalizeWords(firstPart);
const stateZipMatch = lastPart.match(/^([a-zA-Z]{2})\s*(\d{5}(?:-\d{4})?)?$/);

if (stateZipMatch) {
searchFilters.state = stateZipMatch[1].toUpperCase();
searchFilters.zip = stateZipMatch[2] || (hasZip ? zipMatch[0] : '');
searchFilters.zip = stateZipMatch[2] || (hasZip ? zipMatch[1] : '');
} else {
searchFilters.state = lastPart.toUpperCase();
searchFilters.zip = hasZip ? zipMatch[0] : '';
searchFilters.zip = hasZip ? zipMatch[1] : '';
}
} else {
// Standard "City, State" format
Expand All @@ -840,17 +841,17 @@ function DiscoverPageContent() {

if (stateZipMatch) {
searchFilters.state = stateZipMatch[1].toUpperCase();
searchFilters.zip = stateZipMatch[2] || (hasZip ? zipMatch[0] : '');
searchFilters.zip = stateZipMatch[2] || (hasZip ? zipMatch[1] : '');
} else {
// Assume whole part is state and uppercase it
searchFilters.state = lastPart.toUpperCase();
searchFilters.zip = hasZip ? zipMatch[0] : '';
searchFilters.zip = hasZip ? zipMatch[1] : '';
}
}
} else {
// Single input - could be city name, zip, or street
if (hasZip) {
searchFilters.zip = zipMatch[0];
searchFilters.zip = zipMatch[1];
searchFilters.city = '';
searchFilters.state = '';
} else {
Expand Down Expand Up @@ -1059,7 +1060,7 @@ function DiscoverPageContent() {
const zipMatch = cleanedQuery.match(/\b\d{5}(-\d{4})?\b/);

if (zipMatch && locationParts.length === 1) {
apiParams.zip = zipMatch[0];
apiParams.zip = zipMatch[1];
} else if (locationParts.length >= 2) {
const firstPart = locationParts[0];
const lastPart = locationParts[1].trim();
Expand Down Expand Up @@ -1729,7 +1730,7 @@ function DiscoverPageContent() {
const zipMatch = savedQuery.match(/\b\d{5}(-\d{4})?\b/);

if (zipMatch && locationParts.length === 1) {
apiParams.zip = zipMatch[0];
apiParams.zip = zipMatch[1];
} else if (locationParts.length >= 2) {
const firstPart = locationParts[0];
const lastPart = locationParts[1].trim();
Expand Down Expand Up @@ -1768,7 +1769,7 @@ function DiscoverPageContent() {
} else {
// Single input - could be city, state, or zip
if (zipMatch) {
apiParams.zip = zipMatch[0];
apiParams.zip = zipMatch[1];
} else {
apiParams.city = savedQuery;
}
Expand Down