Skip to content

feat: add tag management to template screens#282

Closed
rhys-vultron wants to merge 2 commits intoe2b-dev:mainfrom
rhys-vultron:feat/template-tag-management
Closed

feat: add tag management to template screens#282
rhys-vultron wants to merge 2 commits intoe2b-dev:mainfrom
rhys-vultron:feat/template-tag-management

Conversation

@rhys-vultron
Copy link
Copy Markdown

Summary

Closes #281

  • Add tags field to the Template type (already present in infra API schema)
  • Add TRPC procedures for tag operations: getTemplateTags, assignTags, removeTags
  • Add Tags column to the templates table with badge display and overflow tooltip
  • Add inline tag management popover (assign new tags, remove existing) on row hover
  • Add text-based tag filter to the table filter bar with pill display
  • Add unit test for tag filter logic
  • Update mock data with sample tags

Test plan

  • Verify tags display correctly in the templates table as code badges
  • Verify "+N" overflow tooltip shows all tags when a template has multiple
  • Verify the "+" button appears on row hover and opens the management popover
  • Verify adding a tag via the popover input (Enter key or button click)
  • Verify removing a tag via the X button in the popover
  • Verify the tag filter works from the Filter dropdown → Tags submenu
  • Verify the tag filter pill appears and clears correctly
  • Verify tag management is disabled for default E2B templates
  • Run bun test:unit to confirm tag filter unit tests pass

🤖 Generated with Claude Code

Add full tag management support to the templates list view, leveraging
the existing infra API tag endpoints. Users can view, assign, and remove
tags directly from the table with an inline popover UI.

- Add `tags` field to Template type
- Add TRPC procedures: getTemplateTags, assignTags, removeTags
- Add Tags column with badge display and management popover
- Add tag filter (text-based) to table filters
- Add unit test for tag filter logic
- Update mock data with sample tags

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

Someone is attempting to deploy a commit to the E2B Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52e9ffc2ed

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

const [newTag, setNewTag] = useState('')
const inputRef = useRef<HTMLInputElement>(null)

const templateName = template.aliases[0] || template.names[0]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use canonical template names in tag mutation payloads

Tag assignment/removal derives templateName from template.aliases[0] before template.names[0], but the infra contracts for /templates/tags expect template name fields (target in name:tag format and name for delete). For namespaced templates where alias and canonical name differ, these requests will be sent with the wrong identifier and return not found, so tag management fails even though the row is visible.

Useful? React with 👍 / 👎.

<Button
variant="ghost"
size="icon"
className="text-fg-tertiary size-5 shrink-0 opacity-0 group-hover/row:opacity-100"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Expose tag editor trigger without hover-only visibility

The tag editor button is rendered with opacity-0 and only becomes visible on row hover, with no focus-visible fallback. In non-hover contexts (touch devices) and keyboard navigation, the control stays visually hidden, making add/remove tag actions effectively inaccessible for those users.

Useful? React with 👍 / 👎.

@rhys-vultron
Copy link
Copy Markdown
Author

rhys-vultron commented Mar 31, 2026

UI Screenshots (local dev with mock data)

List Tab - Tags Column

Templates show their current build's tags as code badges. Tags like latest, production, staging, v4.2, default are visible. Templates with multiple tags show the first tag + a +N overflow indicator with tooltip.

Visible tags in the table:

  • djangov4.2
  • nextjslatest +1
  • nginxlatest
  • elasticdefault
  • python-mllatest +2
  • postgresstaging
  • react-viteproduction +1
  • node-typescriptlatest +1

Builds Tab - Tags per Build

Each build row now shows which tags point to that specific build (e.g. production, staging). Tags are batch-fetched per unique template to avoid n+1 queries (bounded by unique templates in the page, not by number of builds).

Manage Tags Popover

On row hover, a + button appears in the Tags column. Clicking opens a popover with:

  • All current tags as removable badges (click × to remove)
  • Text input to add new tags (Enter or click +)
  • Disabled for E2B default templates

Tag Filter

Filter dropdown includes a Tags submenu with text input. Active filter shows as a pill (e.g. Tag: production ×).

To test locally

# Set up Supabase with the schema from scripts/setup-local-db.sql
NEXT_PUBLIC_MOCK_DATA=1 bun dev
# Navigate to /dashboard/{team}/templates

Shows which tags (production, staging, latest, etc.) point to each build.
Tags are batch-fetched per unique template to avoid n+1 queries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rhys-vultron
Copy link
Copy Markdown
Author

Closing for now - will revisit after further discussion on UX approach.

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.

Add tag management to template screens

1 participant