Skip to content

fix(journeys-admin): allow 2-line display and 100-char limit for adapter notes#9000

Merged
jianwei1 merged 4 commits intomainfrom
jianweichong/nes-1445-media-screen-long-template-adapter-notes-get-cropped-in
Apr 10, 2026
Merged

fix(journeys-admin): allow 2-line display and 100-char limit for adapter notes#9000
jianwei1 merged 4 commits intomainfrom
jianweichong/nes-1445-media-screen-long-template-adapter-notes-get-cropped-in

Conversation

@jianwei1
Copy link
Copy Markdown
Contributor

@jianwei1 jianwei1 commented Apr 9, 2026

Summary

Fixes NES-1445: Long template adapter notes were being cropped to a single line in the Media screen customisation flow.

  • Display fix: Replace whiteSpace: 'nowrap' with CSS line-clamp (2 lines) in VideoAdapterNote so long notes wrap instead of being truncated
  • Input limit: Add maxLength=100 to the Template Adapter Notes TextField in the editor, with conditional "Maximum 100 characters" helper text shown only when the limit is reached
  • Frontend-only: No backend/GraphQL schema changes

Test plan

  • Existing VideosSection tests pass (27/27)
  • Existing VideoBlockEditor tests pass (19/19)
  • New test: TextField enforces maxLength=100
  • New test: Helper text appears at 100-character limit
  • New test: Helper text hidden under 100 characters

Post-Deploy Monitoring & Validation

No additional operational monitoring required — purely presentational CSS change and client-side input constraint with no backend impact.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements

    • Enforced a 100-character client-side limit on video notes and show a "Maximum 100 characters" helper when reached.
    • Adapter notes now display up to two lines instead of single-line truncation for better readability.
  • Tests

    • Added tests covering the notes character limit and helper text behavior at, below, and at-limit conditions.

…ter notes

Replace single-line truncation (whiteSpace: nowrap) with 2-line CSS clamp
in VideoAdapterNote so long notes wrap instead of cropping. Add maxLength=100
to the editor TextField and show "Maximum 100 characters" helper text when
the limit is reached, per design direction.

Closes NES-1445

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jianwei1 jianwei1 self-assigned this Apr 9, 2026
@linear
Copy link
Copy Markdown

linear Bot commented Apr 9, 2026

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 74389d11-51f0-4ce5-9b08-f6d2dfee4c01

📥 Commits

Reviewing files that changed from the base of the PR and between 81d9dac and 5516a47.

📒 Files selected for processing (1)
  • libs/locales/en/apps-journeys-admin.json
✅ Files skipped from review due to trivial changes (1)
  • libs/locales/en/apps-journeys-admin.json

Walkthrough

Adds a 100-character client-side limit and helper text to the VideoBlockEditor notes input, updates VideoAdapterNote to use two-line webkit line-clamp truncation, and adds the corresponding translation and tests.

Changes

Cohort / File(s) Summary
VideoBlockEditor input & tests
apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/VideoBlockEditor/VideoBlockEditor.tsx, apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/VideoBlockEditor/VideoBlockEditor.spec.tsx
Enforce maxLength=100 via inputProps on the notes TextField; conditionally show helper text "Maximum 100 characters" when length reaches 100. Added tests verifying maxLength, helper text at 100 chars, and absence below 100.
Video adapter notes display
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/MediaScreen/Sections/VideosSection/VideosSection.tsx
Changed truncation from single-line ellipsis to two-line webkit clamp (display: -webkit-box, WebkitLineClamp: 2, WebkitBoxOrient: vertical).
Localization
libs/locales/en/apps-journeys-admin.json
Added translation key "Maximum 100 characters": "Maximum 100 characters".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 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 describes the main changes: adding a 2-line display layout for adapter notes and enforcing a 100-character input limit with helper text feedback.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jianweichong/nes-1445-media-screen-long-template-adapter-notes-get-cropped-in

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
Copy Markdown

nx-cloud Bot commented Apr 9, 2026

View your CI Pipeline Execution ↗ for commit 0ce7874

Command Status Duration Result
nx run resources-e2e:e2e ✅ Succeeded 3m 16s View ↗
nx run journeys-admin-e2e:e2e ✅ Succeeded 28s View ↗
nx run journeys-e2e:e2e ✅ Succeeded 20s View ↗
nx run watch-e2e:e2e ✅ Succeeded 19s View ↗
nx run videos-admin-e2e:e2e ✅ Succeeded 4s View ↗
nx run player-e2e:e2e ✅ Succeeded 3s View ↗
nx run watch-modern-e2e:e2e ✅ Succeeded 3s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
Additional runs (20) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-04-10 03:27:48 UTC

@github-actions github-actions Bot requested a deployment to Preview - journeys-admin April 9, 2026 21:20 Pending
Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (1)
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/MediaScreen/Sections/VideosSection/VideosSection.tsx (1)

79-88: Move the clamp styles to styled() for VideoAdapterNote.

The Line 85–87 change works functionally, but the new custom styles are inline in sx. In this path, custom styling should be defined with styled().

Suggested refactor
+import { styled } from '@mui/material/styles'
 import Typography from '@mui/material/Typography'
 ...
