-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ext dapp styles #270
Ext dapp styles #270
Conversation
概述代码变更概览这次代码变更主要集中在浮动按钮组件的用户界面和代码结构优化。修改涉及样式调整、组件结构重构以及状态管理逻辑的细微改进。 变更
函数签名变更以下函数签名在
这些变更主要聚焦于提升代码可读性和用户界面的细微优化,同时保持了原有功能的完整性。 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is protestware?This package is a joke, parody, or includes undocumented or hidden behavior unrelated to its primary function. Consider that consuming this package may come along with functionality unrelated to its primary purpose. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🔭 Outside diff range comments (1)
packages/providers/inpage-providers-hub/src/floatingButton/index.tsx (1)
Line range hint
621-650
: 建议优化状态管理当前组件使用多个独立的 useState,状态之间存在关联性,建议使用 useReducer 统一管理。
建议重构为:
type State = { isExpanded: boolean; showSecurityInfo: boolean; securityInfo: IHostSecurity | null; showCloseDialog: boolean; }; type Action = | { type: 'TOGGLE_EXPAND' } | { type: 'SET_SECURITY_INFO'; payload: IHostSecurity } | { type: 'SHOW_CLOSE_DIALOG' } | { type: 'HIDE_CLOSE_DIALOG' } | { type: 'RESET' }; function reducer(state: State, action: Action): State { switch (action.type) { case 'TOGGLE_EXPAND': return { ...state, isExpanded: !state.isExpanded, showSecurityInfo: true }; // ... 其他 case } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/example/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (1)
packages/providers/inpage-providers-hub/src/floatingButton/index.tsx
(18 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/providers/inpage-providers-hub/src/floatingButton/index.tsx
[error] 114-122: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
[error] 123-123: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 133-141: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
[error] 142-142: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 210-228: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
[error] 229-229: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 288-294: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 524-524: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 544-553: Provide a text alternative through the alt, aria-label or aria-labelledby attribute
Meaningful alternative text on elements helps users relying on screen readers to understand content's purpose within a page.
If the content is decorative, redundant, or obscured, consider hiding it from assistive technologies with the aria-hidden attribute.
(lint/a11y/useAltText)
[error] 545-553: Missing key property for this element in iterable.
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
(lint/correctness/useJsxKeyInIterable)
[error] 715-715: Expected a property, or a signature but instead found ')'.
Expected a property, or a signature here.
(parse)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
packages/providers/onekey-solana-provider/package.json (1)
Line range hint
4-7
: 关键字中存在拼写错误keywords 中 "solona" 应该修改为 "solana"。
"keywords": [ "cross-inpage-provider", - "solona" + "solana" ],
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (33)
packages/core/package.json
(2 hunks)packages/core/src/versionInfo.ts
(1 hunks)packages/desktop/desktop-bridge-injected/package.json
(2 hunks)packages/empty/package.json
(1 hunks)packages/errors/package.json
(1 hunks)packages/events/package.json
(1 hunks)packages/example/package.json
(2 hunks)packages/extension/extension-bridge-hosted/package.json
(2 hunks)packages/extension/extension-bridge-injected/package.json
(2 hunks)packages/injected/package.json
(2 hunks)packages/native/native-bridge-injected/package.json
(2 hunks)packages/providers/inpage-providers-hub/package.json
(2 hunks)packages/providers/onekey-algo-provider/package.json
(2 hunks)packages/providers/onekey-alph-provider/package.json
(2 hunks)packages/providers/onekey-aptos-provider/package.json
(2 hunks)packages/providers/onekey-bfc-provider/package.json
(2 hunks)packages/providers/onekey-btc-provider/package.json
(2 hunks)packages/providers/onekey-cardano-provider/package.json
(2 hunks)packages/providers/onekey-conflux-provider/package.json
(2 hunks)packages/providers/onekey-cosmos-provider/package.json
(2 hunks)packages/providers/onekey-eth-provider/package.json
(2 hunks)packages/providers/onekey-near-provider/package.json
(2 hunks)packages/providers/onekey-nostr-provider/package.json
(2 hunks)packages/providers/onekey-polkadot-provider/package.json
(2 hunks)packages/providers/onekey-private-provider/package.json
(2 hunks)packages/providers/onekey-scdo-provider/package.json
(2 hunks)packages/providers/onekey-solana-provider/package.json
(2 hunks)packages/providers/onekey-sui-provider/package.json
(2 hunks)packages/providers/onekey-ton-provider/package.json
(2 hunks)packages/providers/onekey-tron-provider/package.json
(2 hunks)packages/providers/onekey-webln-provider/package.json
(2 hunks)packages/types/package.json
(1 hunks)packages/webview/package.json
(2 hunks)
🔇 Additional comments (32)
packages/core/src/versionInfo.ts (1)
2-2
: 检查版本号一致性
版本号已更新至 2.2.2,需要确保所有相关包的版本号保持同步。
✅ Verification successful
版本号已同步更新
经过验证,所有相关包的 package.json 文件中的版本号都已更新至 2.2.2,版本号保持一致。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查所有 package.json 文件中的版本号
find . -name "package.json" -type f -exec grep -l "version" {} \; | xargs cat | grep "version"
Length of output: 23209
packages/events/package.json (1)
3-3
: 版本更新正确
版本号更新符合预期,与 versionInfo.ts 保持一致。
packages/empty/package.json (1)
3-3
: 版本更新正确
版本号更新符合预期,与其他包保持一致。
packages/types/package.json (1)
3-3
: 版本更新已确认!
版本号从 2.2.1 更新到 2.2.2,变更合理。
packages/errors/package.json (1)
3-3
: 版本号保持一致!
与 @onekeyfe/cross-inpage-provider-types 包保持相同版本 2.2.2,符合规范。
packages/native/native-bridge-injected/package.json (1)
3-3
: 依赖版本更新验证
主版本和依赖版本都已更新到 2.2.2,建议验证其他相关包的版本一致性。
Also applies to: 31-32
✅ Verification successful
版本一致性验证已完成
经检查,所有相关包的版本号和依赖关系均已正确更新至 2.2.2,包括:
- 所有 package.json 中的版本号已统一更新为 2.2.2
- 所有 @onekeyfe 相关依赖包的引用版本也已更新为 2.2.2
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查所有相关包的版本一致性
echo "检查所有 package.json 文件中的版本号..."
fd -e json -x grep -l "version" {} | xargs cat | grep "version"
echo "\n检查所有依赖中的版本号..."
fd -e json -x grep -l "@onekeyfe" {} | xargs cat | grep "@onekeyfe"
Length of output: 9493
packages/extension/extension-bridge-injected/package.json (1)
3-3
: 版本更新看起来没有问题!
包版本和依赖版本都统一更新到了2.2.2,保持了良好的一致性。
Also applies to: 31-32
packages/extension/extension-bridge-hosted/package.json (1)
3-3
: 版本同步更新正确!
包版本和核心依赖都更新到2.2.2,与其他包保持同步。uuid依赖版本保持不变是正确的。
Also applies to: 31-32
packages/desktop/desktop-bridge-injected/package.json (1)
3-3
: 版本更新符合预期!
包版本和依赖版本统一更新到2.2.2,保持了版本一致性。
让我们验证一下所有相关包的版本是否都已同步:
Also applies to: 37-38
✅ Verification successful
版本同步已完全验证!
经检查,所有包的版本号和依赖版本都已统一更新到 2.2.2,包括:
- 所有主包版本号均为 2.2.2
- 所有 @onekeyfe/cross-inpage-provider 相关依赖版本均为 2.2.2
版本更新保持了完全一致性,无需进一步调整。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查所有package.json文件中的版本号是否一致
echo "检查所有包的版本号..."
find . -name "package.json" -exec grep -H "\"version\":" {} \;
echo "\n检查cross-inpage-provider相关依赖的版本号..."
find . -name "package.json" -exec grep -H "\"@onekeyfe/cross-inpage-provider" {} \;
Length of output: 36541
packages/providers/onekey-btc-provider/package.json (1)
3-3
: 版本更新看起来没有问题
包版本和依赖版本都已统一更新到 2.2.2,保持了一致性。
Also applies to: 31-34
packages/providers/onekey-algo-provider/package.json (1)
3-3
: 版本更新符合预期
包版本和所有依赖都已更新到 2.2.2,与其他包保持一致。
Also applies to: 31-34
packages/providers/onekey-scdo-provider/package.json (1)
3-3
: 版本更新正确,建议验证相关包
包版本和依赖版本都已更新到 2.2.2。建议验证所有相关包是否都已同步更新。
Also applies to: 31-34
✅ Verification successful
版本更新已完成且同步
所有相关包都已更新到 2.2.2 版本。inpage-providers-hub 包中的依赖引用也已正确更新。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查所有相关包的版本是否已更新到 2.2.2
fd -e package.json -x jq -r '. | select(.version != null) | "\(.name): \(.version)"' {} \;
Length of output: 95
Script:
#!/bin/bash
# Search for package.json files and their versions
find . -name "package.json" -type f -exec sh -c 'echo "=== $1 ==="; cat "$1" | grep -A1 "\"name\"\|\"version\"" 2>/dev/null' sh {} \;
Length of output: 66576
Script:
#!/bin/bash
# Alternative approach using ripgrep to find version patterns
rg -A1 '"version":\s*"2\.2\.2"' --type json
Length of output: 4409
Script:
#!/bin/bash
# Check dependencies referencing scdo-provider
rg '"@onekeyhq/onekey-scdo-provider":\s*"[^"]*"' --type json
Length of output: 62
Script:
#!/bin/bash
# Check dependencies referencing scdo-provider with corrected package name
rg '"@onekeyfe/onekey-scdo-provider":\s*"[^"]*"' --type json
Length of output: 162
Script:
#!/bin/bash
# Check if scdo-provider is referenced in any import statements
rg "from\s+['\"]@onekeyfe/onekey-scdo-provider['\"]|require\(['\"]@onekeyfe/onekey-scdo-provider['\"]\)"
Length of output: 243
packages/providers/onekey-webln-provider/package.json (1)
3-3
: 版本更新验证
包版本和依赖版本都已更新至 2.2.2,保持了一致性。建议验证这些更改是否与其他相关包同步。
Also applies to: 31-34
✅ Verification successful
版本一致性已确认
所有 @onekeyfe 相关包均已更新至 2.2.2 版本,保持了完全一致性。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查所有相关包的版本一致性
fd -e json -x cat {} \; | jq 'select(.name | startswith("@onekeyfe")) | {name: .name, version: .version}'
Length of output: 3466
packages/providers/onekey-nostr-provider/package.json (1)
3-3
: 版本更新正确
版本号和依赖项更新符合预期,与其他包保持一致。
Also applies to: 31-34
packages/providers/onekey-conflux-provider/package.json (1)
3-3
: 版本更新一致性检查通过!
包版本和所有依赖项都已统一更新到 2.2.2,保持了良好的版本一致性。
Also applies to: 31-34
packages/webview/package.json (1)
3-3
: 版本更新正确!
主版本号和依赖包版本都已更新到 2.2.2,与其他包保持同步。
Also applies to: 39-40
packages/providers/onekey-cardano-provider/package.json (1)
3-3
: 版本同步更新完成!
包版本和依赖项版本已全部更新至 2.2.2,维持了整个项目的版本一致性。
Also applies to: 32-35
packages/providers/onekey-ton-provider/package.json (1)
3-3
: 版本更新看起来没问题,建议验证依赖关系
版本号和依赖项的更新保持一致,这很好。
运行以下脚本验证所有相关包的版本一致性:
Also applies to: 31-34
✅ Verification successful
版本更新已确认一致,无需进一步修改
所有 @onekeyfe 包的版本都已更新至 2.2.2,包括:
- 核心依赖包
- 错误处理包
- 类型定义包
- 扩展桥接包
外部依赖 @tonconnect/protocol 保持不变,符合预期。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查所有包的版本是否一致
fd -e package.json -x jq -r '. | select(.name | startswith("@onekeyfe")) | .name + ": " + .version'
Length of output: 101
Script:
#!/bin/bash
# 检查所有包的版本
find . -name "package.json" -type f -exec sh -c '
echo "=== $1 ==="
cat "$1" | jq -r "select(.name != null) | \"\(.name): \(.version)\""
' sh {} \;
Length of output: 25486
Script:
#!/bin/bash
# 特别检查 onekey-ton-provider 包的依赖版本
cat packages/providers/onekey-ton-provider/package.json | jq -r '.dependencies | to_entries | .[] | "\(.key): \(.value)"'
Length of output: 330
packages/providers/onekey-sui-provider/package.json (1)
3-3
: 版本更新符合预期
包版本和依赖项更新保持一致,没有发现问题。
Also applies to: 32-35
packages/providers/onekey-eth-provider/package.json (1)
3-3
: 建议确认发布说明
版本更新符合预期,但建议:
- 确认是否需要更新 CHANGELOG
- 验证这次小版本更新是否包含任何破坏性改动
运行以下命令检查相关的变更记录:
Also applies to: 31-34
packages/providers/onekey-cosmos-provider/package.json (1)
3-3
: 版本更新检查
包版本和依赖项版本已同步更新至 2.2.2,保持了版本一致性。建议:
- 确认此版本更新是否包含重大更改
- 验证所有依赖包的兼容性
Also applies to: 32-35
✅ Verification successful
Let me verify the version of extension-bridge-injected
package which was missing in the output.
版本一致性已确认
所有相关依赖包(cross-inpage-provider-core、cross-inpage-provider-errors、cross-inpage-provider-types、extension-bridge-injected)均已同步更新至 2.2.2 版本,版本保持一致。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查相关包的版本一致性
echo "检查相关包版本..."
for pkg in cross-inpage-provider-core cross-inpage-provider-errors cross-inpage-provider-types extension-bridge-injected; do
echo "检查 @onekeyfe/$pkg:"
cat packages/**/package.json | jq -r "select(.name == \"@onekeyfe/$pkg\") | .version"
done
Length of output: 2248
Script:
#!/bin/bash
# 检查 extension-bridge-injected 包的版本
echo "检查 extension-bridge-injected 包版本..."
fd package.json --exec cat {} \; | jq -r 'select(.name == "@onekeyfe/extension-bridge-injected") | .version'
Length of output: 200
packages/providers/onekey-tron-provider/package.json (1)
3-3
: 依赖项版本更新确认
核心依赖包已更新至 2.2.2。注意事项:
- 区块链特定依赖(如 tronweb、sunweb)的版本保持不变
- 确保与更新后的核心包兼容
Also applies to: 32-35
packages/providers/onekey-alph-provider/package.json (1)
3-3
: 依赖关系检查
版本更新符合预期:
- 核心包已更新至 2.2.2
- Alephium 相关依赖版本保持在 1.5.2
Also applies to: 34-37
✅ Verification successful
版本一致性已确认
所有提供程序包(包括 alph-provider)均已更新至 2.2.2 版本,版本保持一致。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 验证所有提供程序包的版本一致性
echo "检查所有提供程序包版本..."
fd -t f package.json -x jq -r 'select(.name | startswith("@onekeyfe/onekey-") and endswith("-provider")) | "\(.name): \(.version)"'
Length of output: 1031
packages/providers/onekey-bfc-provider/package.json (1)
3-3
: 版本更新验证
版本号和依赖项更新看起来很合理,但建议:
- 确认所有相关包都已同步更新到 2.2.2
- 检查此次更新是否包含破坏性改动
Also applies to: 32-35
✅ Verification successful
版本一致性验证已完成
所有 @onekeyfe 相关包均已同步更新到 2.2.2 版本,包括:
- @onekeyfe/onekey-bfc-provider
- @onekeyfe/cross-inpage-provider-types
- @onekeyfe/inpage-providers-hub
以及其他所有相关包
版本更新保持一致,无需进一步调整。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查所有相关包的版本一致性
echo "检查版本一致性..."
fd -e json -x cat {} \; | jq 'select(.name | startswith("@onekeyfe")) | {name: .name, version: .version}'
Length of output: 3585
packages/providers/onekey-polkadot-provider/package.json (1)
3-3
: 依赖项更新正确
包版本和内部依赖更新符合预期:
- 主版本升级到 2.2.2
- 所有 @onekeyfe 依赖同步更新
- 外部依赖版本保持不变
Also applies to: 32-35
packages/core/package.json (1)
3-3
: 核心包版本更新提醒
核心包版本更新正确,请注意:
- 运行
build-version-info
脚本更新版本信息 - 确保所有依赖包都已更新到对应版本
Also applies to: 32-34
✅ Verification successful
版本更新验证完成
版本信息已全部正确更新:
- 版本信息构建脚本正常工作,将从 package.json 读取版本号
- 所有依赖包已统一更新到 2.2.2 版本
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查版本信息构建脚本
echo "检查版本信息脚本..."
cat ./packages/core/scripts/buildVersionInfo.js
# 验证是否所有依赖都已更新
echo "检查依赖版本..."
fd -e json -x cat {} \; | jq 'select(.dependencies != null) | select(.dependencies["@onekeyfe/cross-inpage-provider-core"] != null) | {name: .name, core_version: .dependencies["@onekeyfe/cross-inpage-provider-core"]}'
Length of output: 2186
packages/providers/onekey-near-provider/package.json (1)
3-3
: 版本更新看起来没有问题!
包版本和依赖版本都已统一更新到 2.2.2,保持了版本一致性。
Also applies to: 38-41
packages/providers/onekey-solana-provider/package.json (1)
3-3
: 版本更新看起来没有问题!
包版本和依赖版本都已统一更新到 2.2.2,保持了版本一致性。
Also applies to: 32-35
packages/providers/onekey-aptos-provider/package.json (1)
3-3
: 版本更新看起来没有问题!
包版本和依赖版本都已统一更新到 2.2.2,保持了版本一致性。
Also applies to: 32-35
packages/injected/package.json (1)
3-3
: 版本更新检查
所有依赖包版本已同步更新至 2.2.2,保持一致性。建议在发布前进行以下验证:
- 确认所有依赖包的变更日志
- 验证依赖包之间的兼容性
Also applies to: 45-50
✅ Verification successful
版本一致性验证通过
所有 @onekeyfe 相关包的版本均已更新至 2.2.2,包括:
- 核心依赖包(core、types、errors 等)
- 桥接模块(desktop-bridge、extension-bridge、native-bridge)
- 所有区块链提供程序(eth、btc、solana 等)
版本更新保持完全一致,无需额外调整。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查所有 @onekeyfe 包的版本一致性
echo "检查版本一致性..."
rg '"version":\s*"([^"]+)"' -g 'package.json' --json | jq -r '.data.submatches[0].match' | sort | uniq -c
Length of output: 290
Script:
#!/bin/bash
# 检查所有 package.json 中的 @onekeyfe 依赖版本
echo "检查 @onekeyfe 依赖版本..."
rg '"@onekeyfe/[^"]+"\s*:\s*"([^"]+)"' -g 'package.json' --json | jq -r '.data.submatches[0].match' | sort | uniq -c
# 检查具体的 package.json 文件路径和内容
echo -e "\n检查包含 @onekeyfe 依赖的文件..."
rg -l '@onekeyfe' -g 'package.json'
# 显示 injected/package.json 的完整内容
echo -e "\n检查 injected/package.json 内容..."
cat packages/injected/package.json
Length of output: 5261
packages/providers/inpage-providers-hub/package.json (1)
3-3
: 供应商包版本同步更新
所有区块链供应商包已更新至 2.2.2 版本。这是一次全面的版本同步,涵盖了:
- 核心包 (core, types)
- 所有链特定供应商包
建议:
- 确保已完成每个供应商包的回归测试
- 验证与各区块链网络的兼容性
Also applies to: 33-52
✅ Verification successful
版本更新验证通过,测试覆盖完整
验证结果显示:
- 所有供应商包已统一更新至 2.2.2 版本
- 每个区块链供应商都有对应的测试文件
- 核心包和类型包版本同步更新
无需额外操作,版本同步工作完成良好。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查所有供应商包的测试覆盖情况
echo "检查测试文件..."
fd -e test.ts -e spec.ts --exec echo "Found test file: {}"
Length of output: 1638
Script:
#!/bin/bash
# 检查供应商包的版本一致性
echo "检查 package.json 中的版本..."
rg '"version":|"@onekeyfe/' packages/providers/inpage-providers-hub/package.json
Length of output: 1173
packages/example/package.json (1)
3-3
: 示例项目依赖更新
示例项目版本已更新至 2.2.2,相关变更:
- 所有 @onekeyfe 依赖包同步更新
- 保留其他第三方依赖版本不变
建议:
- 运行示例项目确认功能正常
- 更新示例文档(如有必要)
Also applies to: 31-41
✅ Verification successful
Let me analyze the dependencies and documentation files first to provide a more accurate verification.
版本更新验证完成
已确认:
- 所有 @onekeyfe 依赖包已正确更新至 2.2.2 版本
- 文档中未发现需要更新的版本号引用
建议:
运行示例项目验证功能完整性
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查示例文档是否需要更新
echo "检查文档文件..."
fd -e md -e mdx --exec grep -l "2.2.1" {} \;
Length of output: 143
Script:
#!/bin/bash
# 检查示例项目的依赖版本
cat packages/example/package.json | jq '.dependencies | with_entries(select(.key | startswith("@onekeyfe")))'
# 检查是否有相关文档
fd -e md -e mdx
Length of output: 2103
Report too large to display inline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
packages/providers/inpage-providers-hub/src/floatingButton/index.tsx
(18 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/providers/inpage-providers-hub/src/floatingButton/index.tsx
[error] 114-122: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
[error] 123-123: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 133-141: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
[error] 142-142: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 210-228: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
[error] 229-229: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 288-294: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 524-524: Alternative text title element cannot be empty
For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
(lint/a11y/noSvgWithoutTitle)
[error] 544-553: Provide a text alternative through the alt, aria-label or aria-labelledby attribute
Meaningful alternative text on elements helps users relying on screen readers to understand content's purpose within a page.
If the content is decorative, redundant, or obscured, consider hiding it from assistive technologies with the aria-hidden attribute.
(lint/a11y/useAltText)
[error] 545-553: Missing key property for this element in iterable.
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
(lint/correctness/useJsxKeyInIterable)
🔇 Additional comments (3)
packages/providers/inpage-providers-hub/src/floatingButton/index.tsx (3)
351-351
:
建议使用严格相等运算符
使用 ==
可能导致类型转换问题,建议使用 ===
进行严格相等比较。
建议修改如下:
- .filter((item) => EHostSecurityLevel.Medium == item.riskLevel)
+ .filter((item) => EHostSecurityLevel.Medium === item.riskLevel)
Likely invalid or redundant comment.
544-553
:
需要为列表项添加 key 属性
在渲染列表时缺少唯一的 key 属性,这可能会影响 React 的性能和重新渲染。
建议修改如下:
- {securityInfo?.dapp?.origins.map((item) => (
+ {securityInfo?.dapp?.origins.map((item, index) => (
<img
+ key={`origin-${index}`}
src={item.logo}
+ alt={`${item.name} logo`}
/>
))}
Likely invalid or redundant comment.
🧰 Tools
🪛 Biome (1.9.4)
[error] 544-553: Provide a text alternative through the alt, aria-label or aria-labelledby attribute
Meaningful alternative text on elements helps users relying on screen readers to understand content's purpose within a page.
If the content is decorative, redundant, or obscured, consider hiding it from assistive technologies with the aria-hidden attribute.
(lint/a11y/useAltText)
[error] 545-553: Missing key property for this element in iterable.
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
(lint/correctness/useJsxKeyInIterable)
656-672
: 🧹 Nitpick (assertive)
建议优化样式对象性能
样式对象在每次渲染时都会重新创建,建议使用 useMemo 进行缓存。
建议修改如下:
+ const containerStyle = useMemo(() => ({
+ position: 'fixed',
+ zIndex: 999_999,
+ top: '75%',
+ right: '0px',
+ width: '256px',
+ background: '#fff',
+ borderRadius: '12px',
+ transition: 'all 150ms cubic-bezier(0.4, 0, 0.2, 1)',
+ boxShadow:
+ '0px 0px 0px 1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
+ transform: isExpanded ? 'translateX(-20px)' : 'translateX(216px)',
+ fontFamily:
+ '-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif',
+ WebkitTextSizeAdjust: '100%',
+ fontSmooth: 'antialiased',
+ }), [isExpanded]);
Likely invalid or redundant comment.
Summary by CodeRabbit