Repository navigation
Conversation
… matrix, meta panel, copy (14 tests)
…mpty/headerless CLI errors, INFO/FORMAT defs, symbolic alleles, natural chrom sort, windowed list virtualization (filter toggle 12.5s→0.6s at 300k variants)
…r-preserving filter, no re-sort), async status-bar stats; PASS filter toggle 44.5s→3.1s, startup 59s→2.8s at 5.7M variants
- Binary quick-scan (first 5000) then background resume: open latency 46s→11ms - GIL-yield tuning (25ms/1000 rows): scroll during scan 2000ms→~200-400ms/press - Hide scrollbar while scanning + lazy restore (5.7M virtual-height recompute stalled UI 3s) - Reuse one binary file handle for detail seek-back reads - Time-throttled batch callbacks + end-of-scan reconciliation (no lost variants) - Async status-bar stats with token guard against exit race Regenerated test/big_chr.vcf: 508MB, 5.7M variants, chr1 coords up to 248,956,641 (>100M). 272 tests pass.
…osition on large files Root causes: - Every 0.5s batch callback rebuilt the window via clear_options(), resetting OptionList scroll state → periodic jump-to-top while browsing - Scrollbar was re-enabled after scan over a 400-option windowed buffer, falsely implying 'drag to bottom = end of data' (bottom showed chr1:17,065, the ~400th variant, not the 5.7M-th at 248,956,641) Fixes: - Batch appends never clear/rebuild: incremental add_options only when the window sits at the data tail and is unfilled; otherwise data-only extend - Scrollbar only shown when the list is fully materialized (<= WINDOW items); large lists rely on position indicator (sub_title 'X / N') + G/g jumps - Mouse wheel on large lists moves the browsing position (window shifts) instead of scrolling inside the 400-option buffer Verified on test/big_chr.vcf (508MB, 5.7M variants): - 8s mid-scan with multiple batches: 0 position jumps - G reaches true last variant chr1:248,956,641, indicator 5,700,000 / 5,700,000 - filter/sort/navigation stable after scan completion 280 tests pass (8 new regressions).
- Search bar (/) now supports chr1:10000 (nearest variant), chr1:10000-20000 and chr1:10000..20000 (first variant in range), with thousands separators and auto-swapped reversed ranges - Binary search on position-ordered view: 0.2ms jump on 5.7M variants (linear fallback for QUAL sort mode); mid-scan searches report indexed count - New AbsoluteScrollbar widget: thumb maps to the FULL view (position and size), click/drag to jump anywhere — replaces the misleading 400-option-buffer scrollbar on large lists - parse_coord_query added to pure parser layer (vcf.py), fully unit-tested - Help panel, search placeholder and README updated 298 tests pass (18 new).
- 修改 on_mount 方法中的注释说明焦点设置功能 - 在应用启动后显式设置焦点到侧栏组件 - 确保 Footer 组件能够显示完整的快捷键信息 - 优化了初始加载时的用户体验和界面响应
- VCF 浏览器右侧详情/基因型矩阵面板支持键盘滚动浏览 (Tab 聚焦,j/k/↑↓/PgUp/PgDn/Space/b/g/G,Esc 返回列表; n/p 保持变异级导航语义不受焦点影响) - issue #4: SequenceView.on_unmount 组件自身关闭持久句柄 (Textual 先卸载子组件,App 级钩子 query 返回空集从未生效) - issue #4: SequenceList 构造/追加改用批量 add_options (逐个 add_option 导致索引耗时退化 25 倍,复核者 A/B 验证 4.4x 提速) - 修复软屏蔽 DNA(RepeatMasker 小写 x)误判为蛋白质 - CLI _check_file 只拒绝目录,恢复 /dev/stdin、命名管道等 Unix 惯用输入 - 新增 clipboard.py 共享分层回退剪贴板(browser/vcf_browser 统一) - 327 项测试全部通过,ruff check src/ 零告警
- VCF 浏览器 App 级 Space/b 绑定与 action_page_down/up、PAGE 常量移除 - DetailPanel 移除 Space/b 绑定(PageUp/PageDown 物理键保留为详情翻页) - 帮助屏与 README 快捷键表同步更新 - 测试同步:Space/b 按下无任何副作用,方向键/PageUp/PageDown/g/G 滚动不受影响
- 新增 _DefaultBrowseGroup(TyperGroup):首个参数非已知子命令时自动路由到 browse (seqviz test.fa ≡ seqviz browse test.fa;seqviz 无参仍打开当前目录选择器) - browse 改为 hidden 兼容别名,--help 命令列表只保留辅助子命令 (view/stats/head/fqview/config) - 主帮助文案更新:直接跟文件/目录路径即可打开浏览器 - README 同步:快速开始/命令表/各浏览器章节全部改用 seqviz <路径> 用法 - 新增 6 项默认路由测试(文件直达/VCF 路由/不存在路径/无参目录/子命令不被吞/选项不误路由) - 333 项测试全部通过,ruff check src/ 零告警
- 修复 21 个 ruff 错误 (import 排序/清理),test/** 豁免 RUF059/RUF015 - 类型注解现代化 (Generator[X]、去字符串化),requires-python >= 3.14 - CI lint 锁定 ruff@0.16.3,移除冗余 Python 安装步骤 - 版本升至 0.7.0rc2,同步 __init__.py / README / TODO.md
- 修复 _types/_qual_order 缓存在后台扫描追加变异后未失效导致的 IndexError - 后台扫描失败时通知用户而非静默吞掉异常 - CLI 打开 VCF 文件时捕获 OSError 并友好报错 333 tests passed, ruff lint clean.
Owner
Author
运维巡检代码审查报告(QoderCN)审查结论:代码质量合格,建议合并变更概览本 PR 新增 VCF 变异可视化功能(+5042/-491 行,35 文件),核心模块:
本次修复的 Bug(commit
|
| 问题 | 严重度 | 修复 |
|---|---|---|
_types/_qual_order 缓存在后台扫描追加变异后未失效 → IndexError |
🔴 高 | _append_batch 和 _finish_scan 中失效缓存 |
| 后台扫描异常被静默吞掉 | 🟡 中 | 捕获异常后通知用户 |
| CLI 打开 VCF 文件时 OSError 产生原始 traceback | 🟡 中 | 捕获 OSError 并友好报错 |
测试验证
333 passed in 54.11s
ruff check → All checks passed!
代码质量评估
优点:
- 解析层与 UI 层清晰分离
- 窗口化虚拟化(WINDOW=400)避免大文件全量物化
- quick scan + 后台续扫的启动策略体验良好
- 测试覆盖全面(解析 28 项 + 浏览器 923 行测试)
- CRLF 处理正确且已测试
后续可优化(不阻塞合并):
- 多等位基因型(
1/2)和相位基因型(0|1)显示可特殊处理 - sites-only VCF 不应虚构
sample1 - 100M+ 变异 VCF 的内存限制应在文档中说明
合并建议
代码质量合格,关键 bug 已修复,测试全部通过。建议 @Georicl 合并。
# Conflicts: # src/seqviz/browser.py
Owner
Author
运维巡检合并报告(QoderCN)操作结果:已合并 ✅审查摘要
变更统计
合并细节
后续建议(不阻塞)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
pytest -q→ 333 passed in 54s)ruff check src/ test/→ All checks passed)_types/_qual_order缓存在后台扫描追加变异后未失效导致的 IndexError代码审查要点
vcf.py负责解析/分类/基因型/懒扫描/统计,与 UI 层vcf_browser.py清晰分离scan_vcf_quick快扫前 5000 条立即启动 TUI,scan_vcf_resume后台续扫_append_batch和_finish_scan中失效_types/_qual_order缓存已知限制(可后续优化)
1/2)和相位基因型(如0|1)显示未特殊处理./.(无样本时回退为sample1)