Skip to main content

max / balanced_breakfast

ui: add header slot to BB.ui.renderRow A metadata line above the primary text (rendered as .row-header in the content column), for rows that carry an author/timestamp header above the title. Reusable; prerequisite for routing the article rows (items, bookmarks) through the primitive. 55 JS tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-12 18:02 UTC
Commit: 8e80d0ae714b182917cced5d85513b2ad5f9c77b
Parent: 613d74a
1 file changed, +11 insertions, -0 deletions
@@ -387,6 +387,8 @@
387 387 * @param {string} [model.className] - Outer-element class (added to base).
388 388 * @param {string} [model.tag='div'] - Outer element tag (e.g. 'li' for lists).
389 389 * @param {HTMLElement|string} [model.icon] - Left slot (string is set as textContent).
390 + * @param {HTMLElement|string} [model.header] - Metadata line above primary
391 + * (e.g. author + timestamp). Rendered as `.row-header` in the content column.
390 392 * @param {HTMLElement|string} [model.primary] - Required-ish top line. String = textContent.
391 393 * @param {HTMLElement|string} [model.secondary] - Sub-line.
392 394 * @param {HTMLElement|string} [model.meta] - Small right-aligned label (date, count).
@@ -420,6 +422,15 @@
420 422 const content = document.createElement('div');
421 423 content.className = 'row-content';
422 424
425 + // Optional metadata line above the primary text (author, timestamp, ...).
426 + if (model.header != null) {
427 + const header = document.createElement('div');
428 + header.className = 'row-header';
429 + if (typeof model.header === 'string') header.textContent = model.header;
430 + else header.appendChild(model.header);
431 + content.appendChild(header);
432 + }
433 +
423 434 const primaryLine = document.createElement('div');
424 435 primaryLine.className = 'row-primary';
425 436 if (typeof model.primary === 'string') primaryLine.textContent = model.primary;