Repository navigation
DevOverlayの精度履歴グラフの縦軸を固定ログスケールに変更し値の変化を読み取りやすくする - #6128
Conversation
📝 WalkthroughWalkthrough精度チャートの正規化ロジックが相対スケール(系列内 min/max)から固定ログスケール(床/天井定数)へ移行。ACCURACY_CHART_FLOOR_M・CEILING_M 定数と normalizeAccuracy 関数を追加し、buildAccuracyChartSeries がこれを使用するよう更新。テストは床/天井飽和、単調性、系列依存性の廃止を検証。 Changes固定ログスケール精度正規化の導入
🎯 3 (Moderate) | ⏱️ ~25 minutesPossibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/utils/accuracyChart.test.ts (1)
1-43: ⚡ Quick win
afterEachでjest.clearAllMocks()を追加してください。このテストファイルに
afterEachがないため、ガイドライン準拠のために追加してください。🔧 追加例
import { ACCURACY_CHART_CEILING_M, ACCURACY_CHART_COLORS, ACCURACY_CHART_FLOOR_M, buildAccuracyChartSeries, getAccuracyColor, normalizeAccuracy, } from './accuracyChart'; + +afterEach(() => { + jest.clearAllMocks(); +});As per coding guidelines "Mock network and Firebase layers with
jest.mockand calljest.clearAllMocks()inafterEach".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/utils/accuracyChart.test.ts` around lines 1 - 43, Add an afterEach hook that calls jest.clearAllMocks() to this test file so mocks are reset between tests; locate the test suite containing normalizeAccuracy and other imports (e.g., the describe block for "normalizeAccuracy (fixed log scale)") and insert afterEach(() => jest.clearAllMocks()) at the top level of the file (outside individual it blocks) to comply with the mocking guideline.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/utils/accuracyChart.test.ts`:
- Around line 1-43: Add an afterEach hook that calls jest.clearAllMocks() to
this test file so mocks are reset between tests; locate the test suite
containing normalizeAccuracy and other imports (e.g., the describe block for
"normalizeAccuracy (fixed log scale)") and insert afterEach(() =>
jest.clearAllMocks()) at the top level of the file (outside individual it
blocks) to comply with the mocking guideline.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bd0223a0-ea83-4577-a7c8-d30d2f335621
📒 Files selected for processing (2)
src/utils/accuracyChart.test.tssrc/utils/accuracyChart.ts
概要
DevOverlay の精度履歴グラフの縦軸スケールが履歴ウィンドウの min/max に依存する相対スケールだったため、平常時のわずかな揺れでもグラフが全高に広がり、逆に値の変化量が読み取りづらかった。実機フィードバックを受け、縦軸を固定ログスケールに変更する。
変更の種類
変更内容
5m〜上限MAX_PERMIT_ACCURACY(1500m) を対数で割り当てる固定スケールに変更。同じ精度値は常に同じ高さに描画され、値の変化量を直接読み取れる。5m以下は下端(0)、MAX_PERMIT_ACCURACY以上は上端(1)にクランプ(許容上限超過=棄却域は「振り切れ」として上端に張り付かせる)。buildAccuracyChartSeriesの相対正規化(min/max・range・全同値時 0.5)を撤去し、normalizeAccuracyで各サンプルを独立に固定変換する実装へ簡素化。accuracyChart.test.ts)。ウィンドウ非依存・クランプ・単調性・良好域の判読性を検証。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Generated by Claude Code
Summary by CodeRabbit
リリースノート
Refactor
Tests