Conversation
… improved user navigation
…omponents to replace Card with div for improved styling consistency
…els pages, including improved accessibility with aria-labels
…chart components, enhancing visual consistency and accessibility
…hart color logic into useMemo, improving performance and code clarity
Greptile OverviewGreptile SummaryThis PR implements a comprehensive funnels feature for the Pulse analytics dashboard, adding the ability to track user journeys through multi-step conversion paths. Key additions:
Code quality highlights:
All previously flagged issues from review threads have been addressed. The implementation follows existing Pulse patterns and integrates cleanly with the Ciphera branding system. Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| lib/api/funnels.ts | Added funnel API client with full CRUD operations and date normalization for stats queries |
| app/sites/[id]/funnels/page.tsx | Added funnels list page with proper useCallback hooks, empty state, and delete functionality |
| app/sites/[id]/funnels/new/page.tsx | Added funnel creation form with comprehensive validation for step names, paths, and regex patterns |
| app/sites/[id]/funnels/[funnelId]/page.tsx | Added funnel report page with theme-aware charts, date range controls, and proper error handling for 404/403/500 |
Sequence Diagram
sequenceDiagram
participant User
participant Dashboard
participant FunnelsList
participant CreateForm
participant ReportPage
participant API
User->>Dashboard: Click Funnels button
Dashboard->>FunnelsList: Navigate to list
FunnelsList->>API: GET funnels
API-->>FunnelsList: Return funnels array
alt No funnels
FunnelsList->>User: Show empty state
else Has funnels
FunnelsList->>User: Show funnel cards
end
User->>CreateForm: Click create button
CreateForm->>User: Show form
User->>CreateForm: Fill and submit
CreateForm->>CreateForm: Validate inputs
alt Invalid inputs
CreateForm->>User: Show error toast
else Valid inputs
CreateForm->>API: POST create funnel
API-->>CreateForm: Return created funnel
CreateForm->>FunnelsList: Navigate back
FunnelsList->>User: Show success
end
User->>ReportPage: Click funnel
ReportPage->>API: GET funnel details
ReportPage->>API: GET stats with dates
alt 404 error
API-->>ReportPage: Not found
ReportPage->>User: Show not found
else 403 error
API-->>ReportPage: Forbidden
ReportPage->>User: Show access denied
else 500 error
API-->>ReportPage: Server error
ReportPage->>User: Show error with retry
else Success
API-->>ReportPage: Return data
ReportPage->>ReportPage: Generate chart
ReportPage->>User: Display visualization
end
User->>ReportPage: Change date range
ReportPage->>API: GET updated stats
API-->>ReportPage: Return new data
ReportPage->>User: Update display
User->>ReportPage: Delete funnel
ReportPage->>User: Confirm deletion
User->>ReportPage: Confirm
ReportPage->>API: DELETE funnel
API-->>ReportPage: Success
ReportPage->>FunnelsList: Navigate back
… by reintroducing useEffect hooks for improved state management and responsiveness
…y utilizing useCallback for improved performance and dependency management
…format, improving query consistency and accuracy
…g in CreateFunnelPage
…ecific step names in error messages
…essages for not found and general load errors, improving user feedback and experience
…r forbidden access and updating error messages for better user clarity
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-36
Summary
Changes
lib/api/funnels.ts– list, get, create, update, delete funnels; get funnel stats (optionalfrom/to).app/sites/[id]/funnels/page.tsx– list funnels, empty state, Create Funnel (btn-primary), delete with confirm.app/sites/[id]/funnels/new/page.tsx– form (name, description, steps: name/path/type exact|contains|regex), add/remove steps, Cancel (btn-secondary), submit (btn-primary).app/sites/[id]/funnels/[funnelId]/page.tsx– funnel name/description, date range, theme-aware bar chart, stats table (visitors, drop-off %, conversion %), delete; hooks (useTheme, useMemo) before early return (fix React #310).app/sites/[id]/page.tsx– Funnels button on site dashboard; back links and actions usebtn-primary/btn-secondaryandrounded-xl.useTheme+ CHART_COLORS_LIGHT/DARK; step pillsrounded-lg; empty state aligned with GoalStats.Test Plan
[ ] From site dashboard, open Funnels; list and empty state render.
[ ] Create funnel with multiple steps (exact, contains, regex); save and see it in list.
[ ] Open funnel report; date range changes update chart and table; drop-off/conversion values are sensible.
[ ] Delete funnel from list and from report; confirm flow works.
[ ] UI uses Ciphera buttons/radii and chart respects light/dark theme.