CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 16:50:36 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/WordPress/gutenberg.git
etag: W/"ab59e75649b659c9bddb8b62b9a2b10b"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=%2B23Tmo9L9ahOq4HF1XzQXGHRS76pampAGXnmh8V3NFECE3Cqk3uLu0BjusenoulC0cLgsm9h693CO%2BGnLUe6PKGwA0WrYViBNYuG6qX1h14IbP0iQhk38uFY6szcFYFvOFNW3JsqWv4xK3mU4lVikBXYcC%2BM31tAKtRxVYDolVzx8TB4j3pFoHF7I%2FTovbAMLDr%2FueK4epRs%2FHim0LwR5W1NVn6Aa6hscP33seFJxyAr3bwVJ8uGJ3LLKcBMLldtAVy1q5BjLiuyWkbRNIBxLg%3D%3D--wHO%2Bys2R7y%2B7SOFt--7wm4buqVImXiW8WG7P25uQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.580632832.1760201435; Path=/; Domain=github.com; Expires=Sun, 11 Oct 2026 16:50:35 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 11 Oct 2026 16:50:35 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: AA1C:2994BB:88DE73:B3EF7D:68EA8ADB
Clean up LinkUI duplication for Add block and Create page flows (#71499) · WordPress/gutenberg@dbe2a39 · GitHub
Copy file name to clipboard
Copy file name to clipboard
Copy file name to clipboardExpand all lines: packages/block-library/src/navigation-link/link-ui.js
Copy file name to clipboardExpand all lines: packages/block-library/src/navigation-link/page-creator.js
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit dbe2a39
authored
Clean up LinkUI duplication for Add block and Create page flows (#71499)
* refactor: extract shared BackButton component from LinkUI
- Create shared BackButton component to eliminate duplication
- Replace duplicated back button implementations in LinkUIBlockInserter and LinkUIPageCreator
- Standardize back button behavior and styling across components
- Remove unused chevron icon imports from page-creator.js
- Add proper JSDoc documentation for BackButton component
Co-authored-by: getdave <get_dave@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
This is the first phase of LinkUI duplication cleanup as discussed in PR #71163 follow-ups.
* refactor: extract useDialogIds hook for dialog accessibility IDs
- Create useDialogIds hook to eliminate duplicated useInstanceId calls
- Replace duplicated accessibility ID generation in LinkUIBlockInserter and UnforwardedLinkUI
- Maintain correct component parameters (LinkControl vs LinkUI) for proper ID generation
- Standardize dialog accessibility ID pattern across components
- Export hook for potential reuse in other components
This is the second phase of LinkUI duplication cleanup as discussed in PR #71163 follow-ups.
* refactor: create DialogWrapper component with minimal API
- Create shared DialogWrapper component that handles all dialog concerns internally
- Eliminate useDialogIds hook by inlining useInstanceId calls directly in DialogWrapper
- Derive component, componentName, and backButtonClassName from className prop
- Move useFocusOnMount logic inside DialogWrapper for complete encapsulation
- Replace duplicated dialog structures in LinkUIBlockInserter and LinkUIPageCreator
- Fix useDialogIds reference error in main LinkUI component
- Maintain all existing CSS styling and accessibility features
- Fix nested ternary linting error with if/else statements
This completes the major refactoring of LinkUI duplication cleanup as discussed in PR #71163 follow-ups.
* refactor: extract LinkUIBlockInserter to separate file and consolidate BackButton
- Extract LinkUIBlockInserter component to block-inserter.js for consistency with page-creator.js
- Consolidate BackButton component into dialog-wrapper.js since it's only used there
- Fix import issues with privateApis in block-inserter.js
- Remove separate back-button.js file to reduce file count
- Clean up unused imports in link-ui.js after component extraction
- Fix JSDoc alignment in block-inserter.js
- Maintain all existing functionality while improving file organization
This completes the component extraction phase of the LinkUI duplication cleanup.
* refactor: simplify DialogWrapper instance ID generation
Use DialogWrapper as the component for useInstanceId instead of deriving
it from className. This removes unnecessary complexity and unused imports.
* Standardise ID generation in Dialog1 parent 3ac2fe5 commit dbe2a39Copy full SHA for dbe2a39
File tree
Expand file treeCollapse file tree
4 files changed
+161
-107
lines changedFilter options
- packages/block-library/src/navigation-link
Expand file treeCollapse file tree
4 files changed
+161
-107
lines changedCollapse file: packages/block-library/src/navigation-link/block-inserter.js
packages/block-library/src/navigation-link/block-inserter.js
Copy file name to clipboard+65Lines changed: 65 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + |
Collapse file: packages/block-library/src/navigation-link/dialog-wrapper.js
packages/block-library/src/navigation-link/dialog-wrapper.js
Copy file name to clipboard+74Lines changed: 74 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + |
Collapse file: packages/block-library/src/navigation-link/link-ui.js
packages/block-library/src/navigation-link/link-ui.js
Copy file name to clipboardExpand all lines: packages/block-library/src/navigation-link/link-ui.js+9-87Lines changed: 9 additions & 87 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
12 |
| - | |
13 |
| - | |
14 |
| - | |
15 |
| - | |
16 |
| - | |
17 |
| - | |
| 11 | + | |
| 12 | + | |
18 | 13 |
| |
19 | 14 |
| |
20 | 15 |
| |
| |||
23 | 18 |
| |
24 | 19 |
| |
25 | 20 |
| |
26 |
| - | |
27 |
| - | |
28 |
| - | |
| 21 | + | |
| 22 | + | |
29 | 23 |
| |
30 | 24 |
| |
31 | 25 |
| |
32 | 26 |
| |
33 |
| - | |
34 | 27 |
| |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 |
| - | |
| 28 | + | |
39 | 29 |
| |
40 | 30 |
| |
41 | 31 |
| |
| |||
75 | 65 |
| |
76 | 66 |
| |
77 | 67 |
| |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 |
| - | |
92 |
| - | |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
111 |
| - | |
112 |
| - | |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
125 |
| - | |
126 |
| - | |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
133 |
| - | |
134 |
| - | |
135 |
| - | |
136 |
| - | |
137 |
| - | |
138 |
| - | |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 | 68 |
| |
147 | 69 |
| |
148 | 70 |
| |
| |||
151 | 73 |
| |
152 | 74 |
| |
153 | 75 |
| |
154 |
| - | |
| 76 | + | |
155 | 77 |
| |
156 | 78 |
| |
157 | 79 |
| |
| |||
176 | 98 |
| |
177 | 99 |
| |
178 | 100 |
| |
179 |
| - | |
| 101 | + | |
180 | 102 |
| |
181 | 103 |
| |
182 | 104 |
| |
183 |
| - | |
| 105 | + | |
184 | 106 |
| |
185 | 107 |
| |
186 | 108 |
| |
| |||
233 | 155 |
| |
234 | 156 |
| |
235 | 157 |
| |
236 |
| - | |
237 | 158 |
| |
| 159 | + | |
238 | 160 |
| |
239 | 161 |
| |
240 | 162 |
| |
|
Collapse file: packages/block-library/src/navigation-link/page-creator.js
packages/block-library/src/navigation-link/page-creator.js
Copy file name to clipboardExpand all lines: packages/block-library/src/navigation-link/page-creator.js+13-20Lines changed: 13 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
18 |
| - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 |
| |
20 | 23 |
| |
21 | 24 |
| |
| |||
35 | 38 |
| |
36 | 39 |
| |
37 | 40 |
| |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| |||
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
111 | 104 |
| |
112 | 105 |
| |
113 | 106 |
| |
| |||
159 | 152 |
| |
160 | 153 |
| |
161 | 154 |
| |
162 |
| - | |
| 155 | + | |
163 | 156 |
| |
164 | 157 |
|
You can’t perform that action at this time.
0 commit comments