Summary briefing layer: Today pre-summarized, /a is the canonical read
Make summaries the core reading experience (summary-first, source-forward): - Cycle pre-warms summaries for Today's 7 (idempotent → only new ones hit the LLM). - /api/brief items carry their cached summary; Today cards (hero + tiles) show it inline, so Today reads as a calm briefing. - Card title/image now open the /a summary page (the canonical artifact), with a visible "Full story" link straight to the source on every card (the escape hatch). - /a gains related-grouping chips + a Copy-link/share control. - Tighten the summary prompt: original, factual, no quotations / no close paraphrase. Long tail stays lazy+cached. No article bodies stored. 129 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+25
-2
@@ -49,6 +49,13 @@ def render_share_page(article: dict, base_url: str, summary: str | None = None)
|
||||
if image else ""
|
||||
)
|
||||
|
||||
raw_tags = (article.get("tags") or "")
|
||||
chips = "".join(
|
||||
f'<span class="chip">{escape(t.replace("-", " "))}</span>'
|
||||
for t in raw_tags.split(",") if t
|
||||
)
|
||||
groupings = f'<div class="chips">{chips}</div>' if chips else ""
|
||||
|
||||
source_short = source.split(" ")[0] if source else "the source"
|
||||
if summary:
|
||||
summary_block = f'<p class="summary" id="summary">{escape(summary)}</p>'
|
||||
@@ -122,11 +129,15 @@ def render_share_page(article: dict, base_url: str, summary: str | None = None)
|
||||
.why {{ color:#3b4754; font-size:.92rem; margin:0 0 22px; }}
|
||||
.why .lbl {{ display:block; text-transform:uppercase; letter-spacing:.08em; font-size:.7rem;
|
||||
color:var(--muted); margin-bottom:3px; }}
|
||||
.chips {{ display:flex; flex-wrap:wrap; gap:7px; margin:0 0 22px; }}
|
||||
.chip {{ background:#e0eef3; color:var(--accent-deep); border-radius:999px; padding:3px 11px;
|
||||
font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; }}
|
||||
.actions {{ display:flex; flex-wrap:wrap; gap:12px; align-items:center; }}
|
||||
.primary {{ background:var(--accent); color:#fff; text-decoration:none; font-weight:600;
|
||||
padding:12px 20px; border-radius:999px; display:inline-block; }}
|
||||
.primary:hover {{ background:var(--accent-deep); }}
|
||||
.secondary {{ color:var(--accent-deep); text-decoration:none; font-size:.92rem; }}
|
||||
.secondary {{ color:var(--accent-deep); text-decoration:none; font-size:.92rem;
|
||||
background:none; border:none; cursor:pointer; font-family:inherit; padding:0; }}
|
||||
.secondary:hover {{ text-decoration:underline; }}
|
||||
.note {{ color:var(--muted); font-size:.8rem; margin-top:22px; }}
|
||||
</style>
|
||||
@@ -141,15 +152,27 @@ def render_share_page(article: dict, base_url: str, summary: str | None = None)
|
||||
<h1>{escape(title)}</h1>
|
||||
{summary_block}
|
||||
<p class="why"><span class="lbl">Why it's here</span>{escape(why)}</p>
|
||||
{groupings}
|
||||
<div class="actions">
|
||||
<a class="primary" href="{escape(src_url)}" rel="noopener" data-src-click>Read the full story at {escape(source_short)}</a>
|
||||
<a class="secondary" href="/">Explore more on Upbeat Bytes →</a>
|
||||
<button class="secondary" type="button" data-share>Copy link</button>
|
||||
<a class="secondary" href="/">Explore Upbeat Bytes →</a>
|
||||
</div>
|
||||
<p class="note">Upbeat Bytes summarizes in its own words and links to the original publisher — it doesn't host the article.</p>
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
{src_click}
|
||||
<script>
|
||||
(function(){{
|
||||
var s=document.querySelector('[data-share]'); if(!s) return;
|
||||
s.addEventListener('click',function(){{
|
||||
var url=location.href;
|
||||
if(navigator.share){{ navigator.share({{title:document.title,url:url}}).catch(function(){{}}); }}
|
||||
else if(navigator.clipboard){{ navigator.clipboard.writeText(url).then(function(){{ s.textContent='Copied!'; setTimeout(function(){{s.textContent='Copy link';}},1500); }}); }}
|
||||
}});
|
||||
}})();
|
||||
</script>
|
||||
{poll}
|
||||
</body>
|
||||
</html>"""
|
||||
|
||||
Reference in New Issue
Block a user