Skip to content

fix: pad the record column and show the entity icon for a record without an image - #292

Merged
ManukMinasyan merged 1 commit into
3.xfrom
fix/record-column-padding-and-icon
Nov 7, 2026
Merged

ManukMinasyan merged 1 commit into
3.xfrom
fix/record-column-padding-and-icon

Conversation

@ManukMinasyan

Copy link
Copy Markdown
Member

A record-type field now lines up with every other column in a table, and a linked record with no image shows its entity's icon instead of a bare name. Before, the record column's value sat 4px left of the cell edge with no padding. A company without a logo, or a person without a photo, showed only an underlined name, in the table and in the record picker.

What changed

  • resources/views/tables/columns/record-column.blade.php: the wrapper gets fi-ta-text, the class that gives a Filament cell its padding. Commit fc47c40 (2026-02-15) added it to the email, link and phone columns and missed this one.
  • RecordColumn::formatRecord() adds an icon key. It holds the entity icon when the entity has an avatar configuration and this record's image is blank.
  • The six identical avatar blocks in the record column now share tables/columns/partials/record-avatar.blade.php. It draws the image, or else a 20px tile with a 12px entity icon in the avatar's shape.
  • RecordSelectInputComponent::getFallbackIcon() returns the entity icon when the entity has an avatar configuration. forms/record-select-input.blade.php draws the same tile in its three avatar spots: the selected value, the pills, and the options.

Why this way

The icon shows only for entities that configure an avatar attribute, meaning entities that can have an image at all. An entity with no avatar configuration (notes, tasks) keeps its rows as they were, with no icon nobody asked for. The tile's classes match the gray tile used elsewhere for a missing image, so a missing logo and a real one sit at the same size and alignment.

Behavior to know about

  • Visual change for every consumer whose entities configure an avatar: records without an image gain an icon tile.
  • The entity icon comes from EntityConfigurationData::getIcon(), which falls back to the resource's navigation icon.
  • No migration, no config key, no new dependency. The tile uses Tailwind classes, so a consumer's theme must list the package views as a source, as it already must for the existing column views.

Tests

  • tests/Feature/Integration/Resources/Pages/ListRecordsTest.php, "Record column avatars": a linked record with an image renders the image once, one without renders one icon tile, and an entity with no avatar configuration renders no tile.
  • tests/Feature/Filament/Components/RecordSelectSearchTest.php: the picker offers the icon tile with an avatar configuration and none without.
  • Fixture changes: the posts table gains a nullable cover_url, and registerLookupEntity() in tests/Helpers.php takes an optional avatar attribute and icon.

Checked

  • Both test files pass, 39 tests. The new tests fail with the fallback removed.
  • Pint, PHPStan and Rector are clean.
  • Rendered in a host app (Relaticle) in WebKit and Chromium, light and dark. The record cell starts 12px in, like the text cells. A company without a logo shows the building tile, one with a logo shows the logo, and people show the person tile in the picker.

Not checked

The full suite runs in CI on this PR.

Copilot AI balanced review requested due to automatic review settings November 7, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@ManukMinasyan
ManukMinasyan added this pull request to the merge queue Nov 7, 2026
Merged via the queue into 3.x with commit a9b3a18 Nov 7, 2026
7 checks passed
@ManukMinasyan
ManukMinasyan deleted the fix/record-column-padding-and-icon branch November 7, 2026 17:15
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.

2 participants