Skip to content

Conversation

@Ur-imazing
Copy link
Contributor

@Ur-imazing Ur-imazing commented Jan 13, 2026

Summary by CodeRabbit

  • Refactor
    • Simplified component tree structure across journey and template list views by removing unnecessary wrapper components, improving code maintainability without affecting end-user functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

@Ur-imazing Ur-imazing requested a review from jianwei1 January 13, 2026 03:52
@Ur-imazing Ur-imazing self-assigned this Jan 13, 2026
@Ur-imazing Ur-imazing added effort: 2 priority: soon type: chore updating folder structure, initializing projects etc; no production code change on stage labels Jan 13, 2026
@linear
Copy link

linear bot commented Jan 13, 2026

@stage-branch-merger
Copy link

I see you added the "on stage" label, I'll get this merged to the stage branch!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

Walkthrough

This PR removes JourneyProvider context wrappers from JourneyCard components across journey and template list components, simplifying the component hierarchy by rendering cards directly with explicit props instead of wrapping them in provider context.

Changes

Cohort / File(s) Summary
Journey List Components
apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActivePriorityList.tsx, apps/journeys-admin/src/components/JourneyList/ArchivedJourneyList/ArchivedJourneyList.tsx, apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx, apps/journeys-admin/src/components/JourneyList/TrashedJourneyList/TrashedJourneyList.tsx
Removed JourneyProvider wrapper, JourneyFields import, and variant object wrapping around JourneyCard; rendered JourneyCard directly with journey and refetch props. Also removed unnecessary imports including JourneyProvider, JourneyFields, and narrowed JourneySort import to only SortOrder.
Template List Components
apps/journeys-admin/src/components/TemplateList/ActiveTemplateList/ActiveTemplateList.tsx, apps/journeys-admin/src/components/TemplateList/ArchivedTemplateList/ArchivedTemplateList.tsx, apps/journeys-admin/src/components/TemplateList/TrashedTemplateList/TrashedTemplateList.tsx
Removed JourneyProvider wrapper around JourneyCard and eliminated associated imports (JourneyProvider, JourneyFields); simplified rendering to direct JourneyCard invocation with standard props.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • csiyang
  • Kneesal
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
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.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing the JourneyProvider context wrapper from JourneyCard components across multiple files in the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch urimchae/nes-316-substitute-journey-provider-wrapping-for-individual-journey

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.

@nx-cloud
Copy link

nx-cloud bot commented Jan 13, 2026

View your CI Pipeline Execution ↗ for commit 228851d

Command Status Duration Result
nx run journeys-admin-e2e:e2e ✅ Succeeded 1m 2s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
nx run-many --target=upload-sourcemaps --projec... ✅ Succeeded 11s View ↗
nx run-many --target=deploy --projects=journeys... ✅ Succeeded 2m 25s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-13 04:02:37 UTC

@github-actions github-actions bot temporarily deployed to Preview - journeys-admin January 13, 2026 03:54 Inactive
@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Tue Jan 13 16:59:13 NZDT 2026

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (7)
apps/journeys-admin/src/components/JourneyList/ArchivedJourneyList/ArchivedJourneyList.tsx (1)

151-155: Redundant key prop on JourneyCard.

The key is already specified on the parent Grid component (line 148). The key on JourneyCard is unnecessary since React only needs the key on the outermost element in the map iteration.

Suggested fix
-                <JourneyCard
-                  key={journey.id}
-                  journey={journey}
-                  refetch={refetch}
-                />
+                <JourneyCard journey={journey} refetch={refetch} />
apps/journeys-admin/src/components/TemplateList/TrashedTemplateList/TrashedTemplateList.tsx (1)

153-157: Redundant key prop on JourneyCard.

The key is already specified on the parent Grid component (line 150). Remove the duplicate key from JourneyCard.

Suggested fix
-                <JourneyCard
-                  key={journey.id}
-                  journey={journey}
-                  refetch={refetch}
-                />
+                <JourneyCard journey={journey} refetch={refetch} />
apps/journeys-admin/src/components/JourneyList/TrashedJourneyList/TrashedJourneyList.tsx (1)

163-167: Redundant key prop on JourneyCard.

The key is already specified on the parent Grid component (line 160). Remove the duplicate key from JourneyCard.

Suggested fix
-                <JourneyCard
-                  key={journey.id}
-                  journey={journey}
-                  refetch={refetch}
-                />
+                <JourneyCard journey={journey} refetch={refetch} />
apps/journeys-admin/src/components/TemplateList/ActiveTemplateList/ActiveTemplateList.tsx (1)

139-143: Redundant key prop on JourneyCard.

The key is already specified on the parent Grid component (line 136). Remove the duplicate key from JourneyCard.

Suggested fix
-                <JourneyCard
-                  key={journey.id}
-                  journey={journey}
-                  refetch={refetch}
-                />
+                <JourneyCard journey={journey} refetch={refetch} />
apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActivePriorityList.tsx (1)

88-93: LGTM with minor nit: redundant key prop.

