Skip to content

fix: overview table initializes the score system from the persisted setting - #611

Open
zjncs wants to merge 1 commit into
oss-compass:mainfrom
zjncs:fix/tablelist-persisted-score-system
Open

zjncs wants to merge 1 commit into
oss-compass:mainfrom
zjncs:fix/tablelist-persisted-score-system

Conversation

@zjncs

@zjncs zjncs commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Problem

TableList's onePointSys is hardcoded with useState(false) (hundred-mark). The user's score-system choice is settable from the navbar (ChartDisplaySetting writes chartUserSettingState.onePointSys) and persisted to localStorage['analyze.setting.chart'] — but the overview table ignores it on mount: a user whose saved setting is the 1-point system sees the table render 0-100 scores while the chart directly above it (useGetLineOption and OverviewSummary/LineChart both initialize from chartUserSettingState.onePointSys) renders 0-1 scores — two score systems on the same screen until the user toggles again.

Fix

Initialize the state from the store, mirroring the two sibling components.

Verification

  • New TableList.test.tsx: set chartUserSettingState.onePointSys = true, render, assert the score-conversion label shows the point-system marker (analyze:mark.point) — RED before (showed analyze:mark.percentage), GREEN after.
  • Full analyze suite: 109 passed; the single failure (intelligent-analysis/server/pathSafety) is pre-existing on main (Windows path separator) and unrelated.

Risk

None identified — aligns the table with its siblings' initialization.

…etting

TableList 的 onePointSys 用 useState(false) 硬编码百分制:用户在导航栏
切换过 1 分制并已持久化(chartUserSettingState.onePointSys 写入
localStorage['analyze.setting.chart'])后,概览表格仍以百分制渲染,
而正上方的图表(useGetLineOption / OverviewSummary/LineChart 均以
chartUserSettingState.onePointSys 初始化)以 1 分制渲染——同一屏两种
分制,直到用户手动再切换一次。

与两个兄弟组件一致地以 store 值作为初值。
Copilot AI balanced review requested due to automatic review settings October 21, 2026 06:11
@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@zjncs is attempting to deploy a commit to the codersett's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants