From 840084fbb00dbdc0527a630c369ff8e44f1fc7d4 Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Sun, 17 May 2026 11:05:10 -0400 Subject: [PATCH] fix(ui): render full card content in mobile inline expansion Promoted cards now show decision/steps/link/body sections in inline detail instead of just a body preview. Fullscreen removes line clamp. --- web/app.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++- web/style.css | 3 ++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/web/app.js b/web/app.js index 9d63a27..dfaa3bb 100644 --- a/web/app.js +++ b/web/app.js @@ -664,12 +664,65 @@ actions += ``; } if (e.card_type) { + actions += ``; actions += ``; } else { actions += ``; } + + let content = ''; + if (e.card_type) { + const data = e.card_data ? (() => { try { return JSON.parse(e.card_data); } catch { return {}; } })() : {}; + const hasDecision = data.chose != null; + const hasSteps = data.steps && data.steps.length; + const hasLink = !!data.url; + const hasFill = /\$\{[^}]+\}/.test(e.body || ''); + + if (hasDecision) { + const rejected = (data.rejected || []).map(r => `${escHtml(r)}`).join(''); + content += `
+
decision${data.status || 'decided'}
+
+
${escHtml(data.chose)}
+
why${escHtml(data.why || '')}
+ ${rejected ? `
considered
${rejected}
` : ''} +
+
`; + } + if (hasLink && !hasDecision) { + content += `
+
link
+
+
`; + } + if (hasSteps) { + const steps = data.steps.map(s => `
${escHtml(s.text || s)}
`).join(''); + content += `
+
steps · ${data.steps.length}
+
${steps}
+
`; + actions += ``; + } + if (hasFill) { + actions += ``; + } + if (!hasDecision && e.body) { + const lang = data.lang || ''; + const isCode = lang || e.card_type === 'snippet'; + const bodyHtml = isCode + ? `
${escHtml(e.body)}
` + : `
${renderMd(e.body)}
`; + content += `
+
content${lang ? `${lang}` : ''}
+
${bodyHtml}
+
`; + } + } else { + content = `
${renderMd(e.body || '')}
`; + } + return `
-
${renderMd(e.body || '')}
+ ${content} ${tags ? `
${tags}
` : ''}
${actions}
diff --git a/web/style.css b/web/style.css index 4618915..55df904 100644 --- a/web/style.css +++ b/web/style.css @@ -414,7 +414,8 @@ main.focus-peek .resize-handle { visibility: hidden; } overflow: hidden; } -.entity-item.exp-full .exp-body { +.entity-item.exp-full .exp-body, +.card-row.exp-full .exp-body { -webkit-line-clamp: unset; overflow: visible; }