Add tags to all entity types with chip-based input and autocomplete
- Add `tags: List[str]` field to all 13 entity types (devices, output targets, CSS sources, picture sources, audio sources, value sources, sync clocks, automations, scene presets, capture/audio/PP/pattern templates) - Update all stores, schemas, and route handlers for tag CRUD - Add GET /api/v1/tags endpoint aggregating unique tags across all stores - Create TagInput component with chip display, autocomplete dropdown, keyboard navigation, and API-backed suggestions - Display tag chips on all entity cards (searchable via existing text filter) - Add tag input to all 14 editor modals with dirty check support - Add CSS styles and i18n keys (en/ru/zh) for tag UI - Also includes code review fixes: thread safety, perf, store dedup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -401,6 +401,119 @@ input:-webkit-autofill:focus {
|
||||
background: var(--info-color);
|
||||
}
|
||||
|
||||
/* ── Card Tags ──────────────────────────────────────────── */
|
||||
|
||||
.card-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.card-tag {
|
||||
display: inline-block;
|
||||
font-size: 0.68rem;
|
||||
font-weight: 600;
|
||||
color: var(--primary-color);
|
||||
background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-secondary));
|
||||
border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
|
||||
padding: 1px 7px;
|
||||
border-radius: 8px;
|
||||
white-space: nowrap;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* ── Tag Input (chip-based input with autocomplete) ──── */
|
||||
|
||||
.tag-input-wrap {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 6px 8px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
background: var(--bg-color);
|
||||
cursor: text;
|
||||
min-height: 38px;
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
.tag-input-wrap:focus-within {
|
||||
border-color: var(--primary-color);
|
||||
box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
|
||||
}
|
||||
|
||||
.tag-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
color: var(--primary-color);
|
||||
background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-secondary));
|
||||
border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
|
||||
padding: 2px 6px;
|
||||
border-radius: 6px;
|
||||
white-space: nowrap;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.tag-chip-remove {
|
||||
background: none;
|
||||
border: none;
|
||||
color: inherit;
|
||||
font-size: 0.9rem;
|
||||
cursor: pointer;
|
||||
padding: 0 2px;
|
||||
line-height: 1;
|
||||
opacity: 0.6;
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
.tag-chip-remove:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.tag-input-field {
|
||||
flex: 1 1 60px;
|
||||
min-width: 60px;
|
||||
border: none !important;
|
||||
outline: none !important;
|
||||
background: none !important;
|
||||
padding: 2px 0 !important;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-color);
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.tag-input-dropdown {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
background: var(--bg-color);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 4px 12px var(--shadow-color);
|
||||
margin-top: 4px;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.tag-dropdown-item {
|
||||
padding: 6px 10px;
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
transition: background 0.1s;
|
||||
}
|
||||
.tag-dropdown-item:hover,
|
||||
.tag-dropdown-item.tag-dropdown-active {
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
/* ── Focus-visible indicators for keyboard navigation ── */
|
||||
|
||||
.btn:focus-visible,
|
||||
|
||||
Reference in New Issue
Block a user