✨ feat(config): Config the font-family of chat content#5179
✨ feat(config): Config the font-family of chat content#5179Dogtiti merged 2 commits intoChatGPTNextWeb:mainfrom
Conversation
Note: The language is translated by GPT
|
@frostime is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe recent updates introduce a customizable Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SettingsComponent
participant Config
participant ChatComponent
User->>SettingsComponent: Specifies fontFamily
SettingsComponent->>Config: Updates fontFamily
Config->>ChatComponent: Applies new fontFamily setting
ChatComponent->>User: Renders chat with custom font
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (25)
- app/components/chat.tsx (3 hunks)
- app/components/exporter.tsx (1 hunks)
- app/components/markdown.tsx (2 hunks)
- app/components/settings.tsx (1 hunks)
- app/locales/ar.ts (1 hunks)
- app/locales/bn.ts (1 hunks)
- app/locales/cn.ts (1 hunks)
- app/locales/cs.ts (1 hunks)
- app/locales/de.ts (1 hunks)
- app/locales/en.ts (1 hunks)
- app/locales/es.ts (1 hunks)
- app/locales/fr.ts (1 hunks)
- app/locales/id.ts (2 hunks)
- app/locales/it.ts (1 hunks)
- app/locales/jp.ts (1 hunks)
- app/locales/ko.ts (1 hunks)
- app/locales/no.ts (1 hunks)
- app/locales/pt.ts (1 hunks)
- app/locales/ru.ts (1 hunks)
- app/locales/sk.ts (1 hunks)
- app/locales/tr.ts (1 hunks)
- app/locales/tw.ts (1 hunks)
- app/locales/vi.ts (1 hunks)
- app/store/config.ts (1 hunks)
- app/utils.ts (1 hunks)
Additional comments not posted (29)
app/store/config.ts (1)
36-36: Addition offontFamilyproperty toDEFAULT_CONFIG.The new
fontFamilyproperty allows customization of the font used in the application. This enhances the flexibility of the configuration settings without altering the existing logic or control flow.app/locales/no.ts (1)
69-74: Addition ofFontFamilysection to the Norwegian locale configuration.The new
FontFamilysection includes a title, subtitle, and placeholder for the font family settings related to chat content. This addition enhances the locale's functionality by allowing users to specify a font type for chat content.app/locales/ko.ts (1)
75-79: Addition ofFontFamilysection to the Korean locale configuration.The new
FontFamilysection includes a title, subtitle, and placeholder for the font family settings related to chat content. This addition enhances the locale's functionality by allowing users to specify a font type for chat content.app/utils.ts (1)
197-197: LGTM! The addition of thefontFamilystyle improves visual consistency.The code change ensures that the measured text reflects the same font family as the input text area.
app/components/markdown.tsx (2)
235-235: LGTM! The addition of thefontFamilyproperty enhances customization options.The default value of
"inherit"ensures that the component inherits the font from the parent element if no custom font is provided.
247-247: LGTM! ThefontFamilystyle is correctly implemented in the component's inline style.This ensures that the custom font is applied to the rendered Markdown component.
app/locales/cs.ts (1)
74-79: LGTM! The newFontFamilysection enhances localization capabilities.The entries are correctly added and translated, allowing users to set and customize the font used in chat content.
app/locales/vi.ts (1)
74-79: Localization strings for FontFamily look good.The new
FontFamilyobject is correctly localized and consistent with the rest of the file.app/locales/tr.ts (1)
74-79: Localization strings for FontFamily look good.The new
FontFamilyobject is correctly localized and consistent with the rest of the file.app/locales/it.ts (1)
74-79: Localization strings for FontFamily look good.The new
FontFamilyobject is correctly localized and consistent with the rest of the file.app/locales/es.ts (1)
74-79: Translation and consistency check for FontFamily section.The translations for the
FontFamilysection look correct and consistent with the rest of the file. TheTitle,SubTitle, andPlaceholderproperties are appropriately translated.app/locales/ru.ts (1)
74-79: Translation and consistency check for FontFamily section.The translations for the
FontFamilysection look correct and consistent with the rest of the file. TheTitle,SubTitle, andPlaceholderproperties are appropriately translated.app/locales/jp.ts (1)
121-126: Translation and consistency check for FontFamily section.The translations for the
FontFamilysection look correct and consistent with the rest of the file. TheTitle,SubTitle, andPlaceholderproperties are appropriately translated.app/locales/de.ts (1)
74-79: LGTM!The
FontFamilysection is correctly added and translated.app/locales/ar.ts (1)
114-118: LGTM!The
FontFamilysection is correctly added and translated.app/locales/bn.ts (1)
139-144: LGTM!The
FontFamilysection is correctly added and translated.app/locales/fr.ts (1)
114-119: Accurate translations and consistent formatting.The translations for the
FontFamilysection are accurate and consistent with the rest of the file. The formatting is also correct.app/locales/id.ts (1)
143-148: Accurate translations and consistent formatting.The translations for the
FontFamilysection are accurate and consistent with the rest of the file. The formatting is also correct.app/locales/tw.ts (1)
156-160: Accurate translations and consistent formatting.The translations for the
FontFamilysection are accurate and consistent with the rest of the file. The formatting is also correct.app/locales/cn.ts (1)
159-163: Translation and consistency check forFontFamilyobject.The translations for
Title,SubTitle, andPlaceholderappear accurate and consistent with the rest of the file. The addition is well-integrated.app/locales/pt.ts (1)
156-161: Translation and consistency check forFontFamilyobject.The translations for
Title,SubTitle, andPlaceholderappear accurate and consistent with the rest of the file. The addition is well-integrated.app/locales/sk.ts (1)
158-163: Translation and consistency check forFontFamilyobject.The translations for
Title,SubTitle, andPlaceholderappear accurate and consistent with the rest of the file. The addition is well-integrated.app/locales/en.ts (1)
161-166: Add new locale entries for FontFamilyThe new locale entries for
FontFamilyare correctly added, providing a title, subtitle, and placeholder for the font family setting.app/components/exporter.tsx (1)
586-586: Add fontFamily property to Markdown componentThe
fontFamilyproperty is correctly added to theMarkdowncomponent, allowing customization of the font family for the rendered text.app/components/settings.tsx (1)
1319-1334: Add input field for configuring font familyThe new input field for configuring the font family is correctly added, including a title, subtitle, and placeholder sourced from localization constants. The input field is bound to the
config.fontFamilystate, enabling real-time updates via theonChangeevent handler.app/components/chat.tsx (4)
735-735: InitializefontFamilyvariable.The
fontFamilyvariable is correctly initialized from the configuration.
1486-1486: ApplyfontFamilytoMarkdowncomponent.The
fontFamilyvariable is correctly applied to theMarkdowncomponent, allowing for the customization of the font family in chat messages.
1581-1581: ApplyfontFamilyto chat input textarea.The
fontFamilyvariable is correctly applied to the chat input textarea, allowing for the customization of the font family in the input field.
Line range hint
1598-1601: No changes in theChatfunction.The
Chatfunction is unchanged and correctly wraps the_Chatcomponent.
|
Your build has completed! |
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
font-family字段来设置对话字体📝 补充信息 | Additional Information
实现方案和
fontSize相同,均是给 Markdown 组件添加内联属性;如果设置的fontFamily为空,则默认使用inherit。效果如下:
Summary by CodeRabbit
New Features
Bug Fixes
Documentation