Skip to content

Commit 53e2294

Browse files
authored
优化弹幕测试热力图、筛选与统计卡片 (huangxd-#343)
* 增强弹幕测试结果页调用链路体验 变动内容: - 在弹幕测试结果页增加调用链路展示,覆盖自动匹配、手动搜索、番剧详情和弹幕拉取过程。 - 将统计卡文案调整为链路耗时,并按当前请求链路汇总耗时。 - 优化热力图滑动提示、边缘防溢出、筛选标签数量显示和横向滚动体验。 - 修复切换番剧/剧集时旧调用链路追加、旧请求返回覆盖新结果、失败和空结果缺少链路信息的问题。 * 修复弹幕测试调用链路串线 变动内容: - 为自动匹配、手动搜索、番剧详情和弹幕拉取增加独立请求令牌,避免旧响应覆盖新结果。 - 传递并克隆当前调用链路,修正手动失败和空结果的返回目标。 - 清理弹幕测试静态 inline 样式,补充热力图、筛选、跳集和移动端样式。 - 收敛方法标记和热力图类名,复用弹幕类型统计并增强长文本展示。 * 移除弹幕测试详情页调用链路显示 * 弹幕测试统计改为彩色占比
1 parent 7996e8d commit 53e2294

2 files changed

Lines changed: 640 additions & 64 deletions

File tree

danmu_api/ui/css/components.css.js

Lines changed: 174 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,16 @@ export const componentsCssContent = /* css */ `
12691269
color: #999;
12701270
}
12711271
1272+
.danmu-result-error {
1273+
margin-bottom: 15px;
1274+
background: #fff8f8;
1275+
border: 1px solid #ffcdd2;
1276+
color: #c62828;
1277+
border-radius: 10px;
1278+
padding: 12px 15px;
1279+
font-size: 13px;
1280+
}
1281+
12721282
/* 弹幕热力图 */
12731283
.danmu-heatmap-container {
12741284
margin-bottom: 15px;
@@ -1277,11 +1287,24 @@ export const componentsCssContent = /* css */ `
12771287
padding: 15px;
12781288
}
12791289
1280-
.danmu-heatmap-container h3 {
1290+
.danmu-section-title {
12811291
margin: 0 0 10px;
12821292
font-size: 15px;
12831293
}
12841294
1295+
.danmu-section-title-spaced {
1296+
margin-top: 15px;
1297+
}
1298+
1299+
.danmu-empty-text {
1300+
color: #999;
1301+
}
1302+
1303+
.danmu-empty-list {
1304+
text-align: center;
1305+
padding: 20px;
1306+
}
1307+
12851308
.heatmap-bars {
12861309
display: flex;
12871310
align-items: flex-end;
@@ -1290,14 +1313,84 @@ export const componentsCssContent = /* css */ `
12901313
padding: 0 2px;
12911314
}
12921315
1316+
.danmu-heatmap-interactive {
1317+
position: relative;
1318+
padding-top: 34px;
1319+
touch-action: pan-y;
1320+
user-select: none;
1321+
}
1322+
1323+
.danmu-heatmap-tooltip {
1324+
position: absolute;
1325+
top: 0;
1326+
left: 0;
1327+
transform: translateX(-50%) translateY(-4px);
1328+
display: flex;
1329+
align-items: baseline;
1330+
gap: 4px;
1331+
padding: 5px 9px;
1332+
border-radius: 999px;
1333+
background: rgba(51, 51, 51, 0.92);
1334+
color: white;
1335+
font-size: 12px;
1336+
line-height: 1.2;
1337+
white-space: nowrap;
1338+
opacity: 0;
1339+
pointer-events: none;
1340+
transition: opacity 0.12s ease, transform 0.12s ease;
1341+
z-index: 2;
1342+
}
1343+
1344+
.danmu-heatmap-tooltip.active {
1345+
opacity: 1;
1346+
transform: translateX(-50%) translateY(0);
1347+
}
1348+
1349+
.danmu-heatmap-tooltip strong {
1350+
font-size: 15px;
1351+
}
1352+
1353+
.danmu-heatmap-tooltip em {
1354+
color: rgba(255,255,255,0.72);
1355+
font-style: normal;
1356+
margin-left: 3px;
1357+
}
1358+
1359+
.danmu-heatmap-indicator {
1360+
position: absolute;
1361+
top: 34px;
1362+
bottom: 0;
1363+
width: 2px;
1364+
transform: translateX(-50%);
1365+
border-radius: 999px;
1366+
background: rgba(102, 126, 234, 0.88);
1367+
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14);
1368+
opacity: 0;
1369+
pointer-events: none;
1370+
transition: opacity 0.12s ease;
1371+
z-index: 1;
1372+
}
1373+
1374+
.danmu-heatmap-indicator.active {
1375+
opacity: 1;
1376+
}
1377+
12931378
.heatmap-bar {
12941379
flex: 1;
12951380
min-width: 3px;
1381+
height: var(--heatmap-height, 2%);
1382+
background: var(--heatmap-color, #667eea);
12961383
border-radius: 2px 2px 0 0;
1297-
transition: opacity 0.2s;
1384+
transition: opacity 0.2s, transform 0.12s ease, box-shadow 0.12s ease;
12981385
cursor: pointer;
12991386
}
13001387
1388+
.heatmap-bar.active {
1389+
opacity: 0.95;
1390+
transform: translateY(-2px);
1391+
box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.24);
1392+
}
1393+
13011394
.heatmap-bar:hover {
13021395
opacity: 0.8;
13031396
}
@@ -1313,12 +1406,27 @@ export const componentsCssContent = /* css */ `
13131406
/* 弹幕过滤标签 */
13141407
.danmu-filter-tabs {
13151408
display: flex;
1409+
flex-wrap: nowrap;
13161410
gap: 8px;
13171411
margin-bottom: 12px;
1412+
overflow-x: auto;
1413+
overflow-y: hidden;
1414+
padding-bottom: 2px;
1415+
-webkit-overflow-scrolling: touch;
1416+
scrollbar-width: none;
1417+
}
1418+
1419+
.danmu-filter-tabs::-webkit-scrollbar {
1420+
display: none;
13181421
}
13191422
13201423
.danmu-filter-tab {
1321-
padding: 6px 16px;
1424+
flex: 0 0 auto;
1425+
display: inline-flex;
1426+
align-items: center;
1427+
gap: 6px;
1428+
white-space: nowrap;
1429+
padding: 6px 12px;
13221430
background: #f0f0f0;
13231431
border: 1px solid #ddd;
13241432
border-radius: 15px;
@@ -1338,6 +1446,25 @@ export const componentsCssContent = /* css */ `
13381446
border-color: #667eea;
13391447
}
13401448
1449+
.danmu-filter-count {
1450+
display: inline-flex;
1451+
align-items: center;
1452+
justify-content: center;
1453+
min-width: 20px;
1454+
height: 18px;
1455+
padding: 0 6px;
1456+
border-radius: 999px;
1457+
background: rgba(0,0,0,0.08);
1458+
color: inherit;
1459+
font-size: 11px;
1460+
font-weight: 600;
1461+
line-height: 1;
1462+
}
1463+
1464+
.danmu-filter-tab.active .danmu-filter-count {
1465+
background: rgba(255,255,255,0.22);
1466+
}
1467+
13411468
/* 弹幕列表 */
13421469
.danmu-list-area {
13431470
background: #f8f9fa;
@@ -1390,6 +1517,7 @@ export const componentsCssContent = /* css */ `
13901517
border-radius: 50%;
13911518
flex-shrink: 0;
13921519
border: 1px solid rgba(0,0,0,0.1);
1520+
background: var(--danmu-color-dot, #fff);
13931521
}
13941522
13951523
.danmu-mode-tag {
@@ -1417,16 +1545,53 @@ export const componentsCssContent = /* css */ `
14171545
14181546
.danmu-text {
14191547
flex: 1;
1548+
min-width: 0;
14201549
overflow: hidden;
14211550
text-overflow: ellipsis;
14221551
white-space: nowrap;
14231552
color: #333;
14241553
}
14251554
14261555
.danmu-load-more {
1556+
display: none;
1557+
width: 100%;
14271558
margin-top: 10px;
14281559
}
14291560
1561+
.jump-to-episode {
1562+
margin-top: 15px;
1563+
margin-bottom: 15px;
1564+
padding: 10px;
1565+
background: #f8f9fa;
1566+
border-radius: 12px;
1567+
display: flex;
1568+
align-items: center;
1569+
gap: 10px;
1570+
flex-wrap: wrap;
1571+
}
1572+
1573+
.jump-episode-input {
1574+
padding: 8px;
1575+
width: 90px;
1576+
border: 1px solid #ccc;
1577+
border-radius: 8px;
1578+
}
1579+
1580+
.jump-episode-btn {
1581+
margin-left: 5px;
1582+
border-radius: 8px;
1583+
}
1584+
1585+
.jump-episode-total {
1586+
margin-left: 5px;
1587+
color: #666;
1588+
font-size: 14px;
1589+
}
1590+
1591+
.episode-item.episode-item-highlight {
1592+
background: #fff3cd;
1593+
}
1594+
14301595
/* 返回按钮 */
14311596
.btn-back {
14321597
padding: 8px 16px;
@@ -1502,6 +1667,12 @@ export const componentsCssContent = /* css */ `
15021667
15031668
.heatmap-bars {
15041669
height: 70px;
1670+
gap: 1px;
1671+
padding: 0 1px;
1672+
}
1673+
1674+
.heatmap-bar {
1675+
min-width: 2px;
15051676
}
15061677
}
15071678

0 commit comments

Comments
 (0)