From fdcc5f0cce309beec494021e9d2beb2cdaac78fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Pacho=C5=82ek?= <3039162+bpacholek@users.noreply.github.com> Date: Tue, 27 Oct 2026 11:27:32 +0000 Subject: [PATCH] List: the id column is six characters wide, wider only when it must be On a list with few columns in a wide card the identifier column took a share of the spare width like any other (recomaty-panel#677): the automatic table layout hands the surplus out in proportion to what each column holds, so a one- to five-digit id got a few hundred pixels of empty space beside it (176px on the demo's category list at 1920px; the panel's Ping and Status lists showed it the most). - base_list_field: the cells of a column that shows the model's identifier (its name is one of the model manager's identifierFieldNames(), `id` on a Doctrine entity, whatever the field's type) carry the new additive hook `adminata-list-field-id`, outside the `field_cell_class` block so a cell template overriding that keeps it. base_list marks the header the same way, `adminata-list-field-header-id`. - components/list.css: both get `width` and `min-width: 6ch` (`content-box`, the padding on top) and `nowrap`. The width makes the column a fixed one, so the surplus goes to the other columns and the table still fills its card; the minimum keeps six characters on a list wider than its card, where every column is squeezed to its smallest. A longer identifier (a UUID, an ObjectId, a ten-digit number) or header label widens the column on one line. - tests-adminata/Visual/list-id-column.spec.js: the column measured in the wide projects of Chromium, Firefox and WebKit: six characters on the category list at 1920px with the table still filling the card, six on the overflowing product list, one line and wider for a ten-digit id and a UUID, the hooks on the header and every cell and nowhere else. Without the CSS the six-character and UUID cases fail (the UUID breaks at a hyphen in Chromium and WebKit). - DemoSmokeTest pins the hooks on the product and tag lists; both join the list group of tests-adminata/Contract/hooks.yaml. - app.css rebuilt; JS fixtures re-dumped (the two new classes); the product, category-autocomplete and tag list baselines regenerated in the Playwright 1.63 image (their id column is six characters now). - CHANGELOG entry under Fixed. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 15 ++ assets/css/components/list.css | 24 +++ src/Resources/public/app.css | 2 +- src/Resources/views/CRUD/base_list.html.twig | 8 +- .../views/CRUD/base_list_field.html.twig | 16 +- tests-adminata/Contract/hooks.yaml | 3 + tests-adminata/Functional/DemoSmokeTest.php | 36 ++++ ...utocomplete-dark-chromium-medium-linux.png | Bin 40968 -> 40956 bytes ...utocomplete-dark-chromium-narrow-linux.png | Bin 33220 -> 32594 bytes ...tocomplete-light-chromium-medium-linux.png | Bin 41107 -> 41101 bytes ...tocomplete-light-chromium-narrow-linux.png | Bin 33576 -> 32957 bytes ...roduct-list-dark-chromium-medium-linux.png | Bin 78719 -> 77542 bytes ...roduct-list-dark-chromium-narrow-linux.png | Bin 30298 -> 29843 bytes .../product-list-dark-chromium-wide-linux.png | Bin 100950 -> 100913 bytes ...oduct-list-light-chromium-medium-linux.png | Bin 77656 -> 76381 bytes ...oduct-list-light-chromium-narrow-linux.png | Bin 30312 -> 29769 bytes ...product-list-light-chromium-wide-linux.png | Bin 99895 -> 99869 bytes .../tag-list-dark-chromium-medium-linux.png | Bin 61369 -> 65909 bytes .../tag-list-dark-chromium-narrow-linux.png | Bin 33441 -> 33089 bytes .../tag-list-dark-chromium-wide-linux.png | Bin 74412 -> 74255 bytes .../tag-list-light-chromium-medium-linux.png | Bin 61002 -> 65550 bytes .../tag-list-light-chromium-narrow-linux.png | Bin 33220 -> 32870 bytes .../tag-list-light-chromium-wide-linux.png | Bin 73897 -> 73818 bytes tests-adminata/Visual/list-id-column.spec.js | 160 ++++++++++++++++++ tests-adminata/fixtures/js/category-list.html | 4 +- tests-adminata/fixtures/js/product-list.html | 52 +++--- 26 files changed, 286 insertions(+), 34 deletions(-) create mode 100644 tests-adminata/Visual/list-id-column.spec.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e95961a99..501da6bf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -723,6 +723,21 @@ mosaic and tree list modes, global search, the tab menu and four dashboard block ### Fixed +- The identifier column of a list took a share of the spare width like any other (2026-10-27): + the automatic table layout hands the surplus out in proportion to what each column holds, so a + list with few columns in a wide card gave its one- to five-digit ids a few hundred pixels of empty + space (176px for the demo's category list at 1920px; recomaty-panel's Ping and Status lists, + among others). The column is now six characters wide, and widens only for an identifier that + needs more: a longer number, a UUID or an ObjectId, kept on one line, or a longer header label. + On a list wider than its card, where every column is squeezed to its smallest, it keeps its six + characters. `base_list_field` marks the cells of a column that shows the model's identifier (a + field named in `identifierFieldNames()`, `id` on a Doctrine entity, whatever its type) with the + new additive hook `adminata-list-field-id`, and `base_list` its header with + `adminata-list-field-header-id`; `components/list.css` gives both `width` and `min-width: 6ch` + (`content-box`, so the padding comes on top) and `nowrap`. Both hooks join the list group of + `tests-adminata/Contract/hooks.yaml`. `tests-adminata/Visual/list-id-column.spec.js` measures the + column in Chromium, Firefox and WebKit, `DemoSmokeTest` pins the hooks, and the product, + category and tag list baselines are regenerated. Reported in recomaty-panel#677. - A multiple select showed what was chosen only while it had focus, in the dark theme (2026-10-26). `.dark .adm-select option` paints every option of a dark select gray-900, and in a list box (`