Skip to content

feat(core): add custom tags to workspaces with global tag definitions #25

@zrosenbauer

Description

@zrosenbauer

Summary

Add support for custom tags on workspaces with global tag definitions, allowing users to categorize and visually identify workspaces with custom icons and labels.

Motivation

Users need a way to categorize and visually distinguish workspaces beyond just names. Tags provide a flexible system for organizing workspaces by domain, status, or any custom categorization scheme.

Proposed API

Global Tag Definitions

// zpress.config.ts
export default defineConfig({
  tags: {
    payments: { 
      text: 'Payments', 
      icon: 'simple-icons:stripe' 
    },
    experimental: { 
      text: 'Beta', 
      icon: { type: 'emoji', value: '🧪' } 
    },
    deprecated: {
      text: 'Deprecated',
      icon: { type: 'svg', value: '<svg>...</svg>' }
    }
  },
  workspaces: [
    {
      path: './apps/billing',
      tags: ['payments', 'experimental']
    }
  ]
})

Icon Configuration

Support multiple icon formats:

type IconConfig = 
  | string                                    // Icon set reference: 'simple-icons:stripe'
  | { type: 'emoji', value: string }         // Emoji: { type: 'emoji', value: '💰' }
  | { type: 'svg', value: string }           // Inline SVG
  | { type: 'iconify', icon: string }        // Iconify reference

type Tag = {
  readonly text: string
  readonly icon?: IconConfig
  readonly color?: string                     // Optional theme color
}

TypeScript Support

Global tag definitions should provide autocomplete when applying tags to workspaces:

export default defineConfig({
  tags: {
    payments: { text: 'Payments' },
    auth: { text: 'Authentication' }
  },
  workspaces: [
    {
      path: './apps/checkout',
      tags: ['payments'] // ← Autocomplete suggests: 'payments' | 'auth'
    }
  ]
})

Implementation Checklist

  • Extend Zod config schema to support tags at root level
  • Add Tag type with text, icon, and optional color properties
  • Support multiple icon formats (string reference, emoji, svg, iconify)
  • Add tags: readonly string[] to workspace config schema
  • Validate workspace tags reference globally defined tags
  • Generate TypeScript types for autocomplete on tag names
  • Update UI package to render tags on workspace cards/lists
  • Add documentation for tag configuration
  • Add tests for tag validation and rendering

Acceptance Criteria

  • Users can define global tags with text and icon
  • Workspace configs can reference global tags by key
  • TypeScript provides autocomplete for available tag names
  • Invalid tag references produce clear validation errors
  • Tags render in UI with proper icons and styling
  • Documentation includes complete examples

Related

Part of workspace organization and navigation improvements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions