Conversation
… enhance Campaigns component with URL builder modal
…tes and improve URL input experience
…refactor layout-content for improved navigation handling
…ayout in ToolsPage and Campaigns; refactor UtmBuilder for better input handling and user experience
Greptile OverviewGreptile SummaryThis 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:
Architecture:
Minor Issue Found:
Confidence Score: 4.5/5
|
| Filename | Overview |
|---|---|
| components/tools/UtmBuilder.tsx | New UTM builder component with site selection, URL construction, and clipboard copy functionality - well-structured with proper error handling |
| app/tools/page.tsx | Simple page wrapper for the UTM builder tool - minimal code, no issues |
| components/dashboard/Campaigns.tsx | Added "Build URL" button and modal integration for UTM builder with proper state management |
| app/layout-content.tsx | Added Tools navigation link to header for authenticated users - clean integration |
Sequence Diagram
sequenceDiagram
participant User
participant LayoutContent
participant ToolsPage
participant Campaigns
participant UtmBuilder
participant API as listSites API
participant Clipboard
Note over User,Clipboard: Standalone Tools Page Flow
User->>LayoutContent: Click "Tools" nav link
LayoutContent->>ToolsPage: Navigate to /tools
ToolsPage->>UtmBuilder: Render (no initialSiteId)
UtmBuilder->>API: Fetch all sites
API-->>UtmBuilder: Return sites array
UtmBuilder->>UtmBuilder: Auto-select first site
User->>UtmBuilder: Enter UTM parameters
UtmBuilder->>UtmBuilder: Generate URL with params
User->>UtmBuilder: Click copy button
UtmBuilder->>Clipboard: Write generated URL
UtmBuilder->>User: Show checkmark (copied)
Note over User,Clipboard: Dashboard Modal Flow
User->>Campaigns: Click "Build URL" button
Campaigns->>UtmBuilder: Open modal with initialSiteId
UtmBuilder->>API: Fetch all sites
API-->>UtmBuilder: Return sites array
UtmBuilder->>UtmBuilder: Pre-select site by initialSiteId
UtmBuilder->>UtmBuilder: Lock domain to selected site
User->>UtmBuilder: Add path and UTM params
UtmBuilder->>UtmBuilder: Generate URL with params
User->>UtmBuilder: Click copy button
UtmBuilder->>Clipboard: Write generated URL
UtmBuilder->>User: Show checkmark (copied)
…tialization based on initialSiteId; enhance user experience by ensuring proper state updates
Comment on lines
+75
to
+76
| if (values.term) url.searchParams.set('utm_term', values.term) | ||
| if (values.content) url.searchParams.set('utm_content', values.content) |
There was a problem hiding this comment.
Inconsistent casing: utm_term and utm_content aren't lowercased like the other UTM parameters
Suggested change
| if (values.term) url.searchParams.set('utm_term', values.term) | |
| if (values.content) url.searchParams.set('utm_content', values.content) | |
| if (values.term) url.searchParams.set('utm_term', values.term.toLowerCase()) | |
| if (values.content) url.searchParams.set('utm_content', values.content.toLowerCase()) |
Note: 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
This is a comment left during a code review.
Path: components/tools/UtmBuilder.tsx
Line: 75:76
Comment:
Inconsistent casing: `utm_term` and `utm_content` aren't lowercased like the other UTM parameters
```suggestion
if (values.term) url.searchParams.set('utm_term', values.term.toLowerCase())
if (values.content) url.searchParams.set('utm_content', values.content.toLowerCase())
```
<sub>Note: 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!</sub>
How can I resolve this? If you propose a fix, please make it concise.
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.
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.