feat: filter exports by spread thresholds

This commit is contained in:
wxs
2026-06-29 16:11:52 +08:00
parent 121977fd0d
commit 9eb1fe43cc
8 changed files with 803 additions and 24 deletions
@@ -0,0 +1,33 @@
# 星图达人传播指标阈值筛选 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 在导出 CSV 和提交批次前,按用户选择的 spread-info 参数组合和指标阈值过滤达人。
**Architecture:** 工具栏负责读取筛选配置;`spread-info.ts` 提供单参数组合加载与阈值比较;`index.ts` 在 export range 收集后、CSV/批次 payload 生成前统一应用筛选。
**Tech Stack:** TypeScript, Chrome MV3 content script, Vitest, jsdom.
---
### Task 1: Toolbar Filter State
- [ ] 增加视频类别、指派、营销流量、数据范围和 7 个阈值输入控件。
- [ ] 增加 `readToolbarSpreadFilter` 读取并校验筛选配置。
- [ ] 测试个人视频时固定并禁用指派/营销流量。
### Task 2: Spread Filter Logic
- [ ]`spread-info.ts` 增加单配置请求与阈值比较。
- [ ] 测试百分比显示值、秒、普通数字比较。
### Task 3: Export And Batch Integration
- [ ] 在导出和提交批次流程中调用筛选逻辑。
- [ ] 空阈值不触发筛选请求。
- [ ] 测试导出和提交批次都只保留满足阈值的达人。
### Task 4: Verification
- [ ] 运行 focused tests。
- [ ] 运行 `npm run build`