Skip to content

Conversation

@19AnastasiaTsareva20
Copy link

@19AnastasiaTsareva20 19AnastasiaTsareva20 commented Apr 18, 2025

Fix for issue #477

Problem Description
After further investigating issue #477 with displaying long text in user profiles, I discovered that the problem cannot be fully solved by simply adding field validation. Even with validation, long text can still distort the UI due to CSS and HTML limitations for disabled input fields.

Proposed Solution
Instead of limiting text length through validation (which restricts users), I developed a CSS solution that improves the display of any text regardless of its length:

  1. Added special div containers for displaying text in view mode
  2. Preserved original input/textarea fields for edit mode
  3. Applied CSS styles for proper line wrapping and long text display
  4. For standard fields, line wrapping is used; for the "About me" field, scrolling with a max height of 200px is implemented

Changes
Modified views/module/user/profile.pug to use div containers in view mode

klimashkin
klimashkin previously approved these changes Apr 18, 2025
Copy link
Member

@kabalin kabalin left a comment

Choose a reason for hiding this comment

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

Hi, thanks for PR, it is a good start! The real name strings actually exist already in the schema. But adding validation is not sufficient, validation output needs to be passed to client and displayed as error when saving the form.

Please include the screenshot how the error looks like in the UI.

models/User.js Outdated
lastName: { type: String },
disp: { type: String }, // Display name

realName: {
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need a new field?

@klimashkin klimashkin dismissed their stale review April 18, 2025 17:04

Need to rereview

@19AnastasiaTsareva20
Copy link
Author

19AnastasiaTsareva20 commented May 5, 2025

I have made some changes to this update request using a different approach to solving the problem.
I would appreciate it if you have a free minute to check. Thanks!

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.

3 participants