+const ClampedAdapterNote = styled(Typography)({
+  overflow: 'hidden',
+  textOverflow: 'ellipsis',
+  display: '-webkit-box',
+  WebkitLineClamp: 2,
+  WebkitBoxOrient: 'vertical'
+})
+
 function VideoAdapterNote({ note }: VideoAdapterNoteProps): ReactElement {
   return (
-    <Typography
+    <ClampedAdapterNote
       variant="subtitle3"
       color="text.secondary"
-      sx={{
-        overflow: 'hidden',
-        textOverflow: 'ellipsis',
-        display: '-webkit-box',
-        WebkitLineClamp: 2,
-        WebkitBoxOrient: 'vertical'
-      }}
     >
       {note}
-    </Typography>
+    </ClampedAdapterNote>
   )
 }

As per coding guidelines apps/journeys-admin/**/*.tsx: "Use styled() from @mui/material/styles for custom styling instead of Tailwind or other CSS approaches".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/MediaScreen/Sections/VideosSection/VideosSection.tsx`
around lines 79 - 88, The clamp styles currently passed inline via sx on the
Typography should be moved into a styled MUI component: create or update the
VideoAdapterNote styled component (using styled() from `@mui/material/styles`) to
include overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box',
WebkitLineClamp: 2 and WebkitBoxOrient: 'vertical', then replace the inline sx
on the Typography/VideoAdapterNote usage so the Typography still receives
variant="subtitle3" and color="text.secondary" but all custom clamp styles live
inside VideoAdapterNote.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/VideoBlockEditor/VideoBlockEditor.spec.tsx`:
- Around line 686-796: The three new tests in VideoBlockEditor.spec.tsx must use
the project test harness: wrap the component under test with SnackbarProvider →
MockedProvider → ThemeProvider (in that order) and replace the inline
MockedProvider mocks and any direct network mocking with the shared MSW setup
(test/mswServer.ts) and the ApolloLoadingProvider helper; update the render
calls that mount VideoBlockEditor (selectedBlock variable and onChange usage) to
use render(<ApolloLoadingProvider><VideoBlockEditor ...
/></ApolloLoadingProvider>) inside the required wrapper order, remove the mocks
prop from MockedProvider, and ensure network GraphQL fixtures are provided via
MSW handlers instead of MockedProvider so tests conform to apps/journeys-admin
specs.

---

Nitpick comments:
In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/MediaScreen/Sections/VideosSection/VideosSection.tsx`:
- Around line 79-88: The clamp styles currently passed inline via sx on the
Typography should be moved into a styled MUI component: create or update the
VideoAdapterNote styled component (using styled() from `@mui/material/styles`) to
include overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box',
WebkitLineClamp: 2 and WebkitBoxOrient: 'vertical', then replace the inline sx
on the Typography/VideoAdapterNote usage so the Typography still receives
variant="subtitle3" and color="text.secondary" but all custom clamp styles live
inside VideoAdapterNote.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 209b9936-0f8e-480e-9ea1-bf083fd30d32

📥 Commits

Reviewing files that changed from the base of the PR and between 1653c0c and 81d9dac.

📒 Files selected for processing (3)
  • apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/VideoBlockEditor/VideoBlockEditor.spec.tsx
  • apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/VideoBlockEditor/VideoBlockEditor.tsx
  • apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/MediaScreen/Sections/VideosSection/VideosSection.tsx

@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin April 9, 2026 21:26 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys April 9, 2026 21:26 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player April 9, 2026 21:26 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch-modern April 9, 2026 21:26 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources April 9, 2026 21:26 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin April 9, 2026 21:26 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch April 9, 2026 21:26 Inactive
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch-modern ✅ Ready watch-modern preview Fri Apr 10 15:19:14 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
player ✅ Ready player preview Fri Apr 10 15:19:07 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Fri Apr 10 15:19:32 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Fri Apr 10 15:19:36 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Fri Apr 10 15:19:56 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Fri Apr 10 15:19:28 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Fri Apr 10 15:21:44 NZST 2026

@jianwei1
Copy link
Copy Markdown
Contributor Author

jianwei1 commented Apr 9, 2026

Review feedback addressed (d7bd2bf)

Challenged:

  • VideoBlockEditor.spec.tsx:796 (CodeRabbit) — Bot suggests migrating to MSW/ApolloLoadingProvider and reordering providers. This is a false positive: the new tests follow the exact same wrapper pattern as all existing tests in the file. See inline reply.

No code changes needed — all feedback was challenged.

@jianwei1 jianwei1 requested a review from Ur-imazing April 9, 2026 23:36
@github-actions github-actions Bot temporarily deployed to Preview - journeys April 9, 2026 23:38 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin April 9, 2026 23:38 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch-modern April 9, 2026 23:38 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch April 9, 2026 23:38 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin April 9, 2026 23:38 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player April 9, 2026 23:38 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources April 9, 2026 23:38 Inactive
@jianwei1 jianwei1 enabled auto-merge April 10, 2026 03:15
@github-actions github-actions Bot temporarily deployed to Preview - player April 10, 2026 03:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys April 10, 2026 03:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin April 10, 2026 03:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin April 10, 2026 03:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch-modern April 10, 2026 03:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch April 10, 2026 03:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources April 10, 2026 03:17 Inactive
@jianwei1 jianwei1 added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 6b4d6f2 Apr 10, 2026
34 checks passed
@jianwei1 jianwei1 deleted the jianweichong/nes-1445-media-screen-long-template-adapter-notes-get-cropped-in branch April 10, 2026 03:25
tanflem pushed a commit that referenced this pull request Apr 13, 2026
…ter notes (#9000)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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.

2 participants