From b2231a5a47b39443f2e3a9a49fb3ec9eb7dd4399 Mon Sep 17 00:00:00 2001 From: "Zimin A.N." Date: Mon, 11 May 2026 23:43:38 +0300 Subject: [PATCH] =?UTF-8?q?fix(form):=20FK=20select=20label=20overflow=20?= =?UTF-8?q?=E2=80=94=20truncate=20+=20ellipsis=20(=D0=BD=D0=B0=D0=B5=D0=B7?= =?UTF-8?q?=D0=B6=D0=B0=D1=8E=D1=82=20on=20chevron)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Native ` trigger перекрывается chevron'ом (см. screenshot + * 2026-05-11 'наезжают'). Полный display name остаётся в hint поля. */ +const MAX_FK_LABEL_CHARS = 28 + const buildOption = ( record: FlattenedRecord, refField: string | undefined, @@ -1018,8 +1026,14 @@ const buildOption = ( const nameField = record.data?.['name'] const display = pickLocalized(nameField, defaultLocale) - const label = display ? `${idStr} — ${display}` : idStr - return { id: idStr, label } + if (!display) return { id: idStr, label: idStr } + + const combined = `${idStr} — ${display}` + if (combined.length <= MAX_FK_LABEL_CHARS) return { id: idStr, label: combined } + // Truncate display, keep code intact (код — primary identifier). + const allowedDisplayLen = Math.max(4, MAX_FK_LABEL_CHARS - idStr.length - 4) // ' — ' + '…' + const truncated = `${display.slice(0, allowedDisplayLen).trimEnd()}…` + return { id: idStr, label: `${idStr} — ${truncated}` } } const countErrorsPerTab = (