Skip to content

๐Ÿ’„ style: + in the welcome message can be clicked to create an assistant #7984

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kingsword09
Copy link
Contributor

๐Ÿ’ป ๅ˜ๆ›ด็ฑปๅž‹ | Change Type

  • โœจ feat
  • ๐Ÿ› fix
  • โ™ป๏ธ refactor
  • ๐Ÿ’„ style
  • ๐Ÿ‘ท build
  • โšก๏ธ perf
  • ๐Ÿ“ docs
  • ๐Ÿ”จ chore

๐Ÿ”€ ๅ˜ๆ›ด่ฏดๆ˜Ž | Description of Change

20250527151539_rec_

closes: #7946

๐Ÿ“ ่กฅๅ……ไฟกๆฏ | Additional Information

Copy link

vercel bot commented May 27, 2025

@kingsword09 is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 27, 2025
@lobehubbot
Copy link
Member

๐Ÿ‘ @kingsword09

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
้žๅธธๆ„Ÿ่ฐขๆ‚จๆๅ‡บๆ‹‰ๅ–่ฏทๆฑ‚ๅนถไธบๆˆ‘ไปฌ็š„็คพๅŒบๅšๅ‡บ่ดก็Œฎ๏ผŒ่ฏท็กฎไฟๆ‚จๅทฒ็ป้ตๅพชไบ†ๆˆ‘ไปฌ็š„่ดก็ŒฎๆŒ‡ๅ—๏ผŒๆˆ‘ไปฌไผšๅฐฝๅฟซๅฎกๆŸฅๅฎƒใ€‚
ๅฆ‚ๆžœๆ‚จ้‡ๅˆฐไปปไฝ•้—ฎ้ข˜๏ผŒ่ฏท้šๆ—ถไธŽๆˆ‘ไปฌ่”็ณปใ€‚

@dosubot dosubot bot added the ๐Ÿ’„ Design Design an style | ๆ ทๅผ้—ฎ้ข˜ label May 27, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds functionality to the '+' button in the welcome message, allowing users to create new assistant sessions. The implementation includes:

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 77 to 79
{t(showCreateSession ? 'guide.defaultMessage' : 'guide.defaultMessageWithoutCreate', {
appName: BRANDING_NAME,
})}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Conditional rendering based on showCreateSession but the plus button is always rendered if <plus /> tag exists in translation. This could lead to inconsistent behavior.

Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests โœ…

Project coverage is 95.67%. Comparing base (585e386) to head (3f04c02).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7984      +/-   ##
==========================================
+ Coverage   88.45%   95.67%   +7.21%     
==========================================
  Files         822       14     -808     
  Lines       60394     2519   -57875     
  Branches     4008      444    -3564     
==========================================
- Hits        53424     2410   -51014     
+ Misses       6970      109    -6861     
Flag Coverage ฮ”
app ?
server 95.67% <รธ> (รธ)

Flags with carried forward coverage won't be shown. Click here to find out more.

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

๐Ÿš€ New features to boost your workflow:
  • โ„๏ธ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • ๐Ÿ“ฆ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

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

่ฟ™ไธชๆ€่ทฏๆœ‰็‚นๅฆ™ ๐Ÿค™๐Ÿค™ ไธ่ฟ‡้œ€่ฆ่ท‘ไธ‹ i18n ๏ผŒๆ‰น้‡ๆ›ดๆ–ฐไธ‹ locales

@kingsword09
Copy link
Contributor Author

่ฟ™ไธชๆ€่ทฏๆœ‰็‚นๅฆ™ ๐Ÿค™๐Ÿค™ ไธ่ฟ‡้œ€่ฆ่ท‘ไธ‹ i18n ๏ผŒๆ‰น้‡ๆ›ดๆ–ฐไธ‹ locales

ๅธฎๆˆ‘่ท‘ไธ€ไธ‹๐Ÿ˜‚ ๆฒกๆœ‰้…็ฝฎGPT็š„API

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


This idea is a bit wonderful ๐Ÿค™๐Ÿค™ But you need to run i18n and update locales in batches

Help me run ๐Ÿ˜‚ There is no API with GPT configured

@kingsword09 kingsword09 force-pushed the style-welcome-message-create-assistant branch from 531692c to 3f04c02 Compare May 28, 2025 08:16
@kingsword09
Copy link
Contributor Author

@arvinxx ๅ› ไธบไธๆถ‰ๅŠ็ฟป่ฏ‘็›ธๅ…ณ๏ผŒๆ‰€ไปฅๆˆ‘็›ดๆŽฅไฝฟ็”จ ast-grep ่ฟ›่กŒไบ†ๅญ—็ฌฆๆ›ฟๆข

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


@arvinxx Because it does not involve translation related, I directly used ast-grep for character replacement

@entelligence-ai-reviews

Review Summary

Skipped posting 1 drafted comments based on your review threshold. Feel free to update them here.

Draft Comments
src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/InboxWelcome/AddButton.tsx:8-8
Missing indentation in the component's state hook. The `createSession` hook should be properly indented to match the component's structure.

Scores:

  • Production Impact: 1
  • Fix Specificity: 5
  • Urgency Impact: 1
  • Total Score: 7

Reason for filtering: This comment is about a minor indentation style issue that has no functional impact on the code. The total score is below the threshold of 13.

Analysis: The comment addresses a purely cosmetic indentation issue with no impact on functionality or production. While the fix is very specific and easy to implement, the issue has minimal urgency and zero production impact. With a total score of 7, this falls well below the required threshold of 13.

@entelligence-ai-reviews

Walkthrough

This PR standardizes the formatting of the 'defaultMessage' in all welcome localization files by replacing newline characters and literal plus signs with HTML line breaks and a custom component. It introduces a new AddButton React component and updates the InboxWelcome component to support dynamic rendering of the plus button within localized messages using the Trans and Markdown components. These changes improve UI consistency, enable component-based rendering in translations, and enhance modularity and extensibility for future localization needs.

Changes

File(s) Summary
locales/ar/welcome.json
locales/bg-BG/welcome.json
locales/de-DE/welcome.json
locales/en-US/welcome.json
locales/es-ES/welcome.json
locales/fa-IR/welcome.json
locales/fr-FR/welcome.json
locales/it-IT/welcome.json
locales/ja-JP/welcome.json
locales/ko-KR/welcome.json
locales/nl-NL/welcome.json
locales/pl-PL/welcome.json
locales/pt-BR/welcome.json
locales/ru-RU/welcome.json
locales/tr-TR/welcome.json
locales/vi-VN/welcome.json
locales/zh-CN/welcome.json
locales/zh-TW/welcome.json
src/locales/default/welcome.ts Updated 'defaultMessage' to use '
' for line breaks and '' component for plus sign, improving formatting and enabling component-based rendering in all welcome localization files.
src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/InboxWelcome/AddButton.tsx Added new memoized AddButton React component for creating new chat sessions, with loading state and session store integration.
src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/InboxWelcome/index.tsx Enhanced InboxWelcome to use Trans and Markdown components for advanced i18n, enabling dynamic replacement of with AddButton in localized messages.

Sequence Diagram

This diagram shows the interactions between components:

sequenceDiagram
    title AddButton Component Interaction Flow
    
    actor User
    participant AddButton as "AddButton Component"
    participant SWR as "useActionSWR Hook"
    participant SessionStore as "Session Store"
    
    Note over AddButton: Component initialization
    AddButton->>SessionStore: useSessionStore(s => s.createSession)
    SessionStore-->>AddButton: Return createSession function
    
    AddButton->>SWR: useActionSWR(['session.createSession', undefined], callback)
    SWR-->>AddButton: Return { mutate, isValidating }
    
    Note over AddButton: Render Button with isValidating state
    
    User->>AddButton: Click "+" button
    activate AddButton
    AddButton->>SWR: mutate()
    activate SWR
    
    SWR->>SessionStore: createSession({ group: undefined })
    activate SessionStore
    SessionStore-->>SWR: Return new session
    deactivate SessionStore
    
    SWR-->>AddButton: Update isValidating state
    SWR-->>AddButton: Return result
    deactivate SWR
    
    AddButton->>AddButton: Re-render with updated state
    deactivate AddButton
Loading

โ–ถ๏ธ โšก AI Code Reviews for VS Code, Cursor, Windsurf
Install the extension

Note for Windsurf Please change the default marketplace provider to the following in the windsurf settings:

Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery

Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items

Entelligence.ai can learn from your feedback. Simply add ๐Ÿ‘ / ๐Ÿ‘Ž emojis to teach it your preferences. More shortcuts below

Emoji Descriptions:

  • โš ๏ธ Potential Issue - May require further investigation.
  • ๐Ÿ”’ Security Vulnerability - Fix to ensure system safety.
  • ๐Ÿ’ป Code Improvement - Suggestions to enhance code quality.
  • ๐Ÿ”จ Refactor Suggestion - Recommendations for restructuring code.
  • โ„น๏ธ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @entelligenceai + *your message*
Example: @entelligenceai Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @entelligenceai + *feedback*
Example: @entelligenceai Do not comment on `save_auth` function !

Also you can trigger various commands with the bot by doing
@entelligenceai command

The current supported commands are

  1. config - shows the current config
  2. retrigger_review - retriggers the review

More commands to be added soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐Ÿ’„ Design Design an style | ๆ ทๅผ้—ฎ้ข˜ size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
4 participants