fix(modal): autocomplete + pill list show display_name (fandom suffix)
Two sites in view-modal.js were still calling getTagDisplayName(t.name) which is a post-refactor passthrough returning the bare name. Both callers should render display_name so a character with a fandom shows as 'Ruby Rose (RWBY)' — the whole point of the server sending display_name alongside name. Fixes both the autocomplete reveal under the add-tag input and the sidebar pill list rendered after a successful add/load. bulk-select.js was already correct (t.display_name || t.name pattern). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -108,8 +108,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const chip = document.createElement('span');
|
||||
chip.className = 'tag-chip';
|
||||
const icon = getTagIcon(t.kind);
|
||||
const displayName = getTagDisplayName(t.name);
|
||||
chip.innerHTML = `${icon} ${displayName} <button class="x" data-name="${t.name}" title="Remove">×</button>`;
|
||||
// Use display_name so character pills show the "(Fandom)" suffix.
|
||||
const label = t.display_name || t.name;
|
||||
chip.innerHTML = `${icon} ${label} <button class="x" data-name="${t.name}" title="Remove">×</button>`;
|
||||
tagList.appendChild(chip);
|
||||
});
|
||||
}
|
||||
@@ -753,9 +754,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
tagAutocomplete.innerHTML = tags.map((t, i) => {
|
||||
const icon = getTagIcon(t.kind);
|
||||
const displayName = getTagDisplayName(t.name);
|
||||
// Use display_name from the server so character+fandom rows show
|
||||
// "Ruby Rose (RWBY)" — lets the user disambiguate same-name characters.
|
||||
const label = t.display_name || t.name;
|
||||
return `<div class="tag-autocomplete-item" data-index="${i}" data-tag-id="${t.id}" data-name="${t.name}" data-kind="${t.kind || ''}">
|
||||
<span>${icon} ${displayName}</span>
|
||||
<span>${icon} ${label}</span>
|
||||
<span class="tag-kind">${t.kind || 'user'}</span>
|
||||
</div>`;
|
||||
}).join('');
|
||||
|
||||
Reference in New Issue
Block a user