Skip to content

[HIGH PRIO] Fix VRT typography diff and wrong references - #9916

Merged
weronikaolejniczak merged 13 commits into
elastic:mainfrom
weronikaolejniczak:fix/storybook-local-fonts-vrt
Aug 18, 2026
Merged

weronikaolejniczak merged 13 commits into
elastic:mainfrom
weronikaolejniczak:fix/storybook-local-fonts-vrt

Conversation

@weronikaolejniczak

@weronikaolejniczak weronikaolejniczak commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Note

This doesn't affect EUI production. Only local dev and CI.

Summary

  • Updated Storybook to use local fonts instead of Google-served ones that cause a race condition and make unexpected font diff (screenshot is made before font face is fetched and applied). With Loki, we reported similar visual diff and wanted to use local fonts as well (see https://github.com/elastic/eui-private/issues/194).
  • Added a column to the visual diff for percentage (reported by the job already but it's good to have handy in the table to be able to quickly judge the visual impact).
  • Updated the comment format, linking to our VRT wiki and instructing to go through the visual diff: approve if expected, re-run or fix if unexpected.
  • Changed the "Update VRT baselines" job to simply copy the "After" screenshots to the reference folder. No re-running the test runner and potentially pulling in flakes which then involves reverting commit.
  • Updated malformed VRT references after they were introduced to main by [Flyout Menu] Minor visual improvements #9887.

QA

QA instructions for reviewer

  • There's no visual diff reported on this PR,
  • the VRT comment is clear and not too noisy,
  • the "Update VRT baselines" job only copies the "After" to reference folder (commit),
  • the updated references are expected,
  • the percentage in the visual diff is displayed correctly,
  • there's no diff between prod font and Storybook font,
  • there's no flakiness:

@weronikaolejniczak weronikaolejniczak added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Aug 14, 2026
@weronikaolejniczak weronikaolejniczak changed the title Fix VRT typography diff and wrong references [HIGH PRIO] Fix VRT typography diff and wrong references Aug 14, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
44 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euiicon (2 differences)

StoryDiff %BeforeAfterDiff
all icons desktop 11.19%
all icons mobile n/a

euicombobox (9 differences)

StoryDiff %BeforeAfterDiff
custom matcher desktop 17.33%
custom truncation desktop 0.17%
default truncation desktop 0.22%
groups desktop 0.12%
icons and many options selected desktop 5.74%
nested options groups desktop 0.12%
playground desktop 0.71%
row height auto desktop 0.73%
with tooltip desktop 0.17%

euiform (1 difference)

StoryDiff %BeforeAfterDiff
playground mobile 1.55%

euiinlineedittext (2 differences)

StoryDiff %BeforeAfterDiff
edit mode mobile 3.20%
playground mobile 3.60%

euiflexgrid (1 difference)

StoryDiff %BeforeAfterDiff
playground desktop 0.34%

euiflyout (14 differences)

StoryDiff %BeforeAfterDiff
playground desktop 0.13%
playground mobile 0.48%
playground desktop 0.13%
playground mobile 0.50%
playground desktop 0.13%
playground mobile 0.50%
playground desktop 0.13%
playground mobile 0.55%
pagination example desktop 0.13%
pagination example mobile 0.48%
playground desktop 0.13%
playground mobile 0.48%
playground desktop 0.14%
playground mobile 0.50%

euiheader (4 differences)

StoryDiff %BeforeAfterDiff
elastic navigation pattern desktop 0.12%
elastic navigation pattern mobile 0.44%
multiple fixed headers mobile <0.01%
popover example mobile 0.26%

euicollapsiblenav (4 differences)

StoryDiff %BeforeAfterDiff
full header pattern desktop <0.01%
full header pattern mobile 0.01%
playground desktop 0.14%
playground mobile 0.51%

euicontextmenu (1 difference)

StoryDiff %BeforeAfterDiff
playground desktop 1.04%

euikeypadmenu (1 difference)

StoryDiff %BeforeAfterDiff
playground mobile 2.79%

euidatagrid (4 differences)

StoryDiff %BeforeAfterDiff
full screen with flyout mobile 0.04%
column selector desktop 0.10%
column selector mobile 0.08%
toolbar visibility options desktop 6.39%

euitable (1 difference)

StoryDiff %BeforeAfterDiff
playground mobile 6.52%

@weronikaolejniczak
weronikaolejniczak force-pushed the fix/storybook-local-fonts-vrt branch 2 times, most recently from 576d77b to 254c750 Compare August 14, 2026 10:34
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (2 differences)

StoryDiff %BeforeAfterDiff
full screen with header mobile 0.70%
no toolbar desktop 6.39%

@mgadewoll mgadewoll mentioned this pull request Aug 14, 2026
4 of 19 tasks
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
6 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (6 differences)

StoryDiff %BeforeAfterDiff
cell expansion popover desktop 0.26%
cell expansion popover mobile 1.02%
full screen with header mobile 0.70%
column selector mobile 15.66%
keyboard shortcuts desktop 2.00%
no toolbar desktop 6.39%

@weronikaolejniczak
weronikaolejniczak force-pushed the fix/storybook-local-fonts-vrt branch from f8ad34f to bfdfd1f Compare August 14, 2026 12:52
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
3 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (3 differences)

StoryDiff %BeforeAfterDiff
full screen with header mobile 0.70%
column selector mobile 0.08%
no toolbar desktop 6.39%

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (2 differences)

StoryDiff %BeforeAfterDiff
compact desktop <0.01%
column selector mobile 15.65%

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
3 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (3 differences)

StoryDiff %BeforeAfterDiff
visible columns mobile 8.78%
column selector mobile 15.65%
keyboard shortcuts desktop 2.00%

@weronikaolejniczak
weronikaolejniczak requested a balanced review from Copilot August 18, 2026 09:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 56 changed files in this pull request and generated no new comments.

Suppressed comments (5)

packages/eui/src/components/datagrid/controls/data_grid_toolbar.stories.tsx:305

  • Same issue as above: this wait is tied to the column sorting button but the story is exercising the column selector. Waiting for the column selector button makes the step more robust to future UI changes.
    packages/eui/.storybook/test-runner.ts:77
  • The comment has a grammatical error (“page is layout”) which makes the intent unclear.
/**
 * Ensure the page is layout has stabilized before taking a screenshot.
 */

packages/eui/src/components/datagrid/controls/full_screen_selector.stories.tsx:69

  • This uses a strict equality check between getBoundingClientRect().width (a float that can include subpixel values) and window.innerWidth (an integer), which is prone to VRT flakiness. Use a tolerant comparison instead.
    wiki/contributing-to-eui/testing/visual-regression-testing.md:190
  • This sentence is a bit hard to read due to the colon/run-on structure. Rephrasing improves clarity for contributors.
    packages/eui/src/components/datagrid/controls/data_grid_toolbar.stories.tsx:292
  • The pre-wait is checking visibility of the column sorting button, but the interaction that follows clicks the column selector button. Waiting on the same element you interact with avoids unrelated failures if toolbar controls change.

This issue also appears on line 301 of the same file.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

📷 2 visual difference(s) found

Look at the visual diff below. If everything is expected, run Approve visual changes to update baselines, re-run the job or make appropriate fixes.

See the visual regression testing wiki for more information.

Expand to review

euidatagrid (2 differences)

StoryDiff %BeforeAfterDiff
visible columns desktop 2.53%
keyboard shortcuts desktop 2.00%

@weronikaolejniczak
weronikaolejniczak force-pushed the fix/storybook-local-fonts-vrt branch from a49c072 to 74098e9 Compare August 18, 2026 11:20
@weronikaolejniczak
weronikaolejniczak requested a lite review from Copilot August 18, 2026 11:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 reached their quota limit.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

📷 1 visual difference(s) found

Look at the visual diff below. If everything is expected, run Approve visual changes to update baselines, re-run the job or make appropriate fixes.

See the visual regression testing wiki for more information.

Expand to review

euidatagrid (1 difference)

StoryDiff %BeforeAfterDiff
keyboard shortcuts desktop 2.00%

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

📷 1 visual difference(s) found

Look at the visual diff below. If everything is expected, run Approve visual changes to update baselines, re-run the job or make appropriate fixes.

See the visual regression testing wiki for more information.

Expand to review

euidatagrid (1 difference)

StoryDiff %BeforeAfterDiff
keyboard shortcuts desktop 2.00%

@weronikaolejniczak
weronikaolejniczak marked this pull request as ready for review August 18, 2026 12:59
@weronikaolejniczak
weronikaolejniczak requested a review from a team as a code owner August 18, 2026 12:59
Comment thread packages/eui/.storybook/test-runner.ts Resolved
local filename="$1"
local percentage

percentage=$(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❓ Could this fail if there is no percentage found? if so, should we handle it?

@weronikaolejniczak weronikaolejniczak Aug 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not really because we're grepping but not throwing if we don't find the pattern 🤔 we fallback to n/a (you can see one here; btw just realized it could be worth skipping this for mobile).

@mgadewoll mgadewoll left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 The changes are LGTM. Thanks for fixing it!
Let's see if CI runs smoothly and if so we can merge 🙏

@weronikaolejniczak

Copy link
Copy Markdown
Contributor Author

buildkite test this

@weronikaolejniczak
weronikaolejniczak enabled auto-merge (squash) August 18, 2026 14:23
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@weronikaolejniczak
weronikaolejniczak merged commit a287851 into elastic:main Aug 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants