Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactions don't work if JavaScript is disabled #19846

Closed
Wuzzy2 opened this issue May 31, 2022 · 14 comments
Closed

Reactions don't work if JavaScript is disabled #19846

Wuzzy2 opened this issue May 31, 2022 · 14 comments
Labels
topic/ui Change the appearance of the Gitea UI type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@Wuzzy2
Copy link

Wuzzy2 commented May 31, 2022

Description

If you have JavaScript disabled, the reaction selector does not work. (The one which allows you to assign a reaction to a comment or issue). You can open the emoji selection menu, but when you click on an emoji, nothing happens.

Steps to reproduce:

  • Go to any issue with some replies
  • Go to any reply
  • Go to the smiley face icon in the top right of that reply
  • Select and click an emoji

EXPECTED behavior: This reaction gets added to the post.
ACTUAL behavior (without JavaScript): The reaction menu pops up, but clicking an emoji does nothing.

Screenshots

N/A

Gitea Version

1.17.0+dev-633-gfdc784dbf

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

GNU/Linux

Browser Version

Mozilla Firefox 100.0

@Wuzzy2 Wuzzy2 added type/bug topic/ui Change the appearance of the Gitea UI labels May 31, 2022
@delvh

This comment was marked as resolved.

@delvh delvh closed this as completed May 31, 2022
@Wuzzy2
Copy link
Author

Wuzzy2 commented May 31, 2022

We can't do something physically impossible:
If you manually disable Javascript, how are we supposed to react on a click?

Turn the emoji buttons into normal links, and then react on the server side?

@delvh

This comment was marked as off-topic.

@Wuzzy2
Copy link
Author

Wuzzy2 commented May 31, 2022

Huh? Unposted messages? I'm not talking about unposted messages.

I was talking about the feature called "reactions", the smiley face to the top right corner of each message. As far I know, you can't add reactions to unposted messages (which makes sense), but only to posted messages.

I'm very sorry for not being clear enough. :(

To clarify what I was actually talking about, here are the steps to reproduce the bug (?) I meant:

  • Go to any issue with some replies
  • Go to any reply (i.e. an actual reply that already exists, not "unposted" replies)
  • Go to the smiley face icon in the top right of that reply
  • Select and click an emoji

Expected: This reaction gets added.
Actual (without JS): Nothing happens.

So, if your answer to that bug (?) is also "too much work", well, OK, I will not further bother you.

@delvh
Copy link
Member

delvh commented May 31, 2022

Ah okay, there might have been a misunderstanding. I thought you referred to the popup when you type :, and already wondered why that still works with JS disabled.
Okay, for reactions that is something different.

@delvh delvh reopened this May 31, 2022
@Wuzzy2 Wuzzy2 changed the title Emoji selector does not work if JavaScript is disabled Reaction selector does not work if JavaScript is disabled May 31, 2022
@Wuzzy2
Copy link
Author

Wuzzy2 commented May 31, 2022

Updated issue title and description.

@Wuzzy2 Wuzzy2 changed the title Reaction selector does not work if JavaScript is disabled Reactions don't work if JavaScript is disabled May 31, 2022
@lunny
Copy link
Member

lunny commented May 31, 2022

But without Javascript, we have to refresh the page to address that?

@delvh
Copy link
Member

delvh commented May 31, 2022

Yes. But unresponsiveness has to be expected when JS is disabled.
But I do agree with @Wuzzy2, I see no reason to not make these buttons normal links that are sent to the server, and then adding some additional JS to visually present the result.

@Ryuno-Ki
Copy link
Contributor

Ryuno-Ki commented Jun 8, 2022

It appears the template needs refactoring then:

https://github.com/go-gitea/gitea/blob/8fee7c46c16cbc1b46477cf600160f9668b9f5d0/templates/repo/issue/view_content/add_reaction.tmpl

I suspect, this is the file that controls it using JavaScript:

const url = `${actionURL}/${$(this).hasClass('primary') ? 'unreact' : 'react'}`;

Since it's POST, the reactions would need to be inside a <form>, because <a> only sends GET requests.

@lafriks
Copy link
Member

lafriks commented Jun 10, 2022

I don't think we have resources to maintain functionality with disabled JavaScript especially as we thinking about moving more stuff to fronted to improve responsibility for large repos etc by doing more stuff async

@lafriks lafriks added type/proposal The new feature has not been accepted yet but needs to be discussed first. and removed type/bug labels Jun 10, 2022
@wxiaoguang
Copy link
Contributor

There are more and more features requiring JavaScript. I do not think the latest Gitea UI will work correctly with JavaScript disabled.

@Ryuno-Ki
Copy link
Contributor

In that case, perhaps the reactions should be not shown at all (and only be made available once JavaScript is executed).

@rbronco21
Copy link

I have JavaScript enabled in Chrome and the results are inconsistent. I found this discussion while looking for an answer, checked that JavaScript was already enabled for GitHub, and then found one of my reactions on the page I was looking at. I am able to add and remove to reactions that are already posted, but adding a new one may or may not work. I'd be happy to do any testing, but diagnosing JavaScript is beyond me.

@silverwind
Copy link
Member

I don't think we can support complex UI interactions without JS. Doing stuff with CSS and single-button-forms is possible, but often much more work.

Secondly, CSS-only popovers come with their own set of issues related to stacking context that can only be solved with JS-based popover libraries like done in #20428.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

8 participants