Conversation
…o ChatGPTNextWeb-main
|
@EricYangValtech is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThis update introduces a new introductory note in the README, updates repository ownership constants, and refines code formatting across several files for clarity and consistency. It also adjusts the default model list, enhances chat UI styles, modifies chat message rendering to display message dates, and updates configuration defaults based on the user's platform. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ChatUI
participant ConfigStore
User->>ChatUI: Send message
ChatUI->>ChatUI: Render message
ChatUI-->>User: Display message content
alt Message is not from user and not preview
ChatUI-->>User: Display message date in actions wrapper
end
ChatUI->>ConfigStore: Get submitKey default
ConfigStore->>ConfigStore: Detect platform (isMacOS)
ConfigStore-->>ChatUI: Return platform-specific submitKey
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (5)
README.md (2)
1-2: Refine the heading for clarity.The markdown heading
# attention pleasecould be more descriptive and follow title case. Consider something like:# Project Fork Noticeor capitalize properly:
# Attention Please
3-3: Improve grammar and phrasing.The new introductory sentence is verbose and contains grammatical issues:
- “hard working” should be hyphenated (“hard-working”) or replaced with “hard work”.
- A comma is needed before “and finally”.
- The flow can be tightened for clarity.
Suggested rewrite:
This project is a personal fork of ChatGPT-Next-Web. Thanks to the hard work of Yidadaa and other contributors, I now have my own ChatGPT assistant. I’d also like to thank Vercel for their fast, reliable deployment platform.
🧰 Tools
🪛 LanguageTool
[grammar] ~3-~3: This adjective is spelled with a hyphen or as one word.
Context: ...com/Yidadaa) and some other developers' hard working and finally I have my own ChatGPT assis...(HARD_WORKING_COMPOUND)
[uncategorized] ~3-~3: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... and some other developers' hard working and finally I have my own ChatGPT assistant...(COMMA_COMPOUND_SENTENCE)
[typographical] ~3-~3: Consider adding a comma after ‘finally’ for more clarity.
Context: ...some other developers' hard working and finally I have my own ChatGPT assistant now. Al...(RB_LY_COMMA)
app/client/platforms/google.ts (1)
187-238: Improved stream processing with better readability and error handling.The refactoring enhances code readability by breaking up the promise chain across multiple lines and improves error handling for non-200 responses. The nested try-catch block for JSON parsing now properly suppresses parsing errors.
Consider using the optional chaining operator as suggested by the static analysis to simplify the error handling condition:
- if (data && data[0].error) { + if (data?.[0]?.error) { options.onError?.(new Error(data[0].error.message));🧰 Tools
🪛 Biome (1.9.4)
[error] 194-194: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
app/components/home.module.scss (1)
326-558: Addition of comprehensive chat UI stylingThe addition of these extensive styles enhances the chat interface with proper layout, spacing, and visual feedback.
However, there are a few best practices that could be incorporated:
- Consider extracting common values (colors, spacing, border-radius) into CSS variables for consistency
- Some selectors are quite specific and could be simplified for better maintainability
- Consider adding dark theme support for elements with hardcoded colors (like background-color: rgba(0, 0, 0, 0.05))
For example:
.chat-message-item { box-sizing: border-box; max-width: 100%; margin-top: 10px; - border-radius: 10px; - background-color: rgba(0, 0, 0, 0.05); + border-radius: var(--message-border-radius, 10px); + background-color: var(--message-background, rgba(0, 0, 0, 0.05)); padding: 10px; font-size: 14px; user-select: text; word-break: break-word; border: var(--border-in-light); position: relative; }app/components/chat.tsx (1)
1464-1470:Details
❓ Verification inconclusive
Added additional date display for bot messages.
This change adds a second date display specifically for non-user (bot) messages and non-preview messages, outside the main message container. Note that there's already a date display at line 1458 inside the container, which might create duplication.
If this additional display is intentional per design requirements (perhaps for different styling or positioning), this looks good. Otherwise, consider removing one of the date displays to avoid duplication.
🏁 Script executed:
#!/bin/bash # Check if there are any styling differences between the two date displays grep -r "chat-message-action-date" --include="*.scss" --include="*.css" .Length of output: 197
🏁 Script executed:
#!/bin/bash # Extract contexts for both date displays in chat.tsx to compare classes rg -n "chat-message-action-date" -C3 app/components/chat.tsx rg -n "chat-message-date" -C3 app/components/chat.tsxLength of output: 758
Verify duplicate date renders for bot messages
There are two identical date elements usingstyles["chat-message-action-date"]in app/components/chat.tsx:
- Inside the main message container (line 1458)
- Outside for non-user, non-preview messages (line 1466)
Both render the same timestamp with the same styling. If this is intentional for differing layouts, it’s fine; otherwise, remove the redundant date to avoid duplication.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
README.md(1 hunks)app/api/anthropic/[...path]/route.ts(1 hunks)app/api/common.ts(2 hunks)app/api/google/[...path]/route.ts(1 hunks)app/api/webdav/[...path]/route.ts(1 hunks)app/client/api.ts(1 hunks)app/client/platforms/google.ts(3 hunks)app/components/chat.tsx(1 hunks)app/components/home.module.scss(3 hunks)app/components/new-chat.tsx(1 hunks)app/constant.ts(1 hunks)app/global.d.ts(1 hunks)app/layout.tsx(1 hunks)app/masks/index.ts(1 hunks)app/store/config.ts(2 hunks)app/store/sync.ts(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (5)
app/store/sync.ts (1)
app/utils/sync.ts (3)
AppState(49-53)mergeAppState(137-146)setLocalAppState(131-135)
app/store/config.ts (1)
app/utils.ts (1)
isMacOS(216-223)
app/masks/index.ts (4)
app/masks/typing.ts (1)
BuiltinMask(4-7)app/masks/cn.ts (1)
CN_MASKS(3-445)app/masks/tw.ts (1)
TW_MASKS(3-445)app/masks/en.ts (1)
EN_MASKS(3-134)
app/components/new-chat.tsx (1)
app/components/mask.tsx (1)
MaskAvatar(68-74)
app/client/platforms/google.ts (1)
app/constant.ts (2)
DEFAULT_API_HOST(11-11)
🪛 LanguageTool
README.md
[grammar] ~3-~3: This adjective is spelled with a hyphen or as one word.
Context: ...com/Yidadaa) and some other developers' hard working and finally I have my own ChatGPT assis...
(HARD_WORKING_COMPOUND)
[uncategorized] ~3-~3: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... and some other developers' hard working and finally I have my own ChatGPT assistant...
(COMMA_COMPOUND_SENTENCE)
[typographical] ~3-~3: Consider adding a comma after ‘finally’ for more clarity.
Context: ...some other developers' hard working and finally I have my own ChatGPT assistant now. Al...
(RB_LY_COMMA)
🪛 Biome (1.9.4)
app/client/platforms/google.ts
[error] 194-194: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
🔇 Additional comments (15)
app/global.d.ts (1)
24-24: Improved code formatting with consistent spacingThe addition of space after the
notification:key improves code style consistency in the interface declaration.app/layout.tsx (1)
39-42: Enhanced readability with multi-line formattingReformatting the viewport meta tag from a single line to multiple lines improves code readability while maintaining the same functionality. This aligns with best practices for JSX formatting.
app/store/sync.ts (2)
103-106: Improved code formatting with consistent styleThe console.log statement has been reformatted to use a consistent multi-line style, improving readability while maintaining the same functionality.
113-113: Consistent brace positioningThe closing brace has been properly aligned, maintaining consistent code style.
app/masks/index.ts (1)
25-29: Enhanced readability with multi-line array declarationThe BUILTIN_MASKS constant declaration has been reformatted to use a more readable multi-line style for the spread syntax. This improves code readability while maintaining identical functionality.
app/api/common.ts (2)
47-49: More concise arrow function syntaxThe setTimeout call has been refactored to use a cleaner, more concise arrow function syntax while maintaining the same timeout functionality.
112-121: Improved organization of OpenAI header handling logicThe code handling the OpenAI-Organization header has been reformatted with better comments and consistent indentation, making the logic more readable while maintaining the same functionality.
app/api/google/[...path]/route.ts (1)
35-37: Good refactoring to arrow function syntax.The setTimeout implementation has been updated to use a more concise arrow function syntax. This makes the code more readable and consistent with modern JavaScript/TypeScript practices while maintaining identical timeout functionality.
app/api/anthropic/[...path]/route.ts (1)
109-111: Good refactoring to arrow function syntax.The setTimeout implementation has been updated to use a more concise arrow function syntax. This change is consistent with the same refactoring applied to the Google API route handler, creating a uniform code style across API handlers.
app/api/webdav/[...path]/route.ts (1)
27-28: Good code style improvement.The code has been reformatted to place the arrow function and its parameter on a single line, improving readability while maintaining the same logic for validating WebDAV endpoints.
app/client/platforms/google.ts (1)
123-125: Good formatting improvement for readability.The string concatenation has been properly indented across multiple lines, making the code more readable while maintaining the same functionality.
app/components/home.module.scss (1)
42-42: Property consistency adjustmentChanged from
background-colortobackgroundwhich is more versatile as it can handle gradients, images, and colors.app/client/api.ts (1)
15-15:Details
❌ Incorrect review comment
Removal of GPT-4 from the supported models list
The export
Modelshas been modified to include only "gpt-3.5-turbo", removing "gpt-4" from the list of available models.This change restricts users from selecting GPT-4, which could impact functionality for those relying on this model. Consider:
- Was this intentional? If yes, ensure users are informed about this change
- If not, the GPT-4 model should be restored
-export const Models = ["gpt-3.5-turbo"] as const; +export const Models = ["gpt-3.5-turbo", "gpt-4"] as const;
🏁 Script executed:
#!/bin/bash # Look for places where Models is being used to understand the impact rg "Models\s*=" --type tsLength of output: 1132
🏁 Script executed:
#!/bin/bash # Find all references to the exported `Models` constant rg -n "\bModels\b" --type ts --type tsxLength of output: 69
🏁 Script executed:
#!/bin/bash # Search for all references to the `Models` constant across TS and TSX files rg -n "\bModels\b" -g "*.ts" -g "*.tsx" || true rg -n "import .*Models" -g "*.ts" -g "*.tsx" || trueLength of output: 687
No active usage of
Models—restoring GPT-4 here has no effectA search across all
.ts/.tsxfiles only found the definition inapp/client/api.tsand no imports or references elsewhere. This constant isn’t used to drive the UI or API, so adding or removing"gpt-4"here won’t change available models in practice.• Definition:
app/client/api.ts:15
• No otherModelsreferences in the codebaseYou can safely ignore the suggestion to restore GPT-4 in this file.
Likely an incorrect or invalid review comment.
app/store/config.ts (1)
10-10: Platform-specific submit key improvementThe default submit key configuration now adapts to the user's platform:
- Uses Meta+Enter for macOS users
- Uses Ctrl+Enter for non-macOS users
This is a good UX improvement that aligns with platform conventions.
The commented-out line 31 can be safely removed since it's been replaced by the new implementation.
- // submitKey: SubmitKey.MetaEnter as SubmitKey, - submitKey: isMacOS() ? SubmitKey.MetaEnter : SubmitKey.CtrlEnter, + submitKey: isMacOS() ? SubmitKey.MetaEnter : SubmitKey.CtrlEnter,Also applies to: 31-33
app/components/new-chat.tsx (1)
23-37: Props improvement in MaskItem componentThe component was refactored to pass specific props instead of the entire mask object:
- Previously: Passed the entire
maskobject toMaskAvatar- Now: Explicitly passes only
avatarandmodelpropertiesThis is a good improvement in component design, following the principle of passing only the required props.
The commented-out code (lines 24-30) can be safely removed as it's no longer needed.
- {/* <MaskAvatar mask={props.mask} /> - <div - className={styles["mask-name"] + " one-line"} - title={props.mask.name} - > - {props.mask.name} - </div> */}
| export const OWNER = "EricYangXD"; | ||
| export const REPO = "ChatGPT-Next"; |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Updated repository owner and name: verify all references.
You’ve correctly changed OWNER to "EricYangXD" and REPO to "ChatGPT-Next", which will propagate to all derived URLs (REPO_URL, ISSUE_URL, etc.). Please ensure there are no remaining hardcoded references to the old owner/repo elsewhere (e.g., in docs, CI workflows, or deployment scripts) to avoid broken links.
To search for any lingering occurrences, you can run:
🏁 Script executed:
#!/bin/bash
rg -F "Yidadaa/ChatGPT-Next-Web"Length of output: 7476
Hardcoded old repository references need updating
Several occurrences of Yidadaa/ChatGPT-Next-Web remain and must be changed to EricYangXD/ChatGPT-Next to avoid broken links:
• README.md (project intro, badges, download URLs, issue / PR links)
• README_CN.md, README_EN.md and other localized READMEs
• docs/faq-.md, docs/vercel-.md, docs/user-manual-cn.md (links in instructions and related-discussion refs)
• app/components/exporter.tsx
• app/client/api.ts
Example changes in code files:
app/components/exporter.tsx
- github.com/Yidadaa/ChatGPT-Next-Web
+ github.com/EricYangXD/ChatGPT-Nextapp/client/api.ts
- "Share from [NextChat]: https://github.com/Yidadaa/ChatGPT-Next-Web",
+ "Share from [NextChat]: https://github.com/EricYangXD/ChatGPT-Next",Please update all remaining links and text references accordingly.
Committable suggestion skipped: line range outside the PR's diff.
| background-color: var(--white); | ||
| border: var(--border-in-light); | ||
| border-radius: 20px; | ||
| border-radius: 4px; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Review UI design consistency and responsiveness
The changes to the container mixin include:
- Reduced border-radius from 20px to 4px
- Changed background to a hardcoded light green color (#c7edcc)
- Increased minimum dimensions (800px width, 600px height)
- Added vendor prefixes for border-radius
While the vendor prefixes improve cross-browser compatibility, there are some concerns:
- The hardcoded color value (#c7edcc) might not respect the application's theming system. Consider using CSS variables for themeable colors.
- The increased minimum dimensions (800px width, 600px height) could cause layout issues on smaller screens.
- border-radius: 4px;
+ border-radius: var(--border-radius, 4px);
- background: #c7edcc; //rgb(199,237,204);//#7c9d42;// var(--white);
+ background: var(--container-background, #c7edcc);
- min-width: 800px;
- min-height: 600px;
+ min-width: var(--container-min-width, 700px);
+ min-height: var(--container-min-height, 550px);Also applies to: 6-8, 14-17
update
Summary by CodeRabbit
New Features
Style
Bug Fixes
Chores
Refactor