-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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
tagsat root level - Add
Tagtype withtext,icon, and optionalcolorproperties - 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels