tududi/frontend
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
..
__tests__ Setup slugify and fix nanoid issues 2025-08-08 23:14:40 +03:00
components Fix project name overflow and add 6-word validation limit (#972) 2026-03-24 17:36:24 +02:00
config Fix static base path (#549) 2025-11-16 22:43:06 +02:00
constants Cleanup statuses (#724) 2025-12-19 11:13:27 +02:00
contexts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
entities Set stalled projects active without tasks (#793) 2026-01-23 23:06:35 +02:00
hooks Add custom keyboard shortcuts (#749) 2025-12-28 21:58:21 +02:00
store Fix tag links by refreshing tags after creation (#843) 2026-02-27 00:34:10 +02:00
styles Fix project name overflow and add 6-word validation limit (#972) 2026-03-24 17:36:24 +02:00
utils Fix Today page task completion issues (#970) 2026-03-24 16:45:31 +02:00
App.tsx Feat: habits (#707) 2025-12-13 08:47:52 +02:00
i18n.ts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
index.tsx Fix static base path (#549) 2025-11-16 22:43:06 +02:00
Layout.tsx Load areas into store (#913) 2026-03-06 08:46:07 +02:00