Skip to content

Commit bb93b77

Browse files
committed
fix: use gray color for other items (#541)
1 parent 1ad3f35 commit bb93b77

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
"devDependencies": {
3232
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
3333
"@babel/preset-env": "^7.28.3",
34-
"@crowdin/crowdin-api-client": "^1.46.2",
34+
"@crowdin/crowdin-api-client": "^1.47.1",
3535
"@rsdoctor/rspack-plugin": "^1.2.3",
36-
"@rspack/cli": "^1.5.3",
37-
"@rspack/core": "^1.5.3",
36+
"@rspack/cli": "^1.5.4",
37+
"@rspack/core": "^1.5.4",
3838
"@swc/core": "^1.13.5",
3939
"@swc/jest": "^0.2.39",
40-
"@types/chrome": "0.1.11",
40+
"@types/chrome": "0.1.12",
4141
"@types/decompress": "^4.2.7",
4242
"@types/jest": "^30.0.0",
43-
"@types/node": "^24.3.1",
43+
"@types/node": "^24.5.1",
4444
"@types/punycode": "^2.1.4",
4545
"@vue/babel-plugin-jsx": "^1.5.0",
4646
"babel-loader": "^10.0.0",
@@ -54,7 +54,7 @@
5454
"postcss": "^8.5.6",
5555
"postcss-loader": "^8.2.0",
5656
"postcss-rtlcss": "^5.7.1",
57-
"puppeteer": "^24.20.0",
57+
"puppeteer": "^24.21.0",
5858
"sass": "^1.92.1",
5959
"sass-loader": "^16.0.5",
6060
"style-loader": "^4.0.0",

src/pages/popup/components/Percentage/chart.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createTab } from "@api/chrome/tab"
2-
import { getCssVariable, getPrimaryTextColor, getSecondaryTextColor } from "@pages/util/style"
2+
import { getCssVariable, getInfoColor, getPrimaryTextColor, getSecondaryTextColor } from "@pages/util/style"
33
import { calJumpUrl } from "@popup/common"
44
import { t } from "@popup/locale"
55
import { sum, toMap } from "@util/array"
@@ -204,23 +204,22 @@ export function generateSiteSeriesOption(rows: timer.stat.Row[], result: Percent
204204
const chartRows = cvt2ChartRows(rows, dimension, itemCount)
205205
const iconRich: PieLabelRichOption = {}
206206
const data = chartRows.map(row => {
207-
const value = row[dimension]
208-
let name = 'NaN'
207+
const item: PieSeriesItemOption = { name: 'NaN', value: row[dimension], row }
209208
if (isOther(row)) {
210-
const { count } = row
211-
name = t(msg => msg.content.percentage.otherLabel, { count })
209+
item.itemStyle = { color: getInfoColor() }
210+
item.name = t(msg => msg.content.percentage.otherLabel, { count: row.count })
212211
} else if (isSite(row)) {
213212
const { siteKey, alias, iconUrl } = row
214213
const { host } = siteKey || {}
215-
name = (displaySiteName ? (alias ?? host) : host) ?? ''
214+
const name = item.name = (displaySiteName ? (alias ?? host) : host) ?? ''
216215
const richValue: PieLabelRichValueOption = { ...BASE_LABEL_RICH_VALUE }
217216
iconUrl && (richValue.backgroundColor = { image: iconUrl })
218217
iconRich[legend2LabelStyle(name)] = richValue
219218
} else if (isGroup(row)) {
220-
name = getGroupName(groupMap, row)
219+
item.name = getGroupName(groupMap, row)
221220
}
222221

223-
return { name, value, row } satisfies PieSeriesItemOption
222+
return item
224223
})
225224

226225
const textColor = getPrimaryTextColor()

0 commit comments

Comments
 (0)