Skip to content

fix(ui): remove duplicate disabled badge and tag/hook truncation on plugin cards#3885

Open
shoummu1 wants to merge 1 commit intomainfrom
fix/ui-plugins-duplicate-disabled-badge-and-tag-truncation
Open

fix(ui): remove duplicate disabled badge and tag/hook truncation on plugin cards#3885
shoummu1 wants to merge 1 commit intomainfrom
fix/ui-plugins-duplicate-disabled-badge-and-tag-truncation

Conversation

@shoummu1
Copy link
Copy Markdown
Collaborator

Bug-fix PR

📌 Summary

Plugin cards on the Plugins page showed the word "Disabled" twice for disabled plugins, and truncated tag and hook lists to arbitrary limits (3 tags, 2 hooks) even when space was available to render them in full.

🔗 Related Issue

Closes: #3842

🔁 Reproduction Steps

Duplicate "Disabled":

  1. Navigate to Admin UI → Plugins page
  2. Observe any plugin card with status=disabled and mode=disabled
  3. Both the status dot and the mode badge rendered "Disabled"

Tag/hook truncation:

  1. Navigate to Admin UI → Plugins page
  2. Observe any plugin card with more than 3 tags or more than 2 hooks
  3. Tags beyond 3 showed +N more; hooks beyond 2 showed ...(N total)

🐞 Root Cause

In mcpgateway/templates/plugins_partial.html:

  1. The mode badge block used an {% else %} catch-all that rendered a "Disabled" badge for any mode that wasn't enforce, enforce_ignore_error, or permissive — including mode=disabled. This duplicated the status dot's "Disabled" text.
  2. Tags were iterated as plugin.tags[:3] with an overflow +{{ plugin.tags|length - 3 }} more span — a hardcoded limit with no relation to available card space.
  3. Hooks were similarly iterated as plugin.hooks[:2] with a ...(N total) overflow span.

💡 Fix Description

All changes are confined to mcpgateway/templates/plugins_partial.html:

  • Mode badge: removed the {% else %} catch-all; the mode block now only renders a badge for the three active modes (enforce, enforce_ignore_error, permissive). mode=disabled produces no badge — the status dot already conveys the disabled state.
  • Tags: removed [:3] slice and the +N more overflow span; all tags render in the existing flex-wrap container.
  • Hooks: removed [:2] slice and the ...(N total) overflow span; all hooks render inline.

🧪 Verification

Check Command Status
Lint suite make lint Pass
Unit tests make test Pass
Coverage ≥ 90 % make coverage Pass
Manual regression no longer fails Disabled plugins show single "Disabled" label; all tags and hooks visible on cards

📐 MCP Compliance (if relevant)

  • Matches current MCP spec
  • No breaking change to MCP clients

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • No secrets/credentials committed

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
@shoummu1 shoummu1 requested a review from crivetimihai as a code owner March 27, 2026 06:35
@shoummu1 shoummu1 added bug Something isn't working plugins labels Mar 27, 2026
@shoummu1
Copy link
Copy Markdown
Collaborator Author

Hi @a-effort, can you please help me review this PR? It includes changes for #3842

@shoummu1 shoummu1 requested a review from a-effort March 27, 2026 06:48
@crivetimihai crivetimihai added SHOULD P2: Important but not vital; high-value items that are not crucial for the immediate release ui User Interface labels Mar 29, 2026
@crivetimihai crivetimihai added this to the Release 1.0.0 milestone Mar 29, 2026
@crivetimihai
Copy link
Copy Markdown
Member

Thanks @shoummu1. Clean fix — removes the duplicate badge and correctly uses the config-driven session timeout. Please add the DCO Signed-off-by line to your commit.

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

Labels

bug Something isn't working plugins SHOULD P2: Important but not vital; high-value items that are not crucial for the immediate release ui User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][UI]: Plugins page cards show duplicate disabled status and truncate label counts unnecessarily

2 participants