Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
6.1k stars 2.95k forks source link

Truncate text server side vs client side ? #33083

Open rycks opened 3 months ago

rycks commented 3 months ago

Feature Request

Hello all, dolibarr makes server-side truncate text, for example into commonobject.class.php (showInputField fuction):

if ($translabel != $obj->{$InfoFieldList[1]}) {
  $labeltoshow = dol_trunc($translabel, 18);
} else {
  $labeltoshow = dol_trunc($obj->{$InfoFieldList[1]});
}

but nowdays with 4k screens it make too much missing data for users into auto lists makes from dictionary then this ticket is to make a new idea or a different point of view with client-side truncate data thanks to https://developer.mozilla.org/fr/docs/Web/CSS/text-overflow

text-overflow: ellipsis
eldy commented 3 months ago

Yes, we must avoid truncation on server side except for security purpose (so only very high threshold should be done on server). Small should be done by css.