Skip to content

Rework journeys - #588

Merged
Blaumaus merged 3 commits into
mainfrom
feature/journeys
Jul 11, 2026
Merged

Rework journeys#588
Blaumaus merged 3 commits into
mainfrom
feature/journeys

Conversation

@Blaumaus

@Blaumaus Blaumaus commented Jul 11, 2026

Copy link
Copy Markdown
Member

Changes

If applicable, please describe what changes were made in this pull request.

Community Edition support

  • Your feature is implemented for the Swetrix Community Edition
  • This PR only updates the Cloud (Enterprise) Edition code (e.g. Paddle webhooks, blog, payouts, etc.)

Database migrations

  • Clickhouse / MySQL migrations added for this PR
  • No table schemas changed in this PR

Documentation

  • You have updated the documentation according to your PR
  • This PR did not change any publicly documented endpoints

Summary by CodeRabbit

  • New Features
    • Added a Journeys analytics tab with Sankey visualizations of user navigation paths.
    • Added step/path controls and the ability to inspect sessions for a selected journey step and page (with pagination).
    • Added new Journeys statistics API endpoints for journeys and journey sessions.
  • UI Updates
    • Replaced the legacy User Flow experience with Journeys in the Traffic area and sidebar navigation.
  • Documentation
    • Added Journeys dashboard documentation and new API endpoint docs; updated Traffic docs to reference Journeys.

@Blaumaus Blaumaus self-assigned this Jul 11, 2026
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e2df1c72-0644-4a5b-b604-248cd27fb659

📥 Commits

Reviewing files that changed from the base of the PR and between 456b0e4 and 576536e.

📒 Files selected for processing (2)
  • web/app/pages/Project/tabs/Journeys/JourneysView.tsx
  • web/public/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • web/app/pages/Project/tabs/Journeys/JourneysView.tsx
  • web/public/locales/en.json

📝 Walkthrough

Walkthrough

Adds Journeys analytics endpoints and ClickHouse queries, replaces User Flow API usage, introduces a Journeys Sankey dashboard with session drilldown, and updates related documentation and translations.

Changes

Journeys analytics

Layer / File(s) Summary
Backend contracts and endpoints
backend/apps/*/src/analytics/controller*, backend/apps/*/src/analytics/dto/*, backend/apps/*/src/analytics/interfaces/*
Adds validated journey request DTOs, response interfaces, and authenticated journey endpoints.
ClickHouse journey queries
backend/apps/*/src/analytics/analytics.service.ts
Builds ordered session paths and returns filtered, enriched, paginated journey sessions.
Web API and proxy integration
web/app/api/api.server.ts, web/app/hooks/useAnalyticsProxy.ts, web/app/routes/api.analytics.ts
Replaces User Flow handling with journeys and journey-session requests.
Journeys dashboard and session drilldown
web/app/pages/Project/..., web/app/lib/constants/index.ts
Adds the Journeys tab and Sankey visualization, connects refresh state and filters, supports session inspection, and removes User Flow from Traffic.
Documentation and interface copy
docs/content/docs/analytics-dashboard/*, docs/content/docs/api/stats.mdx, web/public/locales/en.json
Documents Journeys and its APIs and updates navigation and translations.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant JourneysView
  participant AnalyticsProxy
  participant AnalyticsAPI
  participant AnalyticsService
  participant ClickHouse
  User->>JourneysView: Select Journeys tab and filters
  JourneysView->>AnalyticsProxy: Fetch journey paths
  AnalyticsProxy->>AnalyticsAPI: Submit getJourneys request
  AnalyticsAPI->>AnalyticsService: Query journey analytics
  AnalyticsService->>ClickHouse: Execute page-path aggregation
  ClickHouse-->>AnalyticsService: Return journey paths and counts
  AnalyticsService-->>JourneysView: Render Sankey chart
  User->>JourneysView: Select a journey node
  JourneysView->>AnalyticsProxy: Fetch journey sessions
  AnalyticsProxy->>AnalyticsAPI: Submit getJourneySessions request
  AnalyticsAPI->>AnalyticsService: Query matching sessions
  AnalyticsService->>ClickHouse: Execute session detail query
  ClickHouse-->>JourneysView: Return paginated sessions
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The template is present, but the Changes section is left as placeholder text and does not summarize the PR. Add a short Changes summary describing the journeys analytics rework, new endpoints/UI, and documentation updates.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the change but too vague to describe the main update clearly. Use a specific title like "Add journeys analytics endpoints and dashboard" to reflect the core change.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/journeys

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/app/pages/Project/tabs/Journeys/JourneysView.tsx`:
- Around line 108-165: Remove the loadingRef guard and its now-unused loadingRef
declaration from the JourneysView effect. Let every dependency change invoke
load() and fetch with the latest parameters; retain the cancelled flag to ignore
stale responses and preserve the existing loading state cleanup.

In `@web/public/locales/en.json`:
- Line 2679: Update the `noData` translation string to replace “or you disabled”
with “or you've disabled,” preserving the rest of the message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8b27893a-63be-4160-b4e0-2996ecf101df

📥 Commits

Reviewing files that changed from the base of the PR and between 3937c57 and 78e5a87.

⛔ Files ignored due to path filters (3)
  • docs/public/img/analytics-dashboard/journeys-sessions-drawer.png is excluded by !**/*.png
  • docs/public/img/analytics-dashboard/journeys-tooltip.png is excluded by !**/*.png
  • docs/public/img/analytics-dashboard/journeys-view.png is excluded by !**/*.png
