-
Notifications
You must be signed in to change notification settings - Fork 59.3k
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
✨ feat(config): Config the font-family of chat content #5179
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 offontFamily
property toDEFAULT_CONFIG
.The new
fontFamily
property 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 ofFontFamily
section to the Norwegian locale configuration.The new
FontFamily
section 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 ofFontFamily
section to the Korean locale configuration.The new
FontFamily
section 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 thefontFamily
style 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 thefontFamily
property 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! ThefontFamily
style 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 newFontFamily
section 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
FontFamily
object 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
FontFamily
object 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
FontFamily
object 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
FontFamily
section look correct and consistent with the rest of the file. TheTitle
,SubTitle
, andPlaceholder
properties are appropriately translated.app/locales/ru.ts (1)
74-79
: Translation and consistency check for FontFamily section.The translations for the
FontFamily
section look correct and consistent with the rest of the file. TheTitle
,SubTitle
, andPlaceholder
properties are appropriately translated.app/locales/jp.ts (1)
121-126
: Translation and consistency check for FontFamily section.The translations for the
FontFamily
section look correct and consistent with the rest of the file. TheTitle
,SubTitle
, andPlaceholder
properties are appropriately translated.app/locales/de.ts (1)
74-79
: LGTM!The
FontFamily
section is correctly added and translated.app/locales/ar.ts (1)
114-118
: LGTM!The
FontFamily
section is correctly added and translated.app/locales/bn.ts (1)
139-144
: LGTM!The
FontFamily
section is correctly added and translated.app/locales/fr.ts (1)
114-119
: Accurate translations and consistent formatting.The translations for the
FontFamily
section 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
FontFamily
section 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
FontFamily
section 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 forFontFamily
object.The translations for
Title
,SubTitle
, andPlaceholder
appear 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 forFontFamily
object.The translations for
Title
,SubTitle
, andPlaceholder
appear 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 forFontFamily
object.The translations for
Title
,SubTitle
, andPlaceholder
appear 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
FontFamily
are 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
fontFamily
property is correctly added to theMarkdown
component, 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.fontFamily
state, enabling real-time updates via theonChange
event handler.app/components/chat.tsx (4)
735-735
: InitializefontFamily
variable.The
fontFamily
variable is correctly initialized from the configuration.
1486-1486
: ApplyfontFamily
toMarkdown
component.The
fontFamily
variable is correctly applied to theMarkdown
component, allowing for the customization of the font family in chat messages.
1581-1581
: ApplyfontFamily
to chat input textarea.The
fontFamily
variable 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 theChat
function.The
Chat
function is unchanged and correctly wraps the_Chat
component.
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