Skip to content

Include tag counts in tag filter & tag input autocomplete #2711

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

Merged
merged 13 commits into from
Jul 8, 2025

Conversation

emma-sg
Copy link
Member

@emma-sg emma-sg commented Jul 3, 2025

This PR is currently targeting #2702 to show the differences made, but doesn't need to be merged into it — I can rebase from main and implement this as a fast-follow instead, since this touches both frontend and backend.

Changes

  • Adds a new /api/orgs/{oid}/crawlconfigs/tagCounts endpoint that returns { tags: { tag: string, count: number }[] }
  • Deprecates /api/orgs/{oid}/crawlconfigs/tags endpoint
  • Updates workflow tag filter & tag input suggestion dropdown to display tag counts from new endpoint
  • Updates <btrix-badge> to include pill, outline, and variant="blue" properties
    • The existing implementation didn't fit these use cases, and <btrix-tag> comes with the extra behaviour around deletion etc
  • Hides existing tags from tag input suggestion dropdown
  • Fixes tag input dropdown z-index bug

Manual testing

  1. On an org with multiple workflows, on the workflow page test that tag filters work as expected & are sorted by [tag count, tag name]
  2. Edit a workflow or archived item. In the Metadata section, check that tag autocomplete shows existing tag counts when you start typing, and also that it doesn't show tags in the autocomplete that are already in the tag input

Screenshots

Page Image/video
Workflow tag filter dropdown Screenshot 2025-07-02 at 8 01 58 PM

Tag input suggestion dropdown:

Screen.Recording.2025-07-02.at.8.01.31.PM.mov

@emma-sg emma-sg requested review from tw4l and ikreymer July 3, 2025 19:50
@emma-sg emma-sg force-pushed the filter-workflows-by-tag--show-tag-counts branch from ce839a6 to 4b8dddf Compare July 7, 2025 22:59
Base automatically changed from frontend-filter-workflows-by-tag to main July 8, 2025 00:11
@emma-sg emma-sg force-pushed the filter-workflows-by-tag--show-tag-counts branch 2 times, most recently from b75e169 to 6322941 Compare July 8, 2025 01:24
@emma-sg emma-sg force-pushed the filter-workflows-by-tag--show-tag-counts branch from 6322941 to 1e0bfb8 Compare July 8, 2025 01:26
Copy link
Member

@SuaYoo SuaYoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great enhancement!

@emma-sg emma-sg merged commit 74c72ce into main Jul 8, 2025
28 of 29 checks passed
@emma-sg emma-sg deleted the filter-workflows-by-tag--show-tag-counts branch July 8, 2025 19:20
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.

4 participants