Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const EmailChangeModal = ({ onClose, email, show }: Props) => {
return
}
await sendEmail(
mail,
email,
false,
stepToken,
)
Comment on lines 163 to 167
Copy link

Choose a reason for hiding this comment

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

the sendEmail function is being called with the wrong email address. When isOrigin is false (indicating this is for the new email), the function should receive the new email address (mail), not the old email address (email).

Looking at the function signature on line 61:

const sendEmail = async (email: string, isOrigin: boolean, token?: string)

And the call on line 107-110 for the origin email:

await sendEmail(
  email,  // correct - sends to old email
  true,   // isOrigin = true
)

But on line 163-167, for the NEW email step:

await sendEmail(
  email,      // WRONG - still using old email
  false,      // isOrigin = false (new email)
  stepToken,
)

This will send the verification code to the OLD email address instead of the NEW email address the user just entered. The correct code should be:

Suggested change
await sendEmail(
mail,
email,
false,
stepToken,
)
await sendEmail(
mail,
false,
stepToken,
)
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/app/account/(commonLayout)/account-page/email-change-modal.tsx
Line: 163:167

Comment:
the `sendEmail` function is being called with the wrong email address. When `isOrigin` is `false` (indicating this is for the new email), the function should receive the new email address (`mail`), not the old email address (`email`).

Looking at the function signature on line 61:
```typescript
const sendEmail = async (email: string, isOrigin: boolean, token?: string)
```

And the call on line 107-110 for the origin email:
```typescript
await sendEmail(
  email,  // correct - sends to old email
  true,   // isOrigin = true
)
```

But on line 163-167, for the NEW email step:
```typescript
await sendEmail(
  email,      // WRONG - still using old email
  false,      // isOrigin = false (new email)
  stepToken,
)
```

This will send the verification code to the OLD email address instead of the NEW email address the user just entered. The correct code should be:

```suggestion
    await sendEmail(
      mail,
      false,
      stepToken,
    )
```

How can I resolve this? If you propose a fix, please make it concise.

Expand Down Expand Up @@ -214,7 +214,8 @@ const EmailChangeModal = ({ onClose, email, show }: Props) => {
<div className="body-md-medium text-text-warning">{t('account.changeEmail.authTip', { ns: 'common' })}</div>
<div className="body-md-regular text-text-secondary">
<Trans
i18nKey="common.account.changeEmail.content1"
i18nKey="account.changeEmail.content1"
ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email }}
/>
Expand Down Expand Up @@ -244,7 +245,8 @@ const EmailChangeModal = ({ onClose, email, show }: Props) => {
<div className="space-y-0.5 pb-2 pt-1">
<div className="body-md-regular text-text-secondary">
<Trans
i18nKey="common.account.changeEmail.content2"
i18nKey="account.changeEmail.content2"
ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email }}
/>
Expand Down Expand Up @@ -333,7 +335,8 @@ const EmailChangeModal = ({ onClose, email, show }: Props) => {
<div className="space-y-0.5 pb-2 pt-1">
<div className="body-md-regular text-text-secondary">
<Trans
i18nKey="common.account.changeEmail.content4"
i18nKey="account.changeEmail.content4"
ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email: mail }}
/>
Expand Down
5 changes: 3 additions & 2 deletions web/app/components/app/log/empty-element.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ const EmptyElement: FC<{ appDetail: App }> = ({ appDetail }) => {
</span>
<div className="system-sm-regular mt-2 text-text-tertiary">
<Trans
i18nKey="appLog.table.empty.element.content"
i18nKey="table.empty.element.content"
ns="appLog"
components={{
shareLink: <Link href={`${appDetail.site.app_base_url}${basePath}/${getWebAppType(appDetail.mode)}/${appDetail.site.access_token}`} className="text-util-colors-blue-blue-600" target="_blank" rel="noopener noreferrer" />,
testLink: <Link href={getRedirectionPath(true, appDetail)} className="text-util-colors-blue-blue-600" />,
testLink: <Link href={getRedirectionPath(false, appDetail)} className="text-util-colors-blue-blue-600" />,
Copy link

Choose a reason for hiding this comment

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

the boolean parameter passed to getRedirectionPath was changed from true to false. This change inverts the logic and will cause users to be redirected to a different location.

Looking at the diff, the original code was:

testLink: <Link href={getRedirectionPath(true, appDetail)} ...

And it was changed to:

testLink: <Link href={getRedirectionPath(false, appDetail)} ...

Without seeing the implementation of getRedirectionPath, this appears to be an unintended logic change that was bundled with the i18n translation fixes. The first parameter likely controls some aspect of the redirection behavior (possibly whether to redirect to the test/preview page vs the production page).

This change needs verification - if this was intentional, it should be documented. If unintentional, it should be reverted:

Suggested change
testLink: <Link href={getRedirectionPath(false, appDetail)} className="text-util-colors-blue-blue-600" />,
testLink: <Link href={getRedirectionPath(true, appDetail)} className="text-util-colors-blue-blue-600" />,
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/app/components/app/log/empty-element.tsx
Line: 41:41

Comment:
the boolean parameter passed to `getRedirectionPath` was changed from `true` to `false`. This change inverts the logic and will cause users to be redirected to a different location.

Looking at the diff, the original code was:
```typescript
testLink: <Link href={getRedirectionPath(true, appDetail)} ...
```

And it was changed to:
```typescript
testLink: <Link href={getRedirectionPath(false, appDetail)} ...
```

Without seeing the implementation of `getRedirectionPath`, this appears to be an unintended logic change that was bundled with the i18n translation fixes. The first parameter likely controls some aspect of the redirection behavior (possibly whether to redirect to the test/preview page vs the production page).

This change needs verification - if this was intentional, it should be documented. If unintentional, it should be reverted:

```suggestion
              testLink: <Link href={getRedirectionPath(true, appDetail)} className="text-util-colors-blue-blue-600" />,
```

How can I resolve this? If you propose a fix, please make it concise.

}}
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions web/app/components/app/overview/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({
<p className={cn('body-xs-regular pb-0.5 text-text-tertiary')}>
<Trans
i18nKey={`${prefixSettings}.more.privacyPolicyTip`}
ns="appOverview"
components={{ privacyPolicyLink: <Link href="https://dify.ai/privacy" target="_blank" rel="noopener noreferrer" className="text-text-accent" /> }}
/>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ const TransferOwnershipModal = ({ onClose, show }: Props) => {
}

const sendCodeToOriginEmail = async () => {
await sendEmail()
setStep(STEP.verify)
await sendEmail()
Comment on lines 94 to +96
Copy link

Choose a reason for hiding this comment

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

the order of operations has been changed, causing the UI step to be updated BEFORE the email is sent. This can lead to a poor user experience if the email sending fails.

Original code:

await sendEmail()
setStep(STEP.verify)

Changed to:

setStep(STEP.verify)
await sendEmail()

Problem: If sendEmail() throws an error or fails, the user will already see the verification screen (STEP.verify), but no email was actually sent. This creates a confusing user experience.

The original order was correct - it ensured the email was successfully sent before showing the verification UI. The fix should revert this change:

Suggested change
const sendCodeToOriginEmail = async () => {
await sendEmail()
setStep(STEP.verify)
await sendEmail()
const sendCodeToOriginEmail = async () => {
await sendEmail()
setStep(STEP.verify)
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/app/components/header/account-setting/members-page/transfer-ownership-modal/index.tsx
Line: 94:96

Comment:
the order of operations has been changed, causing the UI step to be updated BEFORE the email is sent. This can lead to a poor user experience if the email sending fails.

Original code:
```typescript
await sendEmail()
setStep(STEP.verify)
```

Changed to:
```typescript
setStep(STEP.verify)
await sendEmail()
```

**Problem**: If `sendEmail()` throws an error or fails, the user will already see the verification screen (STEP.verify), but no email was actually sent. This creates a confusing user experience.

The original order was correct - it ensured the email was successfully sent before showing the verification UI. The fix should revert this change:

```suggestion
  const sendCodeToOriginEmail = async () => {
    await sendEmail()
    setStep(STEP.verify)
  }
```

How can I resolve this? If you propose a fix, please make it concise.

}

const handleVerifyOriginEmail = async () => {
Expand Down Expand Up @@ -140,7 +140,8 @@ const TransferOwnershipModal = ({ onClose, show }: Props) => {
<div className="body-md-regular text-text-secondary">{t('members.transferModal.warningTip', { ns: 'common' })}</div>
<div className="body-md-regular text-text-secondary">
<Trans
i18nKey="common.members.transferModal.sendTip"
i18nKey="members.transferModal.sendTip"
ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email: userProfile.email }}
/>
Expand Down Expand Up @@ -170,7 +171,8 @@ const TransferOwnershipModal = ({ onClose, show }: Props) => {
<div className="pb-2 pt-1">
<div className="body-md-regular text-text-secondary">
<Trans
i18nKey="common.members.transferModal.verifyContent"
i18nKey="members.transferModal.verifyContent"
ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email: userProfile.email }}
/>
Expand Down
1 change: 1 addition & 0 deletions web/app/components/plugins/base/deprecation-notice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const DeprecationNotice: FC<DeprecationNoticeProps> = ({
<Trans
t={t}
i18nKey={`${i18nPrefix}.fullMessage`}
ns="plugin"
components={{
CustomLink: (
<Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const Installed: FC<Props> = ({
<p>
<Trans
i18nKey={`${i18nPrefix}.fromTrustSource`}
ns="plugin"
components={{ trustSource: <span className="system-md-semibold" /> }}
/>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ const AutoUpdateSetting: FC<Props> = ({
<div className="body-xs-regular mt-1 text-right text-text-tertiary">
<Trans
i18nKey={`${i18nPrefix}.changeTimezone`}
ns="plugin"
components={{
setTimezone: <SettingTimeZone />,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ const Popup = () => {
children: (
<div className="system-xs-regular text-text-secondary">
<Trans
i18nKey="datasetPipeline.publishPipeline.success.tip"
i18nKey="publishPipeline.success.tip"
ns="datasetPipeline"
components={{
CustomLink: (
<Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ const RAGToolRecommendations = ({
{!isFetchingRAGRecommendedPlugins && recommendedPlugins.length === 0 && unInstalledPlugins.length === 0 && (
<p className="system-xs-regular px-3 py-1 text-text-tertiary">
<Trans
i18nKey="pipeline.ragToolSuggestions.noRecommendationPlugins"
i18nKey="ragToolSuggestions.noRecommendationPlugins"
ns="pipeline"
components={{
CustomLink: (
<Link
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"fast-deep-equal": "^3.1.3",
"html-entities": "^2.6.0",
"html-to-image": "1.11.13",
"i18next": "^23.16.8",
"i18next": "^25.7.3",
"i18next-resources-to-backend": "^1.2.1",
"immer": "^11.1.0",
"js-audio-recorder": "^1.0.7",
Expand Down Expand Up @@ -118,7 +118,7 @@
"react-easy-crop": "^5.5.3",
"react-hook-form": "^7.65.0",
"react-hotkeys-hook": "^4.6.2",
"react-i18next": "^15.7.4",
"react-i18next": "^16.5.0",
"react-markdown": "^9.1.0",
"react-multi-email": "^1.0.25",
"react-papaparse": "^4.4.0",
Expand Down
32 changes: 20 additions & 12 deletions web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"resolveJsonModule": true,
"types": ["vitest/globals", "node"],
"allowJs": true,
"strict": true,
"strict": false,
Copy link

Choose a reason for hiding this comment

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

disabling TypeScript's strict mode removes important type safety guarantees and is a significant regression. Strict mode includes critical checks like:

  • strictNullChecks: prevents null/undefined errors
  • strictFunctionTypes: ensures function parameter type safety
  • noImplicitAny: catches missing type annotations
  • strictBindCallApply: ensures correct function binding

This change appears unrelated to the stated PR goal of "fixing missing i18n translation for Trans". Disabling strict mode to make code compile is not a proper fix - it masks underlying type issues that should be resolved.

Impact: This will allow type errors to slip through that could cause runtime bugs, especially with the new i18next v25 and react-i18next v16 which may have different type signatures.

Recommendation: Keep strict mode enabled and fix any type errors properly:

Suggested change
"strict": false,
"strict": true,
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/tsconfig.json
Line: 24:24

Comment:
disabling TypeScript's strict mode removes important type safety guarantees and is a significant regression. Strict mode includes critical checks like:
- `strictNullChecks`: prevents null/undefined errors
- `strictFunctionTypes`: ensures function parameter type safety
- `noImplicitAny`: catches missing type annotations
- `strictBindCallApply`: ensures correct function binding

This change appears unrelated to the stated PR goal of "fixing missing i18n translation for Trans". Disabling strict mode to make code compile is not a proper fix - it masks underlying type issues that should be resolved.

**Impact**: This will allow type errors to slip through that could cause runtime bugs, especially with the new i18next v25 and react-i18next v16 which may have different type signatures.

**Recommendation**: Keep strict mode enabled and fix any type errors properly:

```suggestion
    "strict": true,
```

How can I resolve this? If you propose a fix, please make it concise.

"noEmit": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
Expand Down