Skip to content

docs(cndocs): sync admonition title syntax#1037

Merged
sunnylqm merged 1 commit into
productionfrom
auto-translate-20260705-batch
Jul 6, 2026
Merged

docs(cndocs): sync admonition title syntax#1037
sunnylqm merged 1 commit into
productionfrom
auto-translate-20260705-batch

Conversation

@sunnylqm

@sunnylqm sunnylqm commented Jul 5, 2026

Copy link
Copy Markdown

Summary

  • Synced current cndocs/* candidates whose upstream source changed to Docusaurus bracket admonition-title syntax (:::warning[Title]).
  • Updated 24 Chinese docs, primarily admonition title syntax; also fixed the stale VirtualizedList.disableVirtualization deprecation note to use an admonition block.
  • Re-checked the remaining candidates from scripts/sync-translations.sh; removed-component stubs and other unchanged files were left untouched when already aligned.
  • Synced the latest website/src/components/Home/Community wordmark-based community section into cnwebsite, preserving CN site wording and adding the required showcase wordmark assets/types.
  • No website/package.json/cnwebsite/package.json dependency version changes were needed for this batch; the upstream merge only changed yarn.lock for the English website dependency graph, so no CN package file was committed.

Verification

  • git fetch origin && git fetch upstream
  • git checkout production && git pull --ff-only origin production
  • git merge upstream/main
  • git push origin production
  • bash scripts/sync-translations.sh
  • yarn install
  • yarn --cwd cnwebsite build (passes; existing unresolved-link / HTML-minifier warnings remain in old versioned docs)
  • Re-ran yarn --cwd cnwebsite build after commit hook formatting; still passes with the same pre-existing warnings.

Summary by CodeRabbit

  • New Features

    • 首页社区区域新增精选应用展示和合作伙伴 लोगो/标识展示,支持跳转查看更多内容。
    • 社区相关内容更新为更完整的本地化展示,并提供更多入口了解生态。
  • Documentation

    • 多篇文档的提示/警告样式统一更新,提升阅读一致性与渲染效果。
    • 部分表格与说明格式优化,内容更清晰、更易浏览。

@netlify

netlify Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deploy Preview for reactnativecn failed. Why did it fail? →

Name Link
🔨 Latest commit d3c398e
🔍 Latest deploy log https://app.netlify.com/projects/reactnativecn/deploys/6a4a3e8cf698940008c1e7cd

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates Docusaurus warning admonition syntax from space-delimited (:::warning Label) to bracketed (:::warning[Label]) form across numerous cndocs files, with minor table reformatting. Separately, it redesigns the cnwebsite Community section, adding a PartnersShowcase component, showcase types, config wiring, and CSS.

Changes

cndocs admonition syntax and formatting updates

Layer / File(s) Summary
Bracketed warning admonition syntax across docs
cndocs/accessibilityinfo.md, cndocs/backhandler.md, cndocs/building-for-tv.md, cndocs/global-Performance*.md, cndocs/global-intersectionobserver*.md, cndocs/integration-with-android-fragment.md, cndocs/interactionmanager.md, cndocs/modal.md, cndocs/network.md, cndocs/other-debugging-methods.md, cndocs/progressbarandroid.md, cndocs/safeareaview.md, cndocs/security.md, cndocs/statusbar.md, cndocs/stylesheet.md, cndocs/textinput.md, cndocs/timers.md, cndocs/transforms.md, cndocs/virtualizedlist.md
Converts :::warning Label admonitions to :::warning[Label] bracketed syntax across deprecation, partial-support, and caution callouts; virtualizedlist.md also updates the deprecation wording for disableVirtualization.
Table reformatting and emphasis syntax changes
cndocs/pushnotificationios.md, cndocs/security.md
Reformats parameter/comparison tables' column spacing and switches an emphasis marker from underscore to asterisk, alongside the same warning syntax update.

Estimated code review effort: 2 (Simple) | ~15 minutes

Community section redesign with PartnersShowcase

Layer / File(s) Summary
Showcase types and site config wiring
cnwebsite/src/types/index.d.ts, cnwebsite/docusaurus.config.ts
Adds ShowcaseApp, ShowcaseData, and PartnerLink types, and imports users from showcase.json into config.customFields.users.
PartnersShowcase component
cnwebsite/src/components/Home/Community/PartnersShowcase.tsx
Adds a PARTNERS constant, a PartnersShowcase component that shuffles and renders partner logo links, and a shuffleItems randomization helper.
Community index component redesign
cnwebsite/src/components/Home/Community/index.tsx
Derives pinned apps from siteConfig.customFields?.users typed as ShowcaseData, and replaces the rendered layout with a localized Chinese section including PartnersShowcase and new secondary buttons.
Community and partners CSS
cnwebsite/src/components/Home/Community/styles.module.css
Simplifies .featureContainer and adds .appList, .partnersContainer, .communityNote, .secondaryButton, and .buttonGroup styles with responsive breakpoints.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Community
  participant siteConfig
  participant PartnersShowcase
  participant shuffleItems
  Community->>siteConfig: read customFields.users
  Community->>Community: filter apps by pinned
  Community->>PartnersShowcase: render component
  PartnersShowcase->>shuffleItems: shuffle PARTNERS on mount
  shuffleItems-->>PartnersShowcase: shuffled partner list
  PartnersShowcase-->>Community: rendered partner links
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: syncing Docusaurus admonition title syntax in the Chinese docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch auto-translate-20260705-batch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🧹 Nitpick comments (3)
cnwebsite/src/components/Home/Community/PartnersShowcase.tsx (2)

66-68: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

sort with a random comparator is not a uniform shuffle.

(() => 0.5 - Math.random()) is a well-known non-uniform, engine-dependent "shuffle" anti-pattern. For a cosmetic partner list ordering the risk is negligible, but a Fisher–Yates shuffle is the correct/idiomatic approach if precision matters.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cnwebsite/src/components/Home/Community/PartnersShowcase.tsx` around lines 66
- 68, The shuffleItems helper in PartnersShowcase uses a random sort comparator,
which produces a non-uniform, engine-dependent shuffle. Replace that logic with
a proper Fisher–Yates shuffle inside shuffleItems so the PartnerLink array is
randomized correctly and consistently while preserving the existing function
contract.

52-61: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Partner links lack an accessible name.

Each <a> renders only an SVG wordmark with no aria-label/visible text; screen readers may announce nothing meaningful for these links.

♿ Proposed fix
 const PARTNERS = [
   {
     href: 'https://callstack.com/',
+    name: 'Callstack',
     logo: <CallstackWordmark />,
   },
   ...
 ];
...
       {partners.map(({href, className, logo}) => (
         <a
           key={href}
           href={href}
           target="_blank"
           rel="noopener noreferrer"
+          aria-label={name}
           className={className}>
           {logo}
         </a>
       ))}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cnwebsite/src/components/Home/Community/PartnersShowcase.tsx` around lines 52
- 61, The partner links rendered in PartnersShowcase lack an accessible name
because each anchor only contains a logo SVG with no text. Update the
partners.map block in PartnersShowcase so each <a> gets a meaningful accessible
label, either by adding an aria-label derived from the partner name or by
including hidden descriptive text alongside the logo. Make sure the fix is
applied to the link rendering logic using the href/className/logo mapping so
screen readers can identify each partner link.
cnwebsite/src/components/Home/Community/styles.module.css (1)

56-58: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Grid column count is hardcoded to match the current 5 partners.

grid-template-columns: 1fr 1fr 1fr 1fr 1fr hardcodes 5 columns to match PARTNERS.length in PartnersShowcase.tsx. Adding/removing a partner later requires remembering to update this CSS too.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cnwebsite/src/components/Home/Community/styles.module.css` around lines 56 -
58, The partners grid in partnersContainer is hardcoded to five columns, which
must stay in sync with PartnersShowcase and PARTNERS.length. Update the styling
so the layout adapts automatically to the number of partner items instead of
relying on a fixed 5-column template; use a responsive grid pattern in
styles.module.css that scales with available space and avoids manual updates
when partners are added or removed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cnwebsite/src/components/Home/Community/index.tsx`:
- Around line 20-22: The `apps` initialization in `Community/index.tsx` is
force-casting `siteConfig.customFields?.users` to `ShowcaseData` and passing it
straight into `Object.values`, which can still blow up if `users` is missing.
Update that expression to safely handle an absent value by defaulting to an
empty object/array before calling `Object.values`, and keep the `apps` filtering
logic intact.
- Around line 38-56: `Community` is calling `useBaseUrl` inside the `apps.map()`
callback, which violates the Rules of Hooks. Move the base URL handling to the
top level of the `Community` component, then reuse that computed value when
building `imgSource` inside the map. Keep the hook call out of the loop and
reference the existing `useBaseUrl` usage in `Community` to locate the fix.

---

Nitpick comments:
In `@cnwebsite/src/components/Home/Community/PartnersShowcase.tsx`:
- Around line 66-68: The shuffleItems helper in PartnersShowcase uses a random
sort comparator, which produces a non-uniform, engine-dependent shuffle. Replace
that logic with a proper Fisher–Yates shuffle inside shuffleItems so the
PartnerLink array is randomized correctly and consistently while preserving the
existing function contract.
- Around line 52-61: The partner links rendered in PartnersShowcase lack an
accessible name because each anchor only contains a logo SVG with no text.
Update the partners.map block in PartnersShowcase so each <a> gets a meaningful
accessible label, either by adding an aria-label derived from the partner name
or by including hidden descriptive text alongside the logo. Make sure the fix is
applied to the link rendering logic using the href/className/logo mapping so
screen readers can identify each partner link.

In `@cnwebsite/src/components/Home/Community/styles.module.css`:
- Around line 56-58: The partners grid in partnersContainer is hardcoded to five
columns, which must stay in sync with PartnersShowcase and PARTNERS.length.
Update the styling so the layout adapts automatically to the number of partner
items instead of relying on a fixed 5-column template; use a responsive grid
pattern in styles.module.css that scales with available space and avoids manual
updates when partners are added or removed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d70b70c6-8cbd-402b-bd9f-71f7a65d5830

📥 Commits

Reviewing files that changed from the base of the PR and between 4090660 and d3c398e.

⛔ Files ignored due to path filters (5)
  • cnwebsite/static/img/showcase/callstack_wordmark.svg is excluded by !**/*.svg
  • cnwebsite/static/img/showcase/expo-wordmark.svg is excluded by !**/*.svg
  • cnwebsite/static/img/showcase/infinite-red-wordmark.svg is excluded by !**/*.svg
  • cnwebsite/static/img/showcase/microsoft-wordmark.svg is excluded by !**/*.svg
  • cnwebsite/static/img/showcase/swm-wordmark.svg is excluded by !**/*.svg
📒 Files selected for processing (29)
  • cndocs/accessibilityinfo.md
  • cndocs/backhandler.md
  • cndocs/building-for-tv.md
  • cndocs/global-PerformanceEventTiming.md
  • cndocs/global-PerformanceLongTaskTiming.md
  • cndocs/global-PerformanceResourceTiming.md
  • cndocs/global-intersectionobserver.md
  • cndocs/global-intersectionobserverentry.md
  • cndocs/global-performance.md
  • cndocs/integration-with-android-fragment.md
  • cndocs/interactionmanager.md
  • cndocs/modal.md
  • cndocs/network.md
  • cndocs/other-debugging-methods.md
  • cndocs/progressbarandroid.md
  • cndocs/pushnotificationios.md
  • cndocs/safeareaview.md
  • cndocs/security.md
  • cndocs/statusbar.md
  • cndocs/stylesheet.md
  • cndocs/textinput.md
  • cndocs/timers.md
  • cndocs/transforms.md
  • cndocs/virtualizedlist.md
  • cnwebsite/docusaurus.config.ts
  • cnwebsite/src/components/Home/Community/PartnersShowcase.tsx
  • cnwebsite/src/components/Home/Community/index.tsx
  • cnwebsite/src/components/Home/Community/styles.module.css
  • cnwebsite/src/types/index.d.ts