📒 Files selected for processing (26)
  • backend/apps/cloud/src/analytics/analytics.controller.ts
  • backend/apps/cloud/src/analytics/analytics.service.ts
  • backend/apps/cloud/src/analytics/dto/get-journey-sessions.dto.ts
  • backend/apps/cloud/src/analytics/dto/get-journeys.dto.ts
  • backend/apps/cloud/src/analytics/interfaces/index.ts
  • backend/apps/community/src/analytics/analytics.controller.ts
  • backend/apps/community/src/analytics/analytics.service.ts
  • backend/apps/community/src/analytics/dto/get-journey-sessions.dto.ts
  • backend/apps/community/src/analytics/dto/get-journeys.dto.ts
  • backend/apps/community/src/analytics/interfaces/index.ts
  • docs/content/docs/analytics-dashboard/journeys.mdx
  • docs/content/docs/analytics-dashboard/meta.json
  • docs/content/docs/analytics-dashboard/traffic.mdx
  • docs/content/docs/api/stats.mdx
  • web/app/api/api.server.ts
  • web/app/hooks/useAnalyticsProxy.ts
  • web/app/lib/constants/index.ts
  • web/app/pages/Project/View/ViewProject.helpers.tsx
  • web/app/pages/Project/View/ViewProject.tsx
  • web/app/pages/Project/View/components/ProjectSidebar.tsx
  • web/app/pages/Project/tabs/Journeys/JourneysView.tsx
  • web/app/pages/Project/tabs/Traffic/SessionsDrawer.tsx
  • web/app/pages/Project/tabs/Traffic/TrafficView.tsx
  • web/app/pages/Project/tabs/Traffic/UserFlow.tsx
  • web/app/routes/api.analytics.ts
  • web/public/locales/en.json
💤 Files with no reviewable changes (2)
  • web/app/pages/Project/tabs/Traffic/UserFlow.tsx
  • web/app/pages/Project/View/ViewProject.helpers.tsx

Comment thread web/app/pages/Project/tabs/Journeys/JourneysView.tsx
Comment thread web/public/locales/en.json Outdated
@Blaumaus
Blaumaus merged commit 6bfbf0f into main Jul 11, 2026
12 checks passed
This was referenced Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant