Skip to content

Conversation

@Lokimorty
Copy link
Contributor

Summary

Display the initial referrer in the Session modal properties grid, after Device.

Changes

  • Backend: Modified getWebsiteSession.ts to fetch the referrer from the session's first event (both PostgreSQL and ClickHouse queries)
  • Frontend: Added referrer display with favicon icon to SessionInfo.tsx

How to Test

  1. Go to Sessions page
  2. Click on any session to open the modal
  3. Verify "Referrer" appears as the last item in the properties grid
  4. If the session has a referrer, it displays with a favicon; otherwise shows "—"

Display the initial referrer in the Session modal properties grid.
Fetches the referrer from the session's first event to show where
the user originally came from.
@vercel
Copy link

vercel bot commented Nov 27, 2025

@Lokimorty is attempting to deploy a commit to the umami-software Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 27, 2025

Greptile Overview

Greptile Summary

Adds the initial referrer domain to the session modal properties grid, displayed after device information.

  • Backend: Modified getWebsiteSession.ts to fetch referrer_domain from the session's first event using a subquery on website_event table for both PostgreSQL and ClickHouse
  • Frontend: Added referrer display with favicon icon to SessionInfo.tsx, using the existing Favicon component pattern
  • Gracefully handles missing referrer data by showing "—" (handled by the Info component)

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - straightforward feature addition following existing patterns
  • Score reflects a clean, focused implementation that follows existing code patterns. The backend SQL changes are consistent with how other session data is queried, and the frontend changes reuse established components (Favicon, Info) and patterns from the codebase.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/app/(main)/websites/[websiteId]/sessions/SessionInfo.tsx 5/5 Added referrer display with Favicon icon to the session info grid, following existing patterns for displaying session properties.
src/queries/sql/sessions/getWebsiteSession.ts 5/5 Added subquery to fetch referrer_domain from the session's first event for both PostgreSQL and ClickHouse, correctly querying the base website_event table.

Sequence Diagram

sequenceDiagram
    participant User
    participant SessionModal
    participant SessionInfo
    participant API as getWebsiteSession API
    participant DB as Database (PostgreSQL/ClickHouse)

    User->>SessionModal: Click session row
    SessionModal->>API: Request session data
    API->>DB: Query session with referrer subquery
    Note over DB: Subquery gets referrer_domain<br/>from first website_event<br/>(ordered by created_at ASC)
    DB-->>API: Session data + referrerDomain
    API-->>SessionModal: Session response
    SessionModal->>SessionInfo: Render with data
    SessionInfo->>SessionInfo: Display referrer with Favicon
    SessionInfo-->>User: Show session info grid
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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