Repository navigation
Conversation
life_cycle.progress is a 0..1 fraction (as StoryNavigator already assumes via Math.round(progress * 100)), but NarrativeDashboardPanel rounded it directly, so a finished book (1.0) displayed as 进度 1% and every value below 0.5% as 0%. Scale to percent and clamp.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughLifecycle progress and completion-rate displays now convert fractional values to percentages. Lifecycle progress is rounded and capped at 100. Completion rate is formatted to one decimal place. ChangesPercentage displays
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The percentage display fixes are consistent with the available API and lifecycle contracts, with no concrete merge-blocking risk identified. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Same unit mismatch as the narrative brief panel: the stats API's completion_rate is documented (stats_models.py) as "Fraction of book completed (0.0 to 1.0)", but StatsTopBar formatted the raw fraction with a percent sign, so a finished book (1.0) displayed as 1.0%. Scale to percent before formatting.
变更类型
fixBug 修复变更说明
两处进度类字段的单位换算遗漏——后端返回 0
1 分数,前端直接当 0100 百分数显示,导致写完的书进度恒显示 0~1%:life_cycle.progress(0~1)被Math.round(p)直接展示,写完的书(1.0)显示「进度 1%」。同仓库StoryNavigator.vue对同一字段已按Math.round(progress * 100)处理,本修复与其对齐,并钳制到 100。completion_rate在后端模型中明确注释为 "Fraction of book completed (0.0 to 1.0)"(stats_models.py),面板却把原始分数toFixed后直接拼%号——完成的书显示「完成率 1.0%」。已乘 100 再格式化。两处均为纯展示换算,后端语义不动。
架构影响
frontend(两个文件各一处 computed/格式化,无新增文件)测试
life_cycle.progress与completion_rate无其他展示点遗漏Summary by CodeRabbit