feat: add AI markdown reformatting and usage metering to NewsService

Add AI-powered body reformatting for valid articles in the news pipeline, converting raw text walls into clean Markdown with paragraphs, headings, and lists. Introduce `news_usage` database table and `add_news_usage`/`get_news_usage` helpers to track per-cycle gateway costs (calls, tokens, latency, USD) from response headers, reported on the admin Services page. Remove unused `.sidebar-more` CSS and apply `render_title()` to poll question/label fields.
This commit is contained in:
2026-06-18 23:46:53 +00:00
parent 6ceca3d0d4
commit f3a4667fce
13 changed files with 427 additions and 57 deletions
-28
View File
@@ -82,34 +82,6 @@
box-shadow: var(--glow-accent);
}
.sidebar-more {
display: flex;
flex-direction: column;
gap: 0.125rem;
}
.sidebar-more-toggle {
list-style: none;
cursor: pointer;
user-select: none;
}
.sidebar-more-toggle::-webkit-details-marker {
display: none;
}
.sidebar-more-chevron {
margin-left: auto;
font-size: 1rem;
line-height: 1;
color: var(--text-muted);
transition: transform 0.15s ease;
}
.sidebar-more[open] > .sidebar-more-toggle .sidebar-more-chevron {
transform: rotate(90deg);
}
.sidebar-dot {
width: 8px;
height: 8px;