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
4 changes: 2 additions & 2 deletions src/app/api/redirect/__tests__/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ describe("redirect route with UTM parameter preservation", () => {
expect(location).toContain("affiliate_id=12345");
});

test("does not preserve params for relative paths (should use middleware)", async () => {
test("does not preserve params for relative paths (should use proxy)", async () => {
const searchParams = new URLSearchParams();
searchParams.set("utm_source", "test-source");

const req = createRequest("/signup", searchParams);
const response = await GET(req);

const location = response.headers.get("location");
// Relative paths should not have params preserved (middleware handles this)
// Relative paths should not have params preserved (proxy handles this)
expect(location).toMatch(/^https:\/\/example\.com\/signup$/);
expect(location).not.toContain("utm_source");
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/redirect/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export async function GET(req: Request) {
// 2) Preserve query parameters from the redirect request if the destination URL doesn't have them
// This allows incoming UTMs and other tracking parameters to be passed through
try {
// Only preserve params for absolute URLs (relative paths should use middleware logic)
// Only preserve params for absolute URLs (relative paths should use proxy logic)
if (/^https?:/i.test(location)) {
const destUrl = new URL(location);
const requestParams = url.searchParams;
Expand Down
42 changes: 26 additions & 16 deletions src/components/home/ReactivateCampaignInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -611,79 +611,85 @@ export function ReactivateCampaignInput({

{/* Enrich Toggle with Info - on same line when no file, new line when file uploaded */}
<div
className={`flex items-center gap-1.5 sm:gap-2 ${uploadedFile ? "w-full sm:ml-auto sm:w-auto" : "ml-auto"}`}
className={`flex items-center gap-1.5 rounded-lg px-2 py-1 transition-colors hover:bg-slate-100/50 sm:gap-2 dark:hover:bg-white/5 ${uploadedFile ? "w-full sm:ml-auto sm:w-auto" : "ml-auto"}`}
>
<Label
htmlFor="enrich"
className="flex cursor-pointer items-center gap-1 text-slate-700 text-sm sm:gap-1.5 dark:text-white/90"
className="flex cursor-pointer items-center gap-1 text-slate-700 text-sm transition-colors hover:text-sky-600 sm:gap-1.5 dark:text-white/90 dark:hover:text-sky-400"
>
<span className="hidden sm:inline">Enrich</span>
{/* Mobile: Use Dialog, Desktop: Use Popover */}
<>
<button
type="button"
className="focus:outline-none sm:hidden"
className="rounded-full p-1 transition-colors focus:outline-none hover:bg-sky-500/10 active:bg-sky-500/20 dark:hover:bg-sky-400/10 dark:active:bg-sky-400/20 sm:hidden"
aria-label="Learn more about enrichment"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
setShowEnrichInfo(true);
}}
>
<Info className="h-4 w-4 text-sky-500 opacity-90 transition-opacity active:opacity-100 dark:text-sky-400" />
<Info className="h-4 w-4 text-sky-500 transition-opacity hover:opacity-100 active:opacity-100 dark:text-sky-400 dark:opacity-90" />
</button>
<Popover>
<PopoverTrigger asChild>
<button
type="button"
className="hidden focus:outline-none sm:block"
className="rounded-full p-1 transition-colors focus:outline-none hover:bg-sky-500/10 active:bg-sky-500/20 dark:hover:bg-sky-400/10 dark:active:bg-sky-400/20 sm:block hidden"
aria-label="Learn more about enrichment"
>
<Info className="h-3.5 w-3.5 text-sky-500 opacity-80 transition-opacity hover:opacity-100 dark:text-sky-400" />
<Info className="h-3.5 w-3.5 text-sky-500 opacity-80 transition-opacity hover:opacity-100 dark:text-sky-400 dark:opacity-80 dark:hover:opacity-100" />
</button>
</PopoverTrigger>
<PopoverContent
className="z-50 w-80 border-sky-500/30 bg-background-dark text-white"
className="z-50 w-80 border-sky-500/30 bg-white shadow-lg backdrop-blur-sm dark:border-sky-500/40 dark:bg-slate-900/95 dark:backdrop-blur-xl"
side="top"
align="end"
>
<div className="space-y-3">
<div>
<h4 className="mb-2 font-semibold text-base text-white">
<h4 className="mb-2 font-semibold text-base text-slate-900 dark:text-white">
What is Enrichment?
</h4>
<p className="text-sm text-white/80 leading-relaxed">
<p className="text-sm text-slate-700 leading-relaxed dark:text-white/80">
Automatically enhance your contact data with
verified phone numbers, email addresses, and
additional information to improve your outreach
success rate.
</p>
</div>
<div>
<h5 className="mb-2 font-semibold text-sky-400 text-sm">
<h5 className="mb-2 font-semibold text-sky-600 text-sm dark:text-sky-400">
What you get:
</h5>
<ul className="space-y-1.5 text-sm text-white/80">
<ul className="space-y-1.5 text-sm text-slate-700 dark:text-white/80">
<li className="flex items-start gap-2">
<span className="mt-0.5 text-sky-400">✓</span>
<span className="mt-0.5 text-sky-600 dark:text-sky-400">✓</span>
<span>
Verified contact information (phone, email)
</span>
</li>
<li className="flex items-start gap-2">
<span className="mt-0.5 text-sky-400">✓</span>
<span className="mt-0.5 text-sky-600 dark:text-sky-400">✓</span>
<span>
Enhanced lead data for better targeting
</span>
</li>
<li className="flex items-start gap-2">
<span className="mt-0.5 text-sky-400">✓</span>
<span className="mt-0.5 text-sky-600 dark:text-sky-400">✓</span>
<span>
Social media accounts and social activity summary
</span>
</li>
<li className="flex items-start gap-2">
<span className="mt-0.5 text-sky-600 dark:text-sky-400">✓</span>
<span>
Higher conversion rates with accurate contacts
</span>
</li>
<li className="flex items-start gap-2">
<span className="mt-0.5 text-sky-400">✓</span>
<span className="mt-0.5 text-sky-600 dark:text-sky-400">✓</span>
<span>
Time saved on manual data verification
</span>
Expand All @@ -700,7 +706,7 @@ export function ReactivateCampaignInput({
checked={skipTrace}
onCheckedChange={setSkipTrace}
disabled={isProcessing}
className="h-7 w-12 shrink-0 border-2 border-slate-300/50 data-[state=checked]:border-sky-500 data-[state=checked]:bg-sky-500 data-[state=unchecked]:bg-slate-200/80 dark:border-slate-600/50 dark:data-[state=checked]:border-sky-500 dark:data-[state=checked]:bg-sky-500 dark:data-[state=unchecked]:bg-slate-700/80 [&>span]:h-6 [&>span]:w-6 [&>span]:shadow-md"
className="h-7 w-12 shrink-0 border-2 border-slate-300/50 transition-all data-[state=checked]:border-sky-500 data-[state=checked]:bg-sky-500 data-[state=unchecked]:bg-slate-200/80 hover:border-sky-400/70 hover:shadow-sm dark:border-slate-600/50 dark:data-[state=checked]:border-sky-500 dark:data-[state=checked]:bg-sky-500 dark:data-[state=unchecked]:bg-slate-700/80 dark:hover:border-sky-400/70 dark:hover:shadow-sm [&>span]:h-6 [&>span]:w-6 [&>span]:shadow-md"
/>
</div>
</div>
Expand Down Expand Up @@ -776,6 +782,10 @@ export function ReactivateCampaignInput({
<span className="mt-0.5 text-sky-400">✓</span>
<span>Enhanced lead data for better targeting</span>
</li>
<li className="flex items-start gap-2">
<span className="mt-0.5 text-sky-400">✓</span>
<span>Social media accounts and social activity summary</span>
</li>
<li className="flex items-start gap-2">
<span className="mt-0.5 text-sky-400">✓</span>
<span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/linktree/tree/linkResolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function resolveLink(item: LinkTreeItem): {
isExternal = true;
}

// Always route through internal slug so middleware can increment Redirects (Calls)
// Always route through internal slug so proxy can increment Redirects (Calls)
const slugPath = item.slug ? `/${String(item.slug).replace(/^\//, "")}` : "#";
// If destination is an internal path already, keep it; otherwise force slug path
if (!isRelativePath) {
Expand Down
Loading
Loading