Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@TWilson023
Copy link
Collaborator

@TWilson023 TWilson023 commented Sep 16, 2025

When opening a program/partner messages page directly on mobile:

  • Start on the main panel
  • Don't start with the right panel open

Summary by CodeRabbit

  • New Features

    • Panels now open based on context: when a program or partner is selected, the main panel is shown by default.
    • Mobile-friendly behavior: the right panel starts closed on mobile and open on larger screens.
  • Refactor

    • Simplified panel state by removing URL parameter-based toggling for more predictable initial views.
  • Chores

    • Removed a stray console log.

@vercel
Copy link
Contributor

vercel bot commented Sep 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Sep 16, 2025 3:20pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Initial panel selection and right-panel visibility now depend on route params and viewport size. On mobile, right panels default closed; on larger screens, open. Layouts initialize currentPanel to "main" when programSlug/partnerId exists, otherwise "index". Legacy searchParams-driven toggling and related hook/effect were removed in one layout.

Changes

Cohort / File(s) Summary
Mobile-aware right panel state
apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page-client.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/[partnerId]/page-client.tsx
Import useMediaQuery from @dub/ui; derive isMobile; initialize right panel open state to !isMobile; remove a console.log.
Initial panel determination (route-based) and cleanup
apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/layout.tsx
Initialize currentPanel to "main" when programSlug exists, else "index"; no other logic changes.
Initial panel determination and effect removal
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/layout.tsx
Remove useRouterStuff and searchParams-driven useEffect; initialize currentPanel to "main" when partnerId exists, else "index"; narrow imports accordingly.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Layout as MessagesLayout
  participant Route as Route Params (programSlug/partnerId)
  participant Panel as Right Panel
  participant MQ as useMediaQuery

  User->>Layout: Open messages page
  Layout->>Route: Read programSlug/partnerId
  alt Param present
    Layout->>Layout: currentPanel = "main"
  else No param
    Layout->>Layout: currentPanel = "index"
  end

  Layout->>MQ: query("(max-width: ...)")
  MQ-->>Layout: isMobile
  Layout->>Panel: setOpen(!isMobile)
Loading
sequenceDiagram
  autonumber
  participant Old as Old Layout (before)
  participant New as New Layout (now)
  participant SP as searchParams
  participant Route as Route Params

  Old->>SP: useEffect listens to searchParams
  SP-->>Old: Toggle currentPanel based on URL params

  New->>Route: Read partnerId/programSlug once
  Route-->>New: Initialize currentPanel ("main" or "index")
  Note over New: No searchParams-based toggling effect
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Add messagingEnabled props #2840 — Also modifies partners messages layout; changes ProgramSelector props in the same file updated here, indicating closely related behavior in that view.

Suggested reviewers

  • steven-tey

Poem

I twitch my ears at panels two,
On phones they hide, on wides they view.
Slugs and partners guide the way,
Index, main—decide the day.
Hop! The query whispers: “small or tall?”
I boop the UI—right for all. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mobile-messages-fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c409a7d and d0510a1.

📒 Files selected for processing (4)
  • apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page-client.tsx (3 hunks)
  • apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/layout.tsx (1 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/[partnerId]/page-client.tsx (3 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/layout.tsx (2 hunks)

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 and usage tips.

@steven-tey steven-tey merged commit 254baeb into main Sep 16, 2025
5 of 8 checks passed
@steven-tey steven-tey deleted the mobile-messages-fix branch September 16, 2025 15:16
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.

3 participants