Skip to content

feat(videos-admin): add 60-char limit and counter to video title field#9214

Open
tanflem wants to merge 3 commits into
mainfrom
tannerfleming/qa-394-add-character-count-limit-for-titles
Open

feat(videos-admin): add 60-char limit and counter to video title field#9214
tanflem wants to merge 3 commits into
mainfrom
tannerfleming/qa-394-add-character-count-limit-for-titles

Conversation

@tanflem
Copy link
Copy Markdown
Contributor

@tanflem tanflem commented May 14, 2026

Summary by CodeRabbit

  • New Features

    • Title field now enforces a 60-character maximum and shows a live character counter as helper text.
    • Validation error message displays when the title exceeds the limit.
  • Tests

    • Added tests verifying the live counter updates and that validation errors appear for over-limit titles.

Review Change Stack

@linear
Copy link
Copy Markdown

linear Bot commented May 14, 2026

QA-394

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Walkthrough

Adds a 60-character maximum to the video title: Yup schema max(60) with error message, TextField enforces maxLength: 60 and shows either the validation error or a live current/60 counter, plus two tests verifying counter and validation behavior.

Changes

Title Character Limit Feature

Layer / File(s) Summary
Yup title schema (max 60)
apps/videos-admin/src/app/(dashboard)/videos/[videoId]/_VideoInformation/VideoInformation.tsx
The Yup title schema includes max(60, "Title must be 60 characters or less") alongside trim and required validation.
TextField UI enforcement and tests
apps/videos-admin/src/app/(dashboard)/videos/[videoId]/_VideoInformation/VideoInformation.tsx, apps/videos-admin/src/app/(dashboard)/videos/[videoId]/_VideoInformation/VideoInformation.spec.tsx
The title TextField sets inputProps.maxLength=60 and helperText shows either the validation error or a live values.title.length/60 counter. Two tests verify the counter updates on input change and that the validation error appears (and the over-limit counter does not) when the title exceeds 60 characters.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a 60-character limit and counter to the video title field, which is the primary focus of the changeset.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ 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 tannerfleming/qa-394-add-character-count-limit-for-titles

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 May 14, 2026

View your CI Pipeline Execution ↗ for commit f7df345

Command Status Duration Result
nx run videos-admin-e2e:e2e ✅ Succeeded 4s View ↗
nx run-many --target=vercel-alias --projects=vi... ✅ Succeeded 1s View ↗
nx run-many --target=upload-sourcemaps --projec... ✅ Succeeded 6s View ↗
nx run-many --target=deploy --projects=videos-a... ✅ Succeeded 52s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-21 18:49:55 UTC

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 14, 2026

View your CI Pipeline Execution ↗ for commit c54df64

Command Status Duration Result
nx run videos-admin-e2e:e2e ✅ Succeeded 6s View ↗
nx run-many --target=vercel-alias --projects=vi... ✅ Succeeded 2s View ↗
nx run-many --target=upload-sourcemaps --projec... ✅ Succeeded 7s View ↗
nx run-many --target=deploy --projects=videos-a... ✅ Succeeded 59s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-14 17:28:24 UTC

@github-actions github-actions Bot temporarily deployed to Preview - videos-admin May 14, 2026 17:11 Inactive
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

🤖 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
`@apps/videos-admin/src/app/`(dashboard)/videos/[videoId]/_VideoInformation/VideoInformation.spec.tsx:
- Around line 399-410: The test currently simulates typing past the UI cap by
changing titleInput to a 61-char string, but the component uses maxLength={60}
so that user action can't produce this; update the spec to exercise a
user-reachable over-limit scenario instead: render the component (or the form
field wrapper) with an initial/server-provided title exceeding 60 characters or
mock the validation/schema error path so the field shows "Title must be 60
characters or less" and verify the counter is hidden; look for references to
titleInput, the Title field render, and any props like
defaultValue/initialValues or validation handlers in VideoInformation (or its
form wrapper) to inject the over-limit value or validation error.
🪄 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: a56a740e-993b-4abf-99f7-86c36a98e009

📥 Commits

Reviewing files that changed from the base of the PR and between e0ffd51 and c54df64.

📒 Files selected for processing (2)
  • apps/videos-admin/src/app/(dashboard)/videos/[videoId]/_VideoInformation/VideoInformation.spec.tsx
  • apps/videos-admin/src/app/(dashboard)/videos/[videoId]/_VideoInformation/VideoInformation.tsx

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Fri May 22 06:47:27 NZST 2026

@github-actions github-actions Bot temporarily deployed to Preview - videos-admin May 14, 2026 17:17 Inactive
@tanflem tanflem self-assigned this May 14, 2026
@tanflem tanflem requested a review from Kneesal May 14, 2026 17:20
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin May 21, 2026 18:45 Inactive
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