-
Notifications
You must be signed in to change notification settings - Fork 403
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
[WIP]fix: comments being collapsed when toggle editor #4408
base: v3.8
Are you sure you want to change the base?
Conversation
/next |
Walkthrough本次变更涉及两个部分:首先,修改了 Changes
Sequence Diagram(s)sequenceDiagram
participant Editor as 编辑器
participant Thread as 评论线程
participant Widget as 小部件
Editor->>Thread: 激活或更新编辑器 URI
Thread->>Thread: 检查编辑器 URI 是否与线程 URI 匹配
Thread->>Widget: 调用 show() 方法显示小部件
Possibly related PRs
Suggested labels
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
yarn install v1.22.22 ✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
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: 0
🧹 Nitpick comments (1)
tools/dev-tool/src/index.html (1)
26-33
: 建议使用更安全的 UUID 生成方法当前的 polyfill 实现使用
Math.random()
生成 UUID,这种方法不是密码学安全的,可能会导致 UUID 冲突。建议使用以下实现来提高安全性:
- if (typeof window.crypto.randomUUID === 'undefined') { - window.crypto.randomUUID = () => - 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { - const r = (Math.random() * 16) | 0; - const v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); - } + if (typeof window.crypto.randomUUID === 'undefined') { + window.crypto.randomUUID = () => { + const getRandomValues = window.crypto.getRandomValues.bind(window.crypto); + const rnds = new Uint8Array(16); + getRandomValues(rnds); + rnds[6] = (rnds[6] & 0x0f) | 0x40; // Version 4 + rnds[8] = (rnds[8] & 0x3f) | 0x80; // Variant + const hex = Array.from(rnds).map(b => b.toString(16).padStart(2, '0')).join(''); + return `${hex.slice(0,8)}-${hex.slice(8,12)}-${hex.slice(12,16)}-${hex.slice(16,20)}-${hex.slice(20)}`; + }; + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/comments/src/browser/comments-thread.ts
(1 hunks)tools/dev-tool/src/index.html
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: 🚀🚀🚀 Next Version for pull request
- GitHub Check: unittest (ubuntu-latest, 18.x, jsdom)
- GitHub Check: unittest (ubuntu-latest, 18.x, node)
- GitHub Check: build (ubuntu-latest, 20.x)
- GitHub Check: unittest (macos-latest, 18.x, jsdom)
- GitHub Check: build (macos-latest, 20.x)
- GitHub Check: ubuntu-latest, Node.js 20.x
- GitHub Check: unittest (macos-latest, 18.x, node)
- GitHub Check: build-windows
🔇 Additional comments (1)
packages/comments/src/browser/comments-thread.ts (1)
253-254
: 代码逻辑优化合理移除了冗余的
widget.isShow
检查,使得切换回已存在的评论组件时的行为更加一致和可预测。注释也准确反映了新的行为。
🎉 PR Next publish successful! 3.8.1-next-1740452912.0 |
8a0d401
to
331978e
Compare
331978e
to
146fbbd
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v3.8 #4408 +/- ##
==========================================
- Coverage 53.45% 53.39% -0.06%
==========================================
Files 1657 1657
Lines 102103 102188 +85
Branches 22084 22114 +30
==========================================
- Hits 54576 54561 -15
- Misses 39546 39619 +73
- Partials 7981 8008 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Types
Background or solution
Changelog
fix: comments being collapsed when toggle editor
Summary by CodeRabbit