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

Tag Replacer: Improve mode logic; UI messages #1593

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

marcustyphoon
Copy link
Collaborator

@marcustyphoon marcustyphoon commented Aug 24, 2024

Description

Tag Replacer's tag input boxes can be parsed into four essential modes: add tag(s), remove a tag, replace a tag, or invalid input that shouldn't be allowed. This PR writes new, clearer logic to determine which is true, allowing the UI to be more customized depending on mode and more clear about which of the modes is active.

Resolves #913.

Features:

  • Modal UI messages reflect add-tags mode separately from remove-tags and replace-tags mode
  • Modal UI continue button changes text/color in real time based on add/remove/replace mode resulting from current text input
  • Modal UI continue button is disabled when text input is invalid or would result in no changes to post tags

Bug fixes:

  • Better parsing of text like ,,, in tag inputs

Functional changes:

  • Putting multiple comma-separated tags in the old tag input box is treated as an error state instead of silently removing the commas and treating the result as one tag

Easier to add in future if desired: replace-tag-with-different-capitalization, allow multiple tag inputs.

Makes sense to add (in future?): note in modal about add mode.

Testing steps

  • Confirm that combinations of inputs in the remove tag and add tag input text boxes correctly result in add, remove, or replace modes being shown as the submit button text.
  • Confirm that the submit button becomes disabled when there is nothing, is only white space or commas, or are multiple tags in the remove tag box, or when replacing a tag only with itself or a differently-capitalized version of itself.
  • Confirm that add (single/multiple), remove, and replace (with single/multiple) modes have appropriately phrased confirmation messages.
  • Confirm that add, remove, and replace modes work as expected.

@marcustyphoon marcustyphoon force-pushed the tag-replacer-modal-state branch 2 times, most recently from acd773f to 303cb18 Compare August 24, 2024 23:38
@marcustyphoon marcustyphoon self-assigned this Sep 14, 2024
@marcustyphoon marcustyphoon removed their assignment Sep 16, 2024
@marcustyphoon marcustyphoon changed the title Tag Replacer: Improve state logic Tag Replacer: Improve mode logic; UI messages Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tag Replacer: Clarify dialogue message in add-tags mode
1 participant