-
Notifications
You must be signed in to change notification settings - Fork 273
fix(site): adjust online debugging visibility #3257
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
base: feat_v3.x
Are you sure you want to change the base?
Conversation
Walkthrough本次变更将“在线调试”链接及其图标的渲染改为条件性显示:仅当 Changes
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #3257 +/- ##
==========================================
Coverage 87.75% 87.75%
==========================================
Files 290 290
Lines 19111 19111
Branches 2938 2938
==========================================
Hits 16771 16771
Misses 2335 2335
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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)
src/sites/sites-react/doc/components/demoblock/demoblock.tsx (1)
68-77
: 条件渲染逻辑正确,建议提取常量提高可维护性条件渲染的实现是正确的,成功地为 Taro 相关内容隐藏了在线调试功能。不过可以考虑将硬编码的字符串提取为常量以提高代码的可维护性。
建议应用以下改进:
+const TARO_IDENTIFIER = '-taro' + const DemoBlock: React.FunctionComponent<A> = (props) => { // ... existing code ... - {!props.text.includes('-taro') && ( + {!props.text.includes(TARO_IDENTIFIER) && ( <a className="list" target="_blank" href={onlineUrl} rel="noreferrer">这样做的好处:
- 提高代码可读性和可维护性
- 如果将来需要修改标识符,只需要在一个地方更改
- 使代码意图更加明确
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/sites/sites-react/doc/components/demoblock/demoblock.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: test
- GitHub Check: build
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit