Skip to content

[Tagging] Add tags to a taxonomy #132

Closed
1 of 2 issues completed
Closed

Description

@bradenmacdonald

TODO

Sub-issues

Sub-issues

1 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added
    pending UX changes
    on Sep 22, 2023
  2. ali-hugo commented on Oct 12, 2023

    @ali-hugo

    @bradenmacdonald The UX for adding tags has been finalised. Please take a look at the user flow here and let me know if you have any questions.

  3. bradenmacdonald commented on Oct 12, 2023

    @bradenmacdonald
    ContributorAuthor

    @ali-hugo We are holding off on all the editing features (milestone 4) for now, but will be getting to them after the current milestone and user testing.

  4. thelmick-unicon commented on Feb 23, 2026

    @thelmick-unicon

    Feature: Add a root-level tag

    As an admin user
    The user wants to add a tag at the root level
    So that the user can expand and refine the taxonomy

    The user can add a root-level tag using the plus icon

    Given the user is on the taxonomy detail page
    When the user selects the plus icon to add a new root-level tag
    Then a new inline row is displayed at the top of the tag list
    And the row includes a text input with placeholder text that says “Type tag name”
    And the row includes a “Cancel” button
    And the row includes a “Save” button

    Cancel removes the inline row and does not create a tag

    Given the user is on the taxonomy detail page
    And that an inline row is displayed at the top of the tag list to add a new tag
    When the user selects the “Cancel” button
    Or when the user hits “escape” on their keyboard
    Then the inline row is removed
    And no new root-level tag is created
    And the tag list remains unchanged

    Saving creates a new root-level tag

    Given the user is on the taxonomy detail page
    And that an inline row is displayed at the top of the tag list to add a new tag
    When the user enters a tag name
    And the user selects the “Save” button
    Or the user hits “return/enter” on their keyboard
    Then an indicator is displayed to show the save in progress (loading spinner)
    Then a new root-level tag is created
    And the current pagination has not changed
    And the new tag appears in the tag list at the root level at the top
    And the inline input row, along with the two buttons, is no longer displayed
    And a toast appears to indicate that the tag was successfully saved

    Add multiple tags consecutively without a page refresh

    Given that the user is viewing the Taxonomy Detail page for a taxonomy
    When the user add a new tag named "Tag A" and save
    And the user add a new tag named "Tag B" and save
    Then the page does not perform a refresh
    And "Tag B" appears at the top of the current page’s tag list
    And "Tag A" appears directly below "Tag B" in the current page’s tag list

    Save is not allowed when the input is empty

    Given the user is on the taxonomy detail page
    And that an inline row is displayed at the top of the tag list to add a new tag
    When the tag name field is empty
    Then the “Save” button is disabled

    Save is not allowed with input is only whitespace

    Given the user is on the taxonomy detail page
    And that an inline row is displayed at the top of the tag list to add a new tag
    When the tag name field only contains whitespace
    Then the “Save” button is disabledAnd the user is shown an inline error message indicating that whitespace-only can not be used

    Leading and trailing whitespace is removed from the tag name on save

    Given that the user is viewing the Taxonomy Detail page for a taxonomy
    When the user adds a new tag with the name " Tag A " and saves
    Then the tag is created successfully
    And the displayed tag name is "Tag A"
    And the saved tag name does not include leading or trailing whitespace

    Save is not allowed with invalid characters

    Given the user is on the taxonomy detail page
    And that an inline row is displayed at the top of the tag list to add a new tag
    When the tag name field contains invalid characters
    Then the “Save” button is disabled
    And the user is shown an inline error message indicating that an invalid character has been used

    Note the only invalid characters are: leading/trailing whitespace, the TAB character (invisible), the string > (space-greater than-space), and ;. Anything else is allowed.

    Save is not allowed with a duplicate root-level tag name

    Given the user is on the taxonomy detail page
    And that an inline row is displayed at the top of the tag list to add a new tag
    When a user types in a name that matches an existing tag, regardless of letter casing
    And click the “Save” button
    Then the user is shown an inline error message indicating that the tag name already exists

    Error message will display if the save request fails

    Given the user is on the taxonomy detail page
    And that an inline row is displayed at the top of the tag list to add a new tag
    When a tag name is entered
    And the “Save” button is selected
    And there is an error message displayed at the top of the page
    Then the root-level tag is not created
    And the inline row remains, so the user can try again or cancel
    And a toast appears to indicate that the tag was not saved

    Add only one new tag at a time

    Given the user is on the taxonomy detail page
    And that an inline row is displayed at the top of the tag list to add a new tag
    And the plus button is disabled
    When the user selects the plus button again
    Then no additional add-tag rows are created

    New tag appears without manually refreshing the page

    Given the user is on the taxonomy detail page
    And that an inline row is displayed at the top of the tag list to add a new tag
    When a tag name is successfully added
    Then the new root-level tag appears in the list without manually refreshing the page

    Users can only add root-level tags if they have the correct permissions

    Given the user is on the taxonomy detail page
    And the user is on the taxonomy detail page
    And the user does not have permission to edit the taxonomy
    Then the user will not see the plus button

    Feature: Add a sub-tag

    @jmakowski1123 Below are the AC for this feature. Please review and let me know if you have any feedback. Thanks!

    As an admin user
    The user wants to add a sub-tag to an existing tag
    So that the user can build the taxonomy hierarchy

    The user can add a sub-tag using a parent action menu (three dots)

    Given the user is viewing the taxonomy detail page
    And a tag is displayed in the tag list
    When the user opens the actions menu for that tag (three dots)
    Then the user sees an option labeled "Add sub-tag"

    Selecting Add sub-tag creates an inline input row beneath the selected tag

    Given the user is on the taxonomy detail page
    And the user is viewing the taxonomy detail page
    And the user has opened the actions menu for a parent tag
    When the user selects "Add sub-tag" from a parent tag
    Then an inline row is displayed directly beneath the parent tag
    And the row includes a text input with placeholder text "Type tag name"
    And the row includes a "Cancel" button
    And the row includes a "Save" button

    Cancel removes the inline row and does not create a tag

    Given the user is on the taxonomy detail page
    And an inline "Add sub-tag" row is displayed beneath a parent tag
    When the user selects "Cancel"
    Or when the user hits “escape” on their keyboard
    Then the inline row is removed
    And no new sub-tag is created
    And the tag list remains unchanged

    Saving a tag with a name creates the sub-tag beneath the parent tag

    Given the user is on the taxonomy detail page
    And an inline "Add sub-tag" row is displayed beneath a parent tag
    When the user enters a valid sub-tag name
    And the user selects "Save"
    Then a new sub-tag is created under the selected parent tag
    And the new sub-tag appears in the tag list beneath the parent tag
    And the new sub-tag is indented
    And the inline input row is no longer displayed

    Save is not allowed when the input is empty

    Given the user is on the taxonomy detail page
    And an inline "Add sub-tag" row is displayed beneath a parent tag
    When the sub-tag name field is empty
    Then "Save" is disabled
    And the user is shownAnd the user is shown an inline error message indicating the name is required

    Save is not allowed with input is only whitespace

    Given the user is on the taxonomy detail page
    And an inline "Add sub-tag" row is displayed beneath a parent tag
    When the user enters only whitespace into the sub-tag name field
    Then "Save" is disabled

    Save is not allowed with invalid characters

    Given the user is on the taxonomy detail page
    And an inline "Add sub-tag" row is displayed beneath a parent tag
    When the tag name field contains invalid characters
    Then the “Save” button is disabled
    And the user is shown an inline error message indicating that an invalid character has been used

    Duplicate sub-tag name is not allowed

    Given that a sub-tag name exists under a parent tag
    When a tag name is entered that matches an existing sub-tag name, regardless of letter casing
    And the “Save” button is clicked
    Then the sub-tag is not created
    And the user is shown an inline error message indicating the tag with that name already exists

    Error message will display if the save request fails

    Given the user is on the taxonomy detail page
    Given an inline "Add sub-tag" row is displayed beneath a parent tag
    When a tag name is entered
    And the “Save” button is selected
    And there is an error message displayed at the top of the page
    Then the sub-tag is not created
    And the inline row remains, so the user can try again or cancel
    And a toast appears to indicate that the tag was not saved

    Add only one new tag at a time

    Given an inline "Add sub-tag" row is displayed beneath a parent tag
    When the user opens the actions menu for that parent tag or any other parent tag (three dots)
    And the user selects “Add sub-tag”
    Then the existing "Add sub-tag" row is removed
    And a new "Add sub-tag" row is added below the parent

    New tag appears without refreshing the page

    Given an inline "Add sub-tag" row is displayed beneath a parent tag
    When a tag name is successfully added
    Then the new sub-tag appears in the list without a page refresh

    Users can only add root-level tags if they have the correct permissions

    Given the user is on the taxonomy detail page
    And the user does not have permission to edit the taxonomy
    When the user opens the actions menu for a tag
    Then the user does not see "Add sub-tag"
    Or "Add sub-tag" is disabled

    @jmakowski1123 Above is the AC for this feature. Please review and let me know if you have any feedback. Thanks!

  5. bradenmacdonald commented on Feb 23, 2026

    @bradenmacdonald
    ContributorAuthor

    When the tag name field contains invalid characters

    Note the only invalid characters are: leading/trailing whitespace, the TAB character (invisible), the string > (space-greater than-space), and ;. Anything else is allowed.

  6. bradenmacdonald commented on Feb 23, 2026

    @bradenmacdonald
    ContributorAuthor

    This may be out of scope, but: each tag also has an optional "external ID" and it would be ideal if that was made visible+editable in this new editor.

  7. jesperhodge commented on Feb 23, 2026

    @jesperhodge

    This may be out of scope, but: each tag also has an optional "external ID" and it would be ideal if that was made visible+editable in this new editor.

    I'll consider this out of scope for now, but still want to ask:
    Doesn't editing the "external ID" break things? When the taxonomy is linked to some external system (e.g. CASE) via external ids, you are doing something similar to manually editing a foreign key - that seems dangerous?
    I see the external ID as source of truth for the tag.

  8. bradenmacdonald commented on Feb 23, 2026

    @bradenmacdonald
    ContributorAuthor

    @jesperhodge You're right. My bad. We should display external ID in the UI and allow specifying it when creating a tag, but we should not allow changing it for an existing tag.

  9. self-assigned this
    on Feb 27, 2026
  10. jesperhodge commented on Mar 5, 2026

    @jesperhodge

    An observation:
    On the backend, there's a restriction of MAX_DEPTH=3 for taxonomies, by design. However, the API endpoint returns 201 after attempting to create deeper levels of tags. I consider this a bug. I'll plan to change the API so that, if max depth is exceeded, it returns a 4xx error and does not create anything in the db.

  11. removed
    pending UX changes
    on Mar 17, 2026
  12. bradenmacdonald commented on Mar 26, 2026

    @bradenmacdonald
    ContributorAuthor

    Then a new sub-tag is created under the selected parent tag
    And the new sub-tag appears in the tag list beneath the parent tag

    I just posted this on the PR, but for visibility: if the intent of this is for the sub-tag to appear immediately beneath the parent tag, that seems like a non-standard UX to me. If the intent is for the sub-tag to appear beneath the parent tag, sorted into alphabetical order, that seems like standard UX practice to me.

    See this example from MacOS Finder, where the newly created thing jumps into correct order (but stays selected) once you give it a name:

    Screen.Recording.2026-03-26.at.1.20.05.PM.mov
  13. thelmick-unicon commented on Mar 26, 2026

    @thelmick-unicon

    Using this same example. If you condense down the screen so that you have to scroll to see items and name the folder something that will not appear where you are currently viewing, the new item jumps off the screen, and you have to scroll to find it. That's exactly what we are trying to prevent by adding it to the top of the tag list. We also would prefer not jump to another page, as that can be disorienting for a user when they thought they were on one page, but are now on another page.

    Image

    I think another thing to consider is that when a user adds a parent tag, they will almost always want to add child tags to it immediately. By having it appear at the top, they can quickly continue adding to it without having to navigate to find it.

  14. bradenmacdonald commented on Mar 26, 2026

    @bradenmacdonald
    ContributorAuthor

    I would like to see a mockup for how pagination is going to work, because I'm not yet convinced we should have pages on this sort of tree view. (Have you ever even seen a paginated tree view?) (It doesn't really make sense when the top-level tags are limited to pages of, say, 50 tags, but the sub-tags could potentially load thousands of tags onto the screen at once, since they're not part of your pagination scheme.)

    If we end up making the simpler choice of using "infinite scroll" type loading, then it's trivial to scroll to show the newly-created item once it's placed into alphabetical order. I'm not really sure why Finder doesn't do this.

    Image

    I think another thing to consider is that when a user adds a parent tag, they will almost always want to add child tags to it immediately. By having it appear at the top, they can quickly continue adding to it without having to navigate to find it.

    I don't think that's a problem if we simply auto-scroll and highlight the new sub-tag. It will rarely be off-screen anyways. But this is only possible of course if we assume there are no numbered pages and use "scroll/click to load".

  15. jmakowski1123 commented on Apr 2, 2026

    @jmakowski1123

    I think it's worth explicating a bit more on the duplication AC, particularly whether capitlization counts. Eg, I create a tag "instrument" and then try to create another tag "Instrument"

  16. thelmick-unicon commented on Apr 2, 2026

    @thelmick-unicon

    @jesperhodge Three issues to address:

    1. The indent level for level one should be shifted to the left to align with level one tags. It is currently indented to the same level as level two.
    2. The cancel/save buttons for all sub-tag levels are not aligned to the right the way the first level is.
    3. Extra period in the error message when a tag already exists
    Image Image
  17. thelmick-unicon commented on Apr 2, 2026

    @thelmick-unicon

    @jmakowski1123

    I think it's worth explicating a bit more on the duplication AC, particularly whether capitlization counts. Eg, I create a tag "instrument" and then try to create another tag "Instrument"

    I've updated the AC to include "regardless of letter casing" for both the tags and sub-tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

verawood

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions