Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2555f6c
feat: migrate LinkControl's preview title to use Link component
yashjawale Oct 15, 2026
2b7354e
Merge branch 'trunk' into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 15, 2026
507cac6
Merge branch 'trunk' into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 15, 2026
0247ea4
fix: add openInNewTab prop
yashjawale Oct 15, 2026
0ec0a23
Merge branch 'feat/migrate-wordpress-ui-link-preview' of https://gith…
yashjawale Oct 15, 2026
70bd579
test: only go one level above for the title class instead of two
yashjawale Oct 15, 2026
9d175f7
Merge branch 'trunk' into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 15, 2026
413daf1
test: update e2e test find the new-tab icon
yashjawale Oct 15, 2026
32b3123
Merge branch 'trunk' into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 15, 2026
71826fa
Merge branch 'trunk' into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 15, 2026
91bdf40
Merge branch 'trunk' into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 15, 2026
6b356a1
Merge branch 'trunk' into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 16, 2026
d264917
fix: hide external link icon
yashjawale Oct 16, 2026
9645e70
fix: add guard for fragment links
yashjawale Oct 16, 2026
5d886d6
Merge remote-tracking branch 'upstream/trunk' into feat/migrate-wordp…
yashjawale Oct 16, 2026
93529f1
chore: merge trunk into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 19, 2026
9f463c2
Merge branch 'trunk' into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 19, 2026
72e577c
fix: show external link icon & apply flex on wrapper
yashjawale Oct 19, 2026
27749bd
fix: remove redundant width rule
yashjawale Oct 19, 2026
70233bf
Merge branch 'trunk' into feat/migrate-wordpress-ui-link-preview
yashjawale Oct 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import clsx from 'clsx';
import { __ } from '@wordpress/i18n';
import {
Button,
ExternalLink,
__experimentalTruncate as Truncate,
__experimentalHStack as HStack,
Flex,
Expand All @@ -21,7 +20,7 @@ import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
import { useDispatch, useSelect } from '@wordpress/data';
import { store as noticesStore } from '@wordpress/notices';
import { store as preferencesStore } from '@wordpress/preferences';
import { Badge } from '@wordpress/ui';
import { Badge, Link } from '@wordpress/ui';
import { ViewerSlot } from './viewer-slot';
import useRichUrlData from './use-rich-url-data';

Expand Down Expand Up @@ -128,14 +127,15 @@ export default function LinkPreview( {
>
{ ! isEmptyURL ? (
<>
<ExternalLink
<Link
className="block-editor-link-control__preview-title"
href={ value.url }
openInNewTab
>
<Truncate numberOfLines={ 1 }>
{ displayTitle }
</Truncate>
</ExternalLink>
</Link>
<span className="block-editor-link-control__preview-info">
<Truncate numberOfLines={ 1 }>
{ displayURL }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ describe( 'Rich link previews', () => {
const titlePreview = screen.getByText( selectedLink.title );

// eslint-disable-next-line testing-library/no-node-access
expect( titlePreview.parentElement.parentElement ).toHaveClass(
expect( titlePreview.parentElement ).toHaveClass(
'block-editor-link-control__preview-title'
);
} );
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/various/pattern-overrides.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ test.describe( 'Pattern Overrides', () => {
await button.focus();
await pageUtils.pressKeys( 'primary+k' );
await expect(
page.getByRole( 'link', { name: 'wp.org' } ).getByText( '↗' )
page.getByRole( 'link', { name: 'wp.org' } ).getByRole( 'img' )
).toHaveAttribute( 'aria-label', '(opens in a new tab)' );

// The link popup doesn't have a role which is a bit unfortunate.
Expand Down
2 changes: 1 addition & 1 deletion tools/eslint/suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@
},
"packages/block-editor/src/components/link-control/link-preview.jsx": {
"@wordpress/use-recommended-components": {
"count": 3
"count": 2
},
"react/jsx-filename-extension": {
"count": 1
Expand Down
Loading