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

Closed
opened 2025-11-02 05:15:45 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @bobemoe on GitHub (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.

Originally created by @bobemoe on GitHub (Jun 27, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.9.0+dev-382-gc37ec66ee - Operating system: Linux (Devuan) - Browser: FireFox - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [X] 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.
GiteaMirror added the topic/ui label 2025-11-02 05:15:45 -06:00
Author
Owner

@bobemoe commented on GitHub (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.

@bobemoe commented on GitHub (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.
Author
Owner

@Cherrg commented on GitHub (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 commented on GitHub (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.
Author
Owner

@Cherrg commented on GitHub (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 commented on GitHub (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
Author
Owner

@Cherrg commented on GitHub (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 commented on GitHub (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...
Author
Owner

@Cherrg commented on GitHub (Jun 28, 2019):

pr will fix firefox behavior

  • close: deselect all checkboxes
  • nonclose: show buttons for close/label/milestone...
@Cherrg commented on GitHub (Jun 28, 2019): pr will fix firefox behavior - close: deselect all checkboxes - nonclose: show buttons for close/label/milestone...
Author
Owner

@silverwind commented on GitHub (Jun 29, 2019):

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.

@silverwind commented on GitHub (Jun 29, 2019): > 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3521