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

Closing issue(s) by using batch checkbox leaves wrong item ticked. #7311

Closed
2 of 7 tasks
bobemoe opened this issue Jun 27, 2019 · 6 comments · Fixed by #7320
Closed
2 of 7 tasks

Closing issue(s) by using batch checkbox leaves wrong item ticked. #7311

bobemoe opened this issue Jun 27, 2019 · 6 comments · Fixed by #7320
Labels
topic/ui Change the appearance of the Gitea UI

Comments

@bobemoe
Copy link
Contributor

bobemoe commented Jun 27, 2019

  • Gitea version (or commit ref): 1.9.0+dev-382-gc37ec66ee
  • Operating system: Linux (Devuan)
  • Browser: FireFox
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Closing issue(s) by using batch checkbox leaves wrong item ticked.

Reproduce

  1. View a list of OPEN issues with more than 1 issue.
  2. Use the batch operations checkboxes to select the FIRST item
  3. Use the batch operations close button to close the issue

Expected

The issue is closed, and is removed from the list. No other issues are ticked.

Actual

The issue is close and removed as expected, however the position it was at remains ticked. As the issues have all moved up to fill the space, now an unrelated issue is ticked.

Problem

A second click of the close button could close the wrong issue. Or if we wish to do another batch operation we need to untick all the wrong ticks.

Fix

Untick all checkboxes after batch operation, but only if the operation was CLOSE.

I can see this is useful to keep them ticked if we are modifying milestone or label as we may want to preform another operation on the same issues, so I don't think we want to remove this functionality completely.

@bobemoe
Copy link
Contributor Author

bobemoe commented Jun 27, 2019

Also I just noticed that even if we do want to do a second operation, that the batch operation buttons disappear after the first operation, and even thought the issues remain ticked, you have to untick/tick another one before the batch operation buttons re-appear.

@lunny lunny added the topic/ui Change the appearance of the Gitea UI label Jun 27, 2019
@Cherrg
Copy link
Contributor

Cherrg commented Jun 28, 2019

The problem is caused by browser cache. Process is as followed:

  • check some checkboxes and click an action button
  • the command is run in background
  • page is reloaded
  • if not stated otherwise, the browser will remember checked boxes (and sometimes filled input fields) and checks them by position without triggering click events

So the still checked boxes are more likely a bug than a feature to keep them checked.

Simplest solution is to tell the browser explicitly to not remember checked boxes.

@Cherrg
Copy link
Contributor

Cherrg commented Jun 28, 2019

To keep checked boxes would be an additional feature request.

This could be done in 2 ways:

  1. remodel js and backend, so there is no need for page reload anymore
  2. backend remembers checked boxes (if action != delete) and checks them again

@Cherrg
Copy link
Contributor

Cherrg commented Jun 28, 2019

I just noticed that browsers like Chrome/Cromium ( -> webkit) don't show this behavior, they simply don't remember the checkboxes.
May they don't count checkboxes and use id or name instead...

@Cherrg
Copy link
Contributor

Cherrg commented Jun 28, 2019

pr will fix firefox behavior

  • close: deselect all checkboxes
  • nonclose: show buttons for close/label/milestone...

Cherrg added a commit to Cherrg/gitea that referenced this issue Jun 28, 2019
- close: deselect all
- nonclose: show buttons for close/label/milestone...

fix go-gitea#7311

Signed-off-by: Michael Gnehr <michael@gnehr.de>
@silverwind
Copy link
Member

remodel js and backend, so there is no need for page reload anymore

this would be ideal yes. We should eventually abolish all uses of page reloads in JS, that's just unnecessary.

zeripath pushed a commit that referenced this issue Jul 12, 2019
* fix/define autochecked checkboxes on issue list on firefox

- close: deselect all
- nonclose: show buttons for close/label/milestone...

fix #7311

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* remove unnessesary timeouts

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* add comments in code - this is targeting firefox

Signed-off-by: Michael Gnehr <michael@gnehr.de>
jeffliu27 pushed a commit to jeffliu27/gitea that referenced this issue Jul 18, 2019
…7320)

* fix/define autochecked checkboxes on issue list on firefox

- close: deselect all
- nonclose: show buttons for close/label/milestone...

fix go-gitea#7311

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* remove unnessesary timeouts

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* add comments in code - this is targeting firefox

Signed-off-by: Michael Gnehr <michael@gnehr.de>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants