feat(trend): drop the focused-category subtitle from the trend card

This commit is contained in:
bowenliang123 committed 2026-10-04 17:09:29 +08:00
1 parent 501b2f8329
commit 2adc9bb355
3 files changed
+1 -10

No files matched your search

-3
View File
@@ -486,9 +486,6 @@ export function makeContextView(
onClick={() => { setDurationCurve(on => !on) }}
>{t('trend.duration')}</button>
</span>
{focusCat !== null
? <span className="lc-card-sub">{t('trend.focus', { cat: kit.catLabel(focusCat) })}</span>
: null}
<div className="lc-trend-ctl">
<div className="lc-gran">
<button
-2
View File
@@ -92,7 +92,6 @@ export const DICT_ZH: Record<string, string> = {
'gran.total': '全量',
'gran.delta': '增量',
'gran.modeHint': '全量:累计构成;增量:相对上一条请求的变化量',
'trend.focus': '仅展示 {cat}',
'trend.adaptive': '自适应',
'trend.adaptiveHint': '按当前可视范围内的柱子重新缩放高度,滚动时随之变化',
'trend.duration': '耗时',
@@ -497,7 +496,6 @@ export const DICT_EN: Record<string, string> = {
'gran.total': 'Total',
'gran.delta': 'Delta',
'gran.modeHint': 'Total: cumulative makeup; Delta: change vs the previous request',
'trend.focus': 'Showing {cat} only',
'trend.adaptive': 'Adaptive',
'trend.adaptiveHint': 'Rescale bar heights to the visible range, following the scroll',
'trend.duration': 'Duration',
+1 -5
View File
@@ -455,15 +455,11 @@ describe('ContextView — interactions', () => {
const segs = queryAll(m.container, '.lc-bar .lc-bar-stack > .lc-cat-seg')
assert.equal(segs.length, 3)
for (const s of segs) assert.equal(s.getAttribute('data-cat'), 'assistant')
assert.ok(text(m.container).includes(DICT_EN['trend.focus'].replace('{cat}', DICT_EN['cat.assistant'])),
'the card subtitle names the focused category')
// Collapsing the category restores the whole composition and drops the subtitle.
// Collapsing the category restores the whole composition.
await click(queryAll(m.container, '.lc-br-cat-row')[5])
assert.equal(text(query(m.container, '.lc-axis-top')), '420')
assert.equal(queryAll(m.container, '.lc-bar[data-seq="4"] .lc-bar-stack > .lc-cat-seg').length, 5)
const trendCard = queryAll(m.container, '.lc-card').find(c => text(c).includes(DICT_EN['trend.title']))
assert.ok(trendCard !== undefined && trendCard.querySelector('.lc-card-sub') === null, 'unfocused: no subtitle')
await m.unmount()
})