Skip to content

feat: init rsc support for translation#18

Open
tomerqodo wants to merge 12 commits intosentry_only-issues-20260113-augment-codex-sentry_base_feat_init_rsc_support_for_translation_pr169from
sentry_only-issues-20260113-augment-codex-sentry_head_feat_init_rsc_support_for_translation_pr169
Open

feat: init rsc support for translation#18
tomerqodo wants to merge 12 commits intosentry_only-issues-20260113-augment-codex-sentry_base_feat_init_rsc_support_for_translation_pr169from
sentry_only-issues-20260113-augment-codex-sentry_head_feat_init_rsc_support_for_translation_pr169

Conversation

@tomerqodo
Copy link

Benchmark PR from qodo-benchmark#169

Comment on lines +3 to +8
const Description = () => {
const { t } = useTranslation('plugin')
const { t: tCommon } = useTranslation('common')
const locale = useLocale()

const isZhHans = locale === 'zh-Hans'
Copy link

Choose a reason for hiding this comment

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

Bug: The Settings page is a Server Component but incorrectly calls the useTranslation() hook, which is only allowed in Client Components and will cause a runtime error.
Severity: CRITICAL

Suggested Fix

Add the 'use client' directive to the top of the Settings page file (page.tsx). This will correctly designate it as a Client Component, allowing it to use hooks like useTranslation() as intended.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: web/app/components/plugins/marketplace/description/index.tsx#L3-L8

Potential issue: The Settings page component, located at
`web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/settings/page.tsx`,
is a Next.js Server Component as it lacks a `'use client'` directive. However, the code
directly calls the `useTranslation()` hook within this component. This is a violation of
a fundamental React rule that prohibits the use of hooks inside Server Components. This
will cause a runtime error when a user attempts to access the settings page, making it
non-functional.

Did we get this right? 👍 / 👎 to inform future reviews.

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.

2 participants