Repository navigation
Conversation
|
Size Change: +1.17 kB (+0.01%) Total Size: 7.95 MB 📦 View Changed
ℹ️ View Unchanged
|
|
@senadir I noticed the same issue, and was thinking that a better way to approach is to add the wrapper so it's unified with how other fields are render. This way, the styles are applied consistently and it would also be more robust in case of future changes. What do you think? trunk...NeosinneR:gutenberg:fix/unify-wrapper-in-renderitemlink |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ntsekouras
left a comment
There was a problem hiding this comment.
This change makes sense to me. @senadir can you add a changelog entry?
@NeosinneR what future changes do you have in mind that adding an extra wrapper would be a better approach? In my mind this simple change is enough, but curious to also here @oandregal's thoughts. |
|
@ntsekouras it's not extra wrapper. The wrapper is already there when Without With Maybe the future changes is not really an issue, but the consistency part I think is. But to be clear, either of the fixes would work for the underlined/not-underlined issue. |
|
There was a related issue in which items not using |
|
@senadir it wouldn't. My change only adds wrapper when For that, I'd propose a different PR to handle it properly for both cases (with or without |
Do you mean in case the field's render returns a Since we have this |
Correct.
Yes, and that's why I find it inconsistent, e.g., when the field already renders a
That's a good point. I don't have specific reasons, but there might be use cases when a field should always render as link, in which case |
|
Would a dedicated In terms of styling, I lean towards underlining. This will help users recognise when titles are independently interactive (table layout vs. list layout). Maybe we can try reducing the prominence of the underline slightly though:
|
355a087 to
78723ee
Compare
|
Flaky tests detected in 86eb03f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23486985536
|
|
I rebased this PR and added a changelog. Regarding styling, my $0.02 here is I prefer no underline because, even if we make it thinner, as @jameskoster shared above, with 20 to 50 items, it still feels crowded. By the way, as the title hasn't been underlined in the DataViews tables, consumers using |
|
I think we should underline for now, because it clearly distinguishes between interactive and non-interactive titles, and because it aligns with the styles in the new primitive Link component establishing coherence across. We can always revisit that later. |
|
If we can use |
|
Just to clarify, I think we need a canonical way to render the title field rather than leaving it up to the consumer. The design of that should account for accessible differentiation between interactive / non-interactive titles. There may even be another layer; interactive titles with link semantics and interactive titles with button semantics. Underlining is an established pattern for links, but another approach could be different font weight. We shouldn't rely on color alone. |
|
Updated links to use underline with the props you provided @jameskoster |
| text-decoration: underline; | ||
| text-decoration-thickness: 0.5px; | ||
| text-decoration-color: $gray-600; | ||
| text-underline-offset: 2px; |
|
I guess this will be a separate concern, but should we update Site Editor instances of DataViews (Pages, Templates, etc) to use links in title fields? Currently they use |
e3bfb15 to
3f378c9
Compare
|
PR still need to be approved if you're okay with current changes, we can proceed @jameskoster |
|
This PR only affects title fields that render a
If we were to land this PR, the titles will become inconsistent: sometimes, they'll be underlined (when the title field renders an This is already visible in the storybook where the title field does not use an
|
|
@oandregal That's a good point but I think the issue is that we're currently using buttons where links would be more appropriate in the site editor. More generally I'm struggling to think of use cases where buttons make sense because most of the time interactive titles navigate. On balance I'd vote for updating the site editor to use links for all DataViews titles. A nice little enhancement is that folks will be able to right-click and edit pages, templates, etc in a new tab which isn't currently possible. Additionally the underline style helps differentiate the different title behaviors between List (not interactive by itself) and other layouts. |
|
That's a good direction and it works for me. So, next steps for this PR would be to update the title field to render as a link in all layouts but list, I suppose? |
|
Yes, I guess the title in List should never be interactive by itself. |
|
In which case, do we need this PR? I guess it can be kept to ensure compatibility with ones still using a? |
|
I believe the suggestion was to update title fields for core dataviews pages to be links rather than buttons. I think we can do that in this PR. |
86eb03f to
3dc4bc7
Compare
|
|
||
| a { | ||
| text-decoration: none; | ||
| a, |
There was a problem hiding this comment.
Could we do without a styles entirely, and instead expect to use Link everywhere?
No having any default a styles should also make it quite obvious when a Link is not used.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ce0269a to
877fe28
Compare








What?
Styles DataViews fields that are links correctly (to match nested fields).
Why?
In DataViews, we have special styling to normalize links in data views, but it only applies if the link is set in the
rendermethod of a field.If the field is set in the
renderItemLink, the styling doesn't apply to it.How?
Matches the same styles as we do the child a anchor
Testing Instructions
Screenshots or screencast