Comment on lines +20 to +22
const apps = Object.values(siteConfig.customFields?.users as ShowcaseData)
.flat()
.filter(app => app.pinned);
.filter(app => Boolean(app.pinned));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Optional-chained value is force-cast then dereferenced without a null check.

siteConfig.customFields?.users is optionally chained (acknowledging it may be absent), but the as ShowcaseData cast silences the type checker and Object.values(...) is called directly on the result. If customFields.users is ever missing/undefined at runtime, this throws (Object.values rejects null/undefined).

🛡️ Proposed fix
-  const apps = Object.values(siteConfig.customFields?.users as ShowcaseData)
+  const apps = Object.values(
+    (siteConfig.customFields?.users as ShowcaseData) ?? {},
+  )
     .flat()
     .filter(app => Boolean(app.pinned));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const apps = Object.values(siteConfig.customFields?.users as ShowcaseData)
.flat()
.filter(app => app.pinned);
.filter(app => Boolean(app.pinned));
const apps = Object.values(
(siteConfig.customFields?.users as ShowcaseData) ?? {},
)
.flat()
.filter(app => Boolean(app.pinned));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cnwebsite/src/components/Home/Community/index.tsx` around lines 20 - 22, The
`apps` initialization in `Community/index.tsx` is force-casting
`siteConfig.customFields?.users` to `ShowcaseData` and passing it straight into
`Object.values`, which can still blow up if `users` is missing. Update that
expression to safely handle an absent value by defaulting to an empty
object/array before calling `Object.values`, and keep the `apps` filtering logic
intact.

Comment on lines +38 to +56
{apps.map((app, i) => {
const imgSource = !app.icon.startsWith('http')
? useBaseUrl('img/showcase/' + app.icon)
: app.icon;
return (
<li key={i} className="item">
{app.infoLink ? (
<a
href={app.infoLink}
target="_blank"
rel="noopener noreferrer">
<img src={imgSource} alt={app.name} />
)}
</li>
);
})}
</ul>
<p>
and <a href={useBaseUrl(`showcase`)}>many more</a>.
</p>
</div>
</a>
) : (
<img src={imgSource} alt={app.name} />
)}
</li>
);
})}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the referenced component and any useBaseUrl definitions/usages.
git ls-files 'cnwebsite/src/components/Home/Community/index.tsx' 'cnwebsite/src/**' | sed -n '1,200p'

printf '\n--- useBaseUrl references ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' '\buseBaseUrl\b' cnwebsite/src

printf '\n--- community component excerpt ---\n'
sed -n '1,140p' cnwebsite/src/components/Home/Community/index.tsx

Repository: reactnativecn/react-native-website

Length of output: 8330


Hoist useBaseUrl out of the .map() callback
useBaseUrl is a hook, so calling it inside the array callback breaks the Rules of Hooks. Move the base path computation to the component top level and reuse it in the loop.

🔧 Proposed fix
+  const baseUrl = useBaseUrl('img/showcase/');
   {apps.map((app, i) => {
-    const imgSource = !app.icon.startsWith('http')
-      ? useBaseUrl('img/showcase/' + app.icon)
-      : app.icon;
+    const imgSource = !app.icon.startsWith('http')
+      ? baseUrl + app.icon
+      : app.icon;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{apps.map((app, i) => {
const imgSource = !app.icon.startsWith('http')
? useBaseUrl('img/showcase/' + app.icon)
: app.icon;
return (
<li key={i} className="item">
{app.infoLink ? (
<a
href={app.infoLink}
target="_blank"
rel="noopener noreferrer">
<img src={imgSource} alt={app.name} />
)}
</li>
);
})}
</ul>
<p>
and <a href={useBaseUrl(`showcase`)}>many more</a>.
</p>
</div>
</a>
) : (
<img src={imgSource} alt={app.name} />
)}
</li>
);
})}
const baseUrl = useBaseUrl('img/showcase/');
{apps.map((app, i) => {
const imgSource = !app.icon.startsWith('http')
? baseUrl + app.icon
: app.icon;
return (
<li key={i} className="item">
{app.infoLink ? (
<a
href={app.infoLink}
target="_blank"
rel="noopener noreferrer">
<img src={imgSource} alt={app.name} />
</a>
) : (
<img src={imgSource} alt={app.name} />
)}
</li>
);
})}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cnwebsite/src/components/Home/Community/index.tsx` around lines 38 - 56,
`Community` is calling `useBaseUrl` inside the `apps.map()` callback, which
violates the Rules of Hooks. Move the base URL handling to the top level of the
`Community` component, then reuse that computed value when building `imgSource`
inside the map. Keep the hook call out of the loop and reference the existing
`useBaseUrl` usage in `Community` to locate the fix.

@sunnylqm sunnylqm merged commit 9365877 into production Jul 6, 2026
1 of 5 checks passed
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.

1 participant