# Replace some action links by buttons

**URL:** <https://forum.xwiki.org/t/replace-some-action-links-by-buttons/14509>\
**Category:** Development\
**Tags:** proposal\
**Created:** [April 24, 2024, 12:51pm UTC](https://forum.xwiki.org/t/replace-some-action-links-by-buttons/14509 "2024-04-24T12:51:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![CharpentierLucas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/charpentierlucas/32/4830_2.png) [@CharpentierLucas](https://forum.xwiki.org/u/CharpentierLucas)\
**Post date:** [April 24, 2024, 12:51pm UTC](https://forum.xwiki.org/t/replace-some-action-links-by-buttons/14509/1 "2024-04-24T12:51:23Z")

</div>

Hello!

## Context

After the fix for [XWIKI-21492](https://jira.xwiki.org/browse/XWIKI-21492), a few buttons have displayed a weird behaviour: on hover their text would be underlined.  
A.

 ![image](https://forum.xwiki.org/uploads/default/original/2X/c/c5a8039f055f5a85b0718f66c374a57b747a8c05.png)  
B.  
 ![image](https://forum.xwiki.org/uploads/default/original/2X/b/b5ec7088a1ece77c91f6d0813fc678b92b2b8741.png)  
C.  
 ![image](https://forum.xwiki.org/uploads/default/original/2X/1/1fe48f13570f9bd6880a45842d42d906fd0e4e83.png)  
D.  
 ![image](https://forum.xwiki.org/uploads/default/original/2X/3/3df33bdba5e48274d9fbc1c1cd7482e62a5441ae.png)

Those screenshots are a courtesy of @ilie.andriuta who brought up the question 🙂

The reason why this happens is that those elements, even though they look like buttons, are anchors `<a>`. On XWiki, all anchors are underlined on hover.  
Before the recent change, those had a custom style that made sure they wouldn’t be underlined even on hover. With the change, this custom style lost priority and is now overridden.

We could fix the change in style one way or another, but IMO this highlights a semantic issue with those buttons. The advantage of having an action link (link that looks like a button) over a button is that the user can right click it and open it in a new tab. We have some of those in the UI, and in most cases they are fine. However, we should still use buttons if the action does not need to be done in a new tab.

## Proposal

Replace the action links A, B and C. This will be a regression feature-wise (no more creating a wiki in a new tab, disabling an account in a new tab or changing password in a new tab). This will be an improvement in the semantics and consistency of our UI.

## Opinion

I think that in the cases of A, B and C it’s ok to lose this “New Tab” feature. However it’s not the case for D, opening a new profile section in a new tab is an important use case: I’m editing a preference and I want to check what I put in a preference in another section, I want to be able to open a tab with this other preference next to my editor easily.  
Action links can be a bit tricky to deal with on multiple levels, and I’d rather have them used (in the XWiki standard flavor) only when a button is not enough.

## Conclusion

What do you think of this proposal? Do you know of other action links that could be buttons like A, B and C?

Thank you in advance for your feedback!  
Lucas C.

---

<div class="post-metadata">

**Author:** ![ilie.andriuta](https://forum.xwiki.org/user_avatar/forum.xwiki.org/ilie.andriuta/32/916_2.png) [@ilie.andriuta](https://forum.xwiki.org/u/ilie.andriuta)\
**Post date:** [April 24, 2024, 12:59pm UTC](https://forum.xwiki.org/t/replace-some-action-links-by-buttons/14509/2 "2024-04-24T12:59:11Z")

</div>

> [@CharpentierLucas](#):
>
> opening a new profile section in a new tab is an important use case

I agree that D is an important use-case, I think we should keep it possible to be opened in a new tab.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [April 24, 2024, 1:01pm UTC](https://forum.xwiki.org/t/replace-some-action-links-by-buttons/14509/3 "2024-04-24T13:01:39Z")

</div>

> [@CharpentierLucas](#):
>
> I think that in the cases of A, B and C it’s ok to lose this “New Tab” feature. However it’s not the case for D,

I agree. For me D is clearly not a button visually so I don’t see an issue with the proposal which would be that buttons use the `<button>` html tag (instead of links), which is more semantic and most likely better for screen readers too (ie better for accessibility).

---

<div class="post-metadata">

**Author:** ![CharpentierLucas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/charpentierlucas/32/4830_2.png) [@CharpentierLucas](https://forum.xwiki.org/u/CharpentierLucas)\
**Post date:** [April 24, 2024, 1:12pm UTC](https://forum.xwiki.org/t/replace-some-action-links-by-buttons/14509/4 "2024-04-24T13:12:37Z")

</div>

> [@vmassol](#):
>
> which is more semantic and most likely better for screen readers too (ie better for accessibility).

Note that those links also have correct semantics, it’s just that screen readers will “see” what we try to hide on the GUI. The better accessibility is achieved by aligning what everyone “sees” 🙂

I think the users that would benefit the most from this are partially sighted users: they can identify the button (large brightly colored blob). However they use a screen reader to help them navigate and read, and the screen readers tells them it’s a link. This inconsistency could be quite confusing.

Non sighted users will only “see” a link there, and most sighted users will only “see” a button here.

Thanks,  
Lucas.

---

<div class="post-metadata">

**Author:** ![CharpentierLucas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/charpentierlucas/32/4830_2.png) [@CharpentierLucas](https://forum.xwiki.org/u/CharpentierLucas)\
**Post date:** [May 21, 2024, 3:57pm UTC](https://forum.xwiki.org/t/replace-some-action-links-by-buttons/14509/5 "2024-05-21T15:57:42Z")

</div>

If no problem is highlighted by then, I’ll close this topic on the 23rd, opening a corresponding a ticket on jira and start working on those small changes soon 🙂

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [May 22, 2024, 1:21pm UTC](https://forum.xwiki.org/t/replace-some-action-links-by-buttons/14509/6 "2024-05-22T13:21:22Z")

</div>

> [@CharpentierLucas](#):
>
> However, we should still use buttons if the action does not need to be done in a new tab.

It’s not clear to me how do you decide when opening in a new tab is needed and when it’s not.

I’m +1 for using a button for C, and maybe +0 for B, but I’m not sure about A because in this case it takes you to a **different** page (without being a form submit).

And yes, D should stay links.

Thanks,  
Marius

---

<div class="post-metadata">

**Author:** ![CharpentierLucas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/charpentierlucas/32/4830_2.png) [@CharpentierLucas](https://forum.xwiki.org/u/CharpentierLucas)\
**Post date:** [May 28, 2024, 9:56am UTC](https://forum.xwiki.org/t/replace-some-action-links-by-buttons/14509/7 "2024-05-28T09:56:48Z")

</div>

Okay! I just eyeballed it, based on the reports Ilie made about those changes, so nothing very formal. I gave a short explanation in the initial post but I don’t really have any clear treshhold when I would consider an item for changing.

Let’s go with only changes on B and C then. Created [https://jira.xwiki.org/browse/XWIKI-22191](https://jira.xwiki.org/browse/XWIKI-22191)

Thank you all for your feeback!
