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

Moderation tools UX improvements #4792

Open
12 tasks
dvz opened this issue Mar 26, 2024 · 1 comment
Open
12 tasks

Moderation tools UX improvements #4792

dvz opened this issue Mar 26, 2024 · 1 comment
Assignees
Labels
b:1.9 Branch: 1.9.x t:enhancement Type: Enhancement. Contains minor improvements

Comments

@dvz
Copy link
Contributor

dvz commented Mar 26, 2024

  1. Extract moderation tools from the unified <select> to icon buttons:

    • built-in tools
    • custom tools selection (if any are defined), which opens the <select>
  2. Handle submit logic
    As the moderation bar is only used to identify the concrete tool to use - in connection with <input type="checkbox"> checked or cookie-stored item IDs - the form can be submitted upon tool selection.

    Default tools can behave like native <button> elements submitting the <form>, without JavaScript involvement.

    Custom tools selection using <select> would be followed by:

    • submitting the <form> using JavaScript
    • making the submit button visible (which may replace the custom selection button) for no-JavaScript clients (e.g. using :user-valid on the element and sibling)
  3. Adapt tool selection UX to item selection state

    • apply position: sticky for non-empty item selections

      Remains non-sticky if state cannot be reliably detected.

    • hide tool selection for empty item selections

      Remains visible if state cannot be reliably detected.

    Notably, the thread tools in the thread view may be visually overwhelming when not intended to be used, and can be hidden by default (e.g. using <details>).

Targets:

  • post moderation tools

    • thread view
    • search view
  • thread moderation views

    • forum view
    • thread view
    • search view
@dvz dvz added t:enhancement Type: Enhancement. Contains minor improvements b:1.9 Branch: 1.9.x labels Mar 26, 2024
@dvz
Copy link
Contributor Author

dvz commented Mar 26, 2024

Discussed techniques to determine item selection state without JavaScript:

  • CSS selector :has(:checked) on the sibling element with a list of items
  • a server-side class/attribute added to the moderation tools element when a stored selection is non-empty

The second method may yield false positives when the stored selection is de-selected client-side.

Therefore, the sticky position may be best applied:

  • using JavaScript, when all selected items are known (managed cookie values)
  • using CSS, when the server-side flag indicates empty stored selection, and items are selected in the DOM (avoids suggesting that the current-page selection is exhaustive)

Conversely, the tool selection may be hidden:

  • using JavaScript, when all selected items are known (managed cookie values)
  • using CSS, when the server-side flag indicates empty stored selection, and no items are selected in the DOM

The tool would be shown by default, and conditionally hidden via CSS to avoid breaking the feature in case of selector failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.9 Branch: 1.9.x t:enhancement Type: Enhancement. Contains minor improvements
Projects
None yet
Development

No branches or pull requests

2 participants