The variant handling is correct—casting key as JourneyCardVariant works since allActiveJourneys is keyed by JourneyCardVariant enum values. The direct rendering without JourneyProvider simplifies the component hierarchy.

Minor: The key on JourneyCard (line 89) is redundant since Grid (line 87) already has key={journey.id}.

Optional: Remove redundant key
             <JourneyCard
-              key={journey.id}
               journey={journey}
               refetch={refetch}
               variant={key as JourneyCardVariant}
             />
apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx (1)

586-590: Remove duplicate key prop.

The key is already set on the parent Grid element (line 574). The key on JourneyCard is redundant.

Suggested fix
-                    <JourneyCard
-                      key={journey.id}
-                      journey={journey}
-                      refetch={refetch}
-                    />
+                    <JourneyCard journey={journey} refetch={refetch} />
apps/journeys-admin/src/components/TemplateList/ArchivedTemplateList/ArchivedTemplateList.tsx (1)

140-144: Remove duplicate key prop.

Same issue as JourneyListContent.tsx — the key is already on the parent Grid (line 137).

Suggested fix
-                <JourneyCard
-                  key={journey.id}
-                  journey={journey}
-                  refetch={refetch}
-                />
+                <JourneyCard journey={journey} refetch={refetch} />
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ab58543 and 228851d.

📒 Files selected for processing (7)
  • apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActivePriorityList.tsx
  • apps/journeys-admin/src/components/JourneyList/ArchivedJourneyList/ArchivedJourneyList.tsx
  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
  • apps/journeys-admin/src/components/JourneyList/TrashedJourneyList/TrashedJourneyList.tsx
  • apps/journeys-admin/src/components/TemplateList/ActiveTemplateList/ActiveTemplateList.tsx
  • apps/journeys-admin/src/components/TemplateList/ArchivedTemplateList/ArchivedTemplateList.tsx
  • apps/journeys-admin/src/components/TemplateList/TrashedTemplateList/TrashedTemplateList.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/base.mdc)

**/*.{ts,tsx,js,jsx}: Use early returns whenever possible to make the code more readable.
Use descriptive variable and function/const names.
Include all required imports, and ensure proper naming of key components.

Files:

  • apps/journeys-admin/src/components/TemplateList/ArchivedTemplateList/ArchivedTemplateList.tsx
  • apps/journeys-admin/src/components/TemplateList/TrashedTemplateList/TrashedTemplateList.tsx
  • apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActivePriorityList.tsx
  • apps/journeys-admin/src/components/JourneyList/TrashedJourneyList/TrashedJourneyList.tsx
  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
  • apps/journeys-admin/src/components/JourneyList/ArchivedJourneyList/ArchivedJourneyList.tsx
  • apps/journeys-admin/src/components/TemplateList/ActiveTemplateList/ActiveTemplateList.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/base.mdc)

Define a type if possible.

Files:

  • apps/journeys-admin/src/components/TemplateList/ArchivedTemplateList/ArchivedTemplateList.tsx
  • apps/journeys-admin/src/components/TemplateList/TrashedTemplateList/TrashedTemplateList.tsx
  • apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActivePriorityList.tsx
  • apps/journeys-admin/src/components/JourneyList/TrashedJourneyList/TrashedJourneyList.tsx
  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
  • apps/journeys-admin/src/components/JourneyList/ArchivedJourneyList/ArchivedJourneyList.tsx
  • apps/journeys-admin/src/components/TemplateList/ActiveTemplateList/ActiveTemplateList.tsx
apps/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/apps.mdc)

apps/**/*.{js,jsx,ts,tsx}: Always use MUI over HTML elements; avoid using CSS or tags.
Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.

Files:

  • apps/journeys-admin/src/components/TemplateList/ArchivedTemplateList/ArchivedTemplateList.tsx
  • apps/journeys-admin/src/components/TemplateList/TrashedTemplateList/TrashedTemplateList.tsx
  • apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActivePriorityList.tsx
  • apps/journeys-admin/src/components/JourneyList/TrashedJourneyList/TrashedJourneyList.tsx
  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
  • apps/journeys-admin/src/components/JourneyList/ArchivedJourneyList/ArchivedJourneyList.tsx
  • apps/journeys-admin/src/components/TemplateList/ActiveTemplateList/ActiveTemplateList.tsx
🧠 Learnings (7)
📚 Learning: 2025-12-19T04:58:24.460Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-12-19T04:58:24.460Z
Learning: Applies to apps/watch/src/**/*.{ts,tsx} : Preserve existing contracts in components like `VideoBlock` which depend on the full provider stack, video.js, and mux metadata so autoplay, subtitles, and analytics remain intact.

Applied to files:

  • apps/journeys-admin/src/components/TemplateList/ArchivedTemplateList/ArchivedTemplateList.tsx
  • apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActivePriorityList.tsx
  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
  • apps/journeys-admin/src/components/JourneyList/ArchivedJourneyList/ArchivedJourneyList.tsx
  • apps/journeys-admin/src/components/TemplateList/ActiveTemplateList/ActiveTemplateList.tsx
📚 Learning: 2025-11-11T23:22:02.196Z
Learnt from: mikeallisonJS
Repo: JesusFilm/core PR: 8156
File: apis/api-journeys-modern/src/lib/google/googleAuth.ts:0-0
Timestamp: 2025-11-11T23:22:02.196Z
Learning: In apis/api-journeys-modern, use the validated `env` object from `../../env` instead of accessing `process.env` directly for environment variables that are defined in env.ts (e.g., GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, INTEGRATION_ACCESS_KEY_ENCRYPTION_SECRET). This eliminates the need for runtime validation checks since Zod validates them at application startup.

Applied to files:

  • apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActivePriorityList.tsx
  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
📚 Learning: 2025-04-29T04:56:45.588Z
Learnt from: Ur-imazing
Repo: JesusFilm/core PR: 6382
File: apps/journeys-admin/src/components/JourneyList/ArchivedJourneyList/ArchivedJourneyList.spec.tsx:149-150
Timestamp: 2025-04-29T04:56:45.588Z
Learning: The trailing "00" characters in journey card text content assertions are intentional in the JourneyList component tests.

Applied to files:

  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
📚 Learning: 2025-09-16T04:10:28.624Z
Learnt from: jaco-brink
Repo: JesusFilm/core PR: 7679
File: apis/api-gateway/schema.graphql:0-0
Timestamp: 2025-09-16T04:10:28.624Z
Learning: In PR #7679 (showAssistant field), the showAssistant field was intentionally excluded from JourneyUpdateInput because it will be controlled through direct database operations rather than through GraphQL mutations, keeping it out of the public API surface while still being queryable.

Applied to files:

  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
📚 Learning: 2025-12-19T04:58:24.460Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-12-19T04:58:24.460Z
Learning: Applies to apps/watch/src/**/*.tsx : Use optional props with sensible defaults, include className prop for extensibility, and use ReactNode for children and content slots. Name interfaces with component name prefix (e.g., `ComponentNameProps`).

Applied to files:

  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
📚 Learning: 2025-09-08T22:56:21.606Z
Learnt from: mikeallisonJS
Repo: JesusFilm/core PR: 7498
File: apis/api-journeys-modern/src/schema/action/emailAction/blockUpdateEmailAction.mutation.ts:26-36
Timestamp: 2025-09-08T22:56:21.606Z
Learning: In the action mutations migration (PR #7498), the `journeyId` parameter is intentionally kept in blockUpdate*Action mutations even when unused in the resolver, to maintain API compatibility during the migration from the old "api-journeys" endpoint to the modern "api-journeys-modern" endpoint.

Applied to files:

  • apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx
📚 Learning: 2025-12-19T04:58:24.460Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-12-19T04:58:24.460Z
Learning: Applies to apps/watch/src/**/*.{ts,tsx} : Do not introduce new MUI usage; migrate existing MUI to shadcn/Tailwind. New shadcn work should coexist with core shells/wrappers still using MUI until explicit migration tasks retire them.

Applied to files:

  • apps/journeys-admin/src/components/TemplateList/ActiveTemplateList/ActiveTemplateList.tsx
🧬 Code graph analysis (5)
apps/journeys-admin/src/components/TemplateList/ArchivedTemplateList/ArchivedTemplateList.tsx (1)
apps/journeys-admin/src/components/JourneyList/JourneyCard/JourneyCard.tsx (1)
  • JourneyCard (53-383)
apps/journeys-admin/src/components/TemplateList/TrashedTemplateList/TrashedTemplateList.tsx (1)
apps/journeys-admin/src/components/JourneyList/JourneyCard/JourneyCard.tsx (1)
  • JourneyCard (53-383)
apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActivePriorityList.tsx (2)
apps/journeys-admin/src/components/JourneyList/JourneyCard/JourneyCard.tsx (1)
  • JourneyCard (53-383)
apps/journeys-admin/src/components/JourneyList/ActiveJourneyList/ActivePriorityList/ActiveJourneyListData.ts (1)
  • journey (93-97)
apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx (1)
apps/journeys-admin/src/components/JourneyList/JourneyCard/JourneyCard.tsx (1)
  • JourneyCard (53-383)
apps/journeys-admin/src/components/TemplateList/ActiveTemplateList/ActiveTemplateList.tsx (1)
apps/journeys-admin/src/components/JourneyList/JourneyCard/JourneyCard.tsx (1)
  • JourneyCard (53-383)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Deploy Preview (journeys-admin, 8586/merge, pull_request, 22)
🔇 Additional comments (1)
apps/journeys-admin/src/components/JourneyList/JourneyListContent/JourneyListContent.tsx (1)

19-22: LGTM!

Import cleanup is appropriate — removed unused JourneyProvider, JourneyFields, and narrowed to only the required exports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Chore effort: 2 priority: soon type: chore updating folder structure, initializing projects etc; no production code change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants