Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wild-bugs-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"adcontextprotocol": patch
---

Made font and tagline fields editable in brand registry on the UI
38 changes: 35 additions & 3 deletions server/public/brand-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,21 @@ <h3>Edit brand details</h3>
<textarea id="edit-description" class="edit-form-input" rows="3" placeholder="Brief description of the brand"></textarea>
</div>
<div class="edit-form-field">
<label class="edit-form-label" for="edit-tone">Tone</label>
<label class="edit-form-label" for="edit-tagline">Tagline</label>
<input type="text" id="edit-tagline" class="edit-form-input" placeholder="e.g. Just Do It">
</div>
<div class="edit-form-field">
<label class="edit-form-label" for="edit-tone">Tone of voice</label>
<input type="text" id="edit-tone" class="edit-form-input" placeholder="e.g. professional, friendly, bold">
</div>
<div class="edit-form-field">
<label class="edit-form-label" for="edit-font-primary">Primary font</label>
<input type="text" id="edit-font-primary" class="edit-form-input" placeholder="e.g. Helvetica Neue">
</div>
<div class="edit-form-field">
<label class="edit-form-label" for="edit-font-secondary">Secondary font</label>
<input type="text" id="edit-font-secondary" class="edit-form-input" placeholder="e.g. Georgia">
</div>
<div class="edit-form-field">
<label class="edit-form-label" for="edit-house-domain">House domain</label>
<input type="text" id="edit-house-domain" class="edit-form-input" placeholder="e.g. parent-company.com">
Expand Down Expand Up @@ -1057,7 +1069,10 @@ <h3>Edit brand details</h3>
document.getElementById('edit-brand-name').value = currentEditStatus?.brand_name || '';
document.getElementById('edit-description').value = manifest.description || '';
document.getElementById('edit-industry').value = manifest.industry || '';
document.getElementById('edit-tone').value = manifest.tone || '';
document.getElementById('edit-tagline').value = manifest.tagline || '';
document.getElementById('edit-tone').value = typeof manifest.tone === 'string' ? manifest.tone : (manifest.tone?.voice || '');
document.getElementById('edit-font-primary').value = manifest.fonts?.primary || '';
document.getElementById('edit-font-secondary').value = manifest.fonts?.secondary || '';
document.getElementById('edit-house-domain').value = currentEditStatus?.house_domain || '';
document.getElementById('edit-keller-type').value = currentEditStatus?.keller_type || '';

Expand Down Expand Up @@ -1128,7 +1143,16 @@ <h3>Edit brand details</h3>
...(currentEditStatus?.brand_manifest || {}),
description: document.getElementById('edit-description').value.trim() || undefined,
industry: document.getElementById('edit-industry').value.trim() || undefined,
tone: document.getElementById('edit-tone').value.trim() || undefined,
tagline: document.getElementById('edit-tagline').value.trim() || undefined,
tone: (() => {
const toneValue = document.getElementById('edit-tone').value.trim();
if (!toneValue) return undefined;
const existingTone = currentEditStatus?.brand_manifest?.tone;
if (typeof existingTone === 'object' && existingTone !== null) {
return { ...existingTone, voice: toneValue };
}
return toneValue;
})(),
}
};

Expand All @@ -1137,6 +1161,14 @@ <h3>Edit brand details</h3>
body.brand_manifest.colors = colors;
}

// Always write fonts to allow clearing empty fields; undefined gets removed by cleanup below
const fontPrimary = document.getElementById('edit-font-primary').value.trim();
const fontSecondary = document.getElementById('edit-font-secondary').value.trim();
body.brand_manifest.fonts = (fontPrimary || fontSecondary) ? {
...(fontPrimary ? { primary: fontPrimary } : {}),
...(fontSecondary ? { secondary: fontSecondary } : {}),
} : undefined;

// Clean undefined values from manifest
Object.keys(body.brand_manifest).forEach(k => {
if (body.brand_manifest[k] === undefined) delete body.brand_manifest[k];
Expand Down