Skip to content

update#6477

Closed
EricYangXD wants to merge 60 commits intoChatGPTNextWeb:mainfrom
EricYangXD:main
Closed

update#6477
EricYangXD wants to merge 60 commits intoChatGPTNextWeb:mainfrom
EricYangXD:main

Conversation

@EricYangXD
Copy link
Copy Markdown

@EricYangXD EricYangXD commented May 6, 2025

update

Summary by CodeRabbit

  • New Features

    • Added display of message dates for non-user, non-preview messages in the chat interface.
    • Expanded and improved chat UI styles, including new layouts, avatars, message actions, and responsive design.
  • Style

    • Updated chat container and sidebar appearance with new colors and border radius.
    • Enhanced chat-related components with detailed SCSS for better user experience.
    • Improved formatting and readability in several files for consistent code style.
  • Bug Fixes

    • Improved error handling for streaming responses in the Google platform integration.
  • Chores

    • Updated repository owner and name constants to reflect the new project location.
    • Adjusted default submit key behavior based on operating system (macOS vs. others).
    • Added an introductory note to the README acknowledging original authors and deployment platform.
  • Refactor

    • Simplified and clarified code structure in multiple areas without changing functionality.
    • Reduced available models to only "gpt-3.5-turbo" in the model selection list.

EricYangXD and others added 30 commits April 5, 2023 18:50
actions-user and others added 26 commits June 13, 2023 01:25
@vercel
Copy link
Copy Markdown

vercel bot commented May 6, 2025

@EricYangValtech is attempting to deploy a commit to the NextChat Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 6, 2025

Walkthrough

This 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

File(s) Change Summary
README.md Added an introductory note acknowledging the project's fork origin, the original author, contributors, and Vercel. No technical or functional changes.
app/constant.ts Changed OWNER from "Yidadaa" to "EricYangXD" and REPO from "ChatGPT-Next-Web" to "ChatGPT-Next". Dependent URLs updated accordingly.
app/client/api.ts Reduced Models export from ["gpt-3.5-turbo", "gpt-4"] to ["gpt-3.5-turbo"]. Only gpt-3.5-turbo remains selectable.
app/components/home.module.scss Updated container mixin styles (border-radius, background, min sizes), changed sidebar background property, and added extensive new chat UI styles and mixins for various chat-related components.
app/components/chat.tsx Added conditional rendering to display the message date for non-user, non-preview messages within a new wrapper div.
app/components/new-chat.tsx Commented out the previous JSX block for mask display and replaced it with simplified, explicit rendering of avatar and name in the MaskItem component.
app/api/anthropic/[...path]/route.ts
app/api/google/[...path]/route.ts
Refactored setTimeout abort logic to single-line arrow function syntax. No logic changes.
app/api/common.ts Refactored setTimeout abort logic to single-line arrow function syntax; adjusted indentation of header extraction and logging; minor formatting tweaks. No logic changes.
app/api/webdav/[...path]/route.ts Reformatted endpoint validation condition to single-line arrow function. No logic changes.
app/client/platforms/google.ts Reformatted URL construction and stream handling; improved error handling for non-200 responses; added comments and nested try-catch for JSON parsing errors. No core logic changes.
app/store/config.ts Changed default submitKey to be platform-dependent: uses MetaEnter for macOS and CtrlEnter otherwise. Imported isMacOS utility. Added a commented-out line for reference.
app/global.d.ts Fixed formatting by adding a space after the notification: key in the Window.__TAURI__ interface. No functional changes.
app/layout.tsx Reformatted <meta name="viewport" /> tag for readability. No content or functional changes.
app/masks/index.ts Reformatted the BUILTIN_MASKS array declaration for readability; logic unchanged.
app/store/sync.ts Reformatted a console log and return statement for clarity; no logic 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
Loading

Possibly related PRs

  • ChatGPTNextWeb/NextChat#5722: Both PRs modify the README.md file by adding or updating introductory and informational content, making their changes related to documentation enhancement.
  • ChatGPTNextWeb/NextChat#5110: Both PRs modify the OWNER constant in app/constant.ts to update the repository ownership string, reflecting a change in project ownership or organization name.
  • ChatGPTNextWeb/NextChat#5610: Both PRs update the README.md, with this PR adding a short note and the related PR expanding the README with detailed sections and images.

Suggested reviewers

  • Dogtiti

Poem

In the garden of code where green styles grow,
A rabbit hops by with a README in tow.
Models are trimmed, and the chat UI’s bright,
Dates now appear in the message’s light.
With new owner declared and a platform-aware key,
This patch is as fresh as a spring jubilee!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (5)
README.md (2)

1-2: Refine the heading for clarity.

The markdown heading # attention please could be more descriptive and follow title case. Consider something like:

# Project Fork Notice

or 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 styling

The 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:

  1. Consider extracting common values (colors, spacing, border-radius) into CSS variables for consistency
  2. Some selectors are quite specific and could be simplified for better maintainability
  3. 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.tsx

Length of output: 758


Verify duplicate date renders for bot messages
There are two identical date elements using styles["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

📥 Commits

Reviewing files that changed from the base of the PR and between 3809375 and ccb9001.

📒 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)
  • Google (99-102)
🪛 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 spacing

The 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 formatting

Reformatting 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 style

The console.log statement has been reformatted to use a consistent multi-line style, improving readability while maintaining the same functionality.


113-113: Consistent brace positioning

The closing brace has been properly aligned, maintaining consistent code style.

app/masks/index.ts (1)

25-29: Enhanced readability with multi-line array declaration

The 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 syntax

The 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 logic

The 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 adjustment

Changed from background-color to background which 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 Models has 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:

  1. Was this intentional? If yes, ensure users are informed about this change
  2. 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 ts

Length of output: 1132


🏁 Script executed:

#!/bin/bash
# Find all references to the exported `Models` constant
rg -n "\bModels\b" --type ts --type tsx

Length 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" || true

Length of output: 687


No active usage of Models—restoring GPT-4 here has no effect

A search across all .ts/.tsx files only found the definition in app/client/api.ts and 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 other Models references in the codebase

You 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 improvement

The 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 component

The component was refactored to pass specific props instead of the entire mask object:

  1. Previously: Passed the entire mask object to MaskAvatar
  2. Now: Explicitly passes only avatar and model properties

This 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>  */}

Comment thread app/constant.ts
Comment on lines +1 to +2
export const OWNER = "EricYangXD";
export const REPO = "ChatGPT-Next";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 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-Next
app/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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Review UI design consistency and responsiveness

The changes to the container mixin include:

  1. Reduced border-radius from 20px to 4px
  2. Changed background to a hardcoded light green color (#c7edcc)
  3. Increased minimum dimensions (800px width, 600px height)
  4. Added vendor prefixes for border-radius

While the vendor prefixes improve cross-browser compatibility, there are some concerns:

  1. The hardcoded color value (#c7edcc) might not respect the application's theming system. Consider using CSS variables for themeable colors.
  2. 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

@EricYangXD EricYangXD closed this May 6, 2025
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.

3 participants