[PULSE-41] Implement UTM Campaign URL Builder & Tools #7
Reference in New Issue
Block a user
No description provided.
Delete Branch "staging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Work Item
PULSE-41
Summary
Changes
UtmBuilder.tsxinPulse/pulse-frontend/components/tools/to handle URL construction, site selection, and domain enforcement.Pulse/pulse-frontend/app/tools/page.tsxto host the standalone builder tool.Campaigns.tsxto include a "Build URL" button that opens the builder in a modal with the current site pre-selected.Pulse/pulse-frontend/app/layout-content.tsxandciphera-ui/Header.tsxto inject a "Tools" link into the main header bar when a user is logged in.InputandButtonfrom@ciphera-net/uifor consistent styling (focus rings, dark mode, hover states).ciphera-uito0.0.44and updated all frontend dependencies (auth,drop,pulse,website) to match.Test Plan
[ ] Log in to Pulse and verify the "Tools" link appears in the top navigation bar.
[ ] Navigate to
/toolsand verify the UTM Builder loads and allows selecting any site.[ ] Go to a specific site dashboard, click "Build URL" in the Campaigns widget, and verify the current site is pre-selected and the domain is locked.
[ ] Generate a URL with special characters in the campaign name and verify it is correctly URL-encoded.
[ ] Check that the "Copy to Clipboard" button works.
[ ] Verify dark mode styling for all new inputs and modals.
Greptile Overview
Greptile Summary
This PR implements a comprehensive UTM Campaign URL Builder feature that integrates seamlessly into the Pulse analytics platform. The implementation adds both a standalone Tools page accessible via global navigation and a contextual modal accessible from individual site dashboards.
Key Changes:
UtmBuildercomponent handles URL construction with automatic site selection, domain enforcement, and clipboard copy functionality@ciphera-net/uiArchitecture:
useEffecthooks to avoid dependency issues: one for fetching sites on mount, another for initialization logicURLAPI for proper encoding and parameter handlingutm_termandutm_content)Minor Issue Found:
utm_termandutm_content) compared to required parametersConfidence Score: 4.5/5
Important Files Changed
Sequence Diagram
4 files reviewed, 1 comment
Edit Code Review Agent Settings | Greptile
@@ -0,0 +1,213 @@'use client'The
useEffectreferencesvalues.urlon line 39 but doesn't include it in the dependency array on line 49. This violates React's exhaustive-deps rule and could cause stale closures.Prompt To Fix With AI
@@ -0,0 +1,213 @@'use client'Resolved the React hook dependency warning by splitting the logic into two separate useEffect hooks:
Data Fetching: Runs only once on mount ([] dependencies) to fetch the list of sites.
Initialization: Runs when sites, initialSiteId, selectedSiteId, or values.url changes. It correctly handles setting the default site without causing infinite loops or stale closures, ensuring the linter is happy and the behavior remains correct (including respecting user input if they type before sites load).
4 files reviewed, 1 comment
Edit Code Review Agent Settings | Greptile
@@ -0,0 +73,4 @@url.searchParams.set('utm_medium', values.medium.toLowerCase())url.searchParams.set('utm_campaign', values.campaign.toLowerCase())if (values.term) url.searchParams.set('utm_term', values.term)if (values.content) url.searchParams.set('utm_content', values.content)Inconsistent casing:
utm_termandutm_contentaren't lowercased like the other UTM parametersNote: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI