tududi/backend/models
Chris e80847b01f
Fix project name overflow and add 6-word validation limit (#972)
* Fix project name overflow and add validation

This commit addresses issue #971 by implementing both UI fixes and
validation to prevent excessively long project names.

Changes:
1. Add word-break and line-clamp to ProjectBanner.tsx to handle
   overflow gracefully with line-clamp-3 for names
2. Add frontend validation in ProjectModal.tsx limiting names to
   6 words maximum
3. Add backend validation in project.js model with custom wordCount
   validator
4. Show user-friendly error messages when validation fails

This ensures project names remain concise and UI-friendly while
preventing the extreme overflow cases that were possible before.

Fixes #971

* Add overflow-hidden to make line-clamp work properly

The line-clamp utility requires explicit overflow-hidden to function
correctly. Without it, the text continues to display in full rather
than being truncated with ellipsis.

* Fix line-clamp using inline CSS styles

Tailwind's line-clamp utilities weren't working, so switched to using
inline styles with the standard CSS approach:
- display: -webkit-box
- -webkit-line-clamp: 3
- -webkit-box-orient: vertical

This ensures the text truncation works reliably across browsers.

* Use Tailwind line-clamp utilities (already defined in CSS)

The project already has line-clamp-1/2/3 utilities properly defined
in tailwind.css with all the necessary webkit properties. Simplified
the component to use these existing utilities instead of inline styles.

* Add dedicated CSS classes with !important for line-clamp

Created custom project-name-clamp and project-desc-clamp classes
with !important flags to ensure they override any conflicting styles.
This should finally fix the text truncation issue.

* Use component-scoped styles for line-clamp

Adding inline style tag in the component to ensure the line-clamp
CSS is definitely loaded and applied. This bypasses any potential
issues with external CSS compilation or loading order.

* Change project name line-clamp from 3 to 2 lines

Limiting project name display to 2 lines with ellipsis for better
visual density and cleaner appearance.

* Increase line-height for project name in banner

Added line-height: 1.3 to project name for better readability
and visual spacing between lines.
2026-03-24 17:36:24 +02:00
..
action.js chore(lint): remove unnecessary try/catch and tighten error handling 2025-09-22 15:20:46 +03:00
api_token.js API Access (#495) 2025-11-07 15:19:30 +02:00
area.js Standardize UID implementation across backend 2025-08-06 15:54:45 +03:00
backup.js Feat backups (#686) 2025-12-09 08:00:46 +02:00
calendar_token.js Standardize UID implementation across backend 2025-08-06 15:54:45 +03:00
inbox_item.js Feat add inbox flow (#676) 2025-12-08 09:21:35 +02:00
index.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
note.js Notes page revamp! (#487) 2025-11-06 17:59:30 +02:00
notification.js Fix Telegram notification spam by marking JSON field as changed (#969) 2026-03-24 14:30:31 +02:00
permission.js chore(lint): remove unnecessary try/catch and tighten error handling 2025-09-22 15:20:46 +03:00
project.js Fix project name overflow and add 6-word validation limit (#972) 2026-03-24 17:36:24 +02:00
recurringCompletion.js Fix recurring structure (#646) 2025-12-04 13:29:37 +02:00
role.js chore(lint): remove unnecessary try/catch and tighten error handling 2025-09-22 15:20:46 +03:00
setting.js Scaffold smtp service (#590) 2025-11-24 17:58:09 +02:00
tag.js Fix tags deletion (#447) 2025-10-23 23:28:56 +03:00
task.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
task_attachment.js Add file attacmhments 2025-12-07 14:12:38 +02:00
task_event.js Fix bump issues (#651) 2025-12-04 18:19:40 +02:00
user.js Fix isEmail validation failure on valid emails during Docker setup (#835) 2026-02-11 15:42:11 +02:00
view.js Reorder elements (#687) 2025-12-09 10:51:51 +02:00