Repository navigation
List: the id column is six characters wide, wider only when it must be - #28
Merged
Merged
Conversation
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 <noreply@anthropic.com>
bpacholek
marked this pull request as ready for review
October 27, 2026 16:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
On a list with few columns in a wide card, the identifier column took a share of the spare width like every other column. 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 for the demo's category list at 1920px. In recomaty-panel it shows on most lists, the Ping and Status lists the most (reported in recomaty/recomaty-panel#677). @bpacholek asked for the column to assume six characters and widen only when an identifier needs more, and thought the fix belongs in adminata rather than in the panel.
fdcc5f0ccMarkup (additive hooks):CRUD/base_list_field.html.twig: the<td>of a column that shows the model's identifier gets the classadminata-list-field-id. "Shows the identifier" means the field's name is one ofadmin.modelManager.identifierFieldNames(admin.class)(idon a Doctrine entity), whatever the field's type (integer,identifier,string...). The class sits outside thefield_cell_classblock, so a cell template overriding that block keeps it. The envelope's comment says this is now the one difference from upstream's<td>.CRUD/base_list.html.twig: the header of that column getsadminata-list-field-header-id. The identifier names are read once per table, intable_header.listgroup oftests-adminata/Contract/hooks.yaml.components/list.css: a new rule beside the batch/select/actions one:.adm-table th.adminata-list-field-header-id, .adm-table td.adminata-list-field-id { box-sizing: content-box; width: 6ch; min-width: 6ch; white-space: nowrap; }widthmakes the column a fixed one. The automatic layout gives the surplus to the columns without a width first, so the table still fills its card and the id column keeps six characters.widthonly raises a column's largest size. On a list wider than its card every column is squeezed to its smallest, andmin-widthkeeps six characters there too. Chromium, Firefox and WebKit all honourmin-widthon cells.nowrapkeeps it on one line: without it a UUID broke at a hyphen in Chromium and WebKit.content-box: the six characters are the text's, and the cell padding comes on top.chis a "0" in the cell's own font (the header's 12pxchis smaller than the body's 14px one, so the body cells set the width).app.cssis rebuilt (one rule). Safelist,contract.jsonand the controllers snapshot are unchanged.tests-adminata/Visual/list-id-column.spec.js(new) runs in the wide projects of Chromium, Firefox and WebKit. On the category list at 1920x1080, the id cell's content box equals6chand the table still fills its scroll box. On the product list (wider than its card), the content box is still6ch. With a ten-digit id and with a UUID written into the cells, the column is wider than6ch, fits the text and keeps it on one line. On the product list, the hooks are on exactly one header and on every row'sintegerid cell.app.css, the six-character cases fail in all three engines: on the category list at 1920 the id column was 176px wide, and on the product list its content box was 29px. The UUID case fails in Chromium and WebKit.DemoSmokeTest::testTheIdentifierColumnIsMarked: the hooks on the product and tag lists. On the tag list (no batch column) they are on the first column.make js-fixtures); only the two classes changed. 16 screenshot baselines were regenerated inmcr.microsoft.com/playwright:v1.63.0-noble: product-list, category-list-autocomplete (narrow and medium) and tag-list, in both themes. They differ only in the id column: six characters wide now, narrower than before on wide cards and wider than the bare "Id" on narrow ones.[Unreleased]→### Fixed: one entry.Contract
adminata-*hooks, no template, block, registry key, config node or service id removed or renamed. By CONTRIBUTING's table that is a minor release, because the markup gains hooks.make check-names: clean.Gates (local)
npm run build: onlysrc/Resources/public/app.csschanges.css:layers, Prettier, ESLint,check:jquery,fixture,css:contract,size: OK. Vitest: 281 passed.composer validate/normalize,lint:container,lint:twig,lint:xliff,lint:yaml,check-names: OK.hooks.yaml, whichlint:yamlparses).tests/Twiggives the same counts before and after the change (596 tests).main's own "Quality assurance" run ata132baeaffails too.list-id-column.spec.js: 15 passed (5 tests × 3 engines).dashboard.spec.js: before the baselines were regenerated, exactly the 16 list screenshots above failed. The same 18 tests pass onmain's templates.npx playwright test, all 9 projects, 30 min on this machine): 1360 passed, 104 skipped, 0 failed.CI (
fdcc5f0)main's latest Quality assurance run ata132baeaf. The error lists are identical.main.Worth knowing
admin.modelManager.identifierFieldNames(admin.class)andfield_description.name. A real admin and a real field description always have both. An application test that renders the envelope with strict Twig and hand-written doubles has to give its doubles those three members. recomaty-panel had one such test (its PR adds them); this repository'stests/Twigmocks return stubs, so its expected HTML is unchanged.Part of recomaty/recomaty-panel#677. The panel's draft PR, recomaty/recomaty-panel#679, moves its
composer.lockto this branch's commitfdcc5f0, so the change can be seen there before this one is merged. After the merge, the panel's lock moves to the merge commit.Bober's change for recomaty/recomaty-panel#677, made at Bartosz's request.
🦫 ~Bober