Skip to content

Conversation

@arvinxx
Copy link
Member

@arvinxx arvinxx commented Oct 16, 2025

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔀 Description of Change

📝 Additional Information

Summary by Sourcery

Refactor and enhance the chat welcome experience by replacing static suggestions with dynamic agent-driven content, improving component structure, and cleaning up obsolete code and translations.

Enhancements:

  • Display personalized agent greeting or default system-role message based on session metadata and openingMessage store value
  • Introduce OpeningQuestions component to render agent opening questions and replace AgentsSuggest and QuestionSuggest
  • Refactor WelcomeChatItem to render AgentWelcome instead of the deprecated WelcomeMessage
  • Simplify mobile detection with useIsMobile hook and optimize session selectors with deep-equal comparison

Documentation:

  • Update default welcome locale string for questions title to “试着问问:”

Chores:

  • Remove obsolete AgentsSuggest and QuestionSuggest component files

@vercel
Copy link

vercel bot commented Oct 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lobe-chat-database Ready Ready Preview Comment Oct 16, 2025 6:09pm
lobe-chat-preview Ready Ready Preview Comment Oct 16, 2025 6:09pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
lobe-chat-for-mobile Ignored Ignored Preview Oct 16, 2025 6:09pm

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 16, 2025

Reviewer's Guide

This PR refactors the welcome chat flow by renaming and consolidating components, replacing custom suggestion logic with a unified OpeningQuestions component, leveraging new hooks and selectors for dynamic content, simplifying conditional rendering, and updating styles and translations accordingly.

Class diagram for the refactored WelcomeChatItem components

classDiagram
    class WelcomeChatItem {
      +render()
    }
    class AgentWelcome {
      +useTranslation()
      +useIsMobile()
      +useGreeting()
      +useAgentStore()
      +useSessionStore()
      +useChatStore()
      +useMemo()
      +render()
    }
    class GroupWelcome {
      +render()
    }
    class OpeningQuestions {
      +render(mobile, questions)
    }
    WelcomeChatItem --> AgentWelcome : uses
    WelcomeChatItem --> GroupWelcome : uses
    AgentWelcome --> OpeningQuestions : uses
Loading

Flow diagram for conditional rendering in WelcomeChatItem

flowchart TD
    A["WelcomeChatItem"] -->|Check isGroupSession| B["GroupWelcome"]
    A -->|Else| C["AgentWelcome"]
    C --> D["OpeningQuestions (if questions exist)"]
Loading

File-Level Changes

Change Details Files
Renamed WelcomeChatItem flow to use AgentWelcome
  • Replaced WelcomeMessage import and usage with AgentWelcome
  • Updated conditional session check to render AgentWelcome for non-group sessions
src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/index.tsx
Enhanced AgentWelcome component with dynamic content and store hooks
  • Imported and used useIsMobile, useAgentStore, useChatStore, useSessionStore and selectors
  • Removed isCustomBranding and server config suggestion flags
  • Fetched openingQuestions and openingMessage from stores
  • Computed agentSystemRoleMsg from session meta and translations
  • Memoized message selection and toggled between guide text and openingMessage
src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/AgentWelcome/index.tsx
Replaced separate suggestion components with OpeningQuestions
  • Deleted AgentsSuggest and QuestionSuggest files
  • Rendered OpeningQuestions when questions exist
  • Passed mobile and questions props to OpeningQuestions
src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/InboxWelcome/AgentsSuggest.tsx
src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/InboxWelcome/QuestionSuggest.tsx
src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/OpeningQuestions.tsx
Adjusted OpeningQuestions padding style
  • Removed inline horizontal padding to unify layout
src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/OpeningQuestions.tsx
Updated default welcome questions translation
  • Changed default title from “大家都在问:” to “试着问问:”
src/locales/default/welcome.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 16, 2025
@lobehubbot
Copy link
Member

👍 @arvinxx

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.

@gru-agent
Copy link
Contributor

gru-agent bot commented Oct 16, 2025

There is too much information in the pull request to test.

@arvinxx arvinxx changed the title style/improve-welcome 💄 style: improve welcome message Oct 16, 2025
@dosubot dosubot bot added the 💄 Design Design and style issues label Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.65%. Comparing base (a02b301) to head (cc4dc35).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #9747     +/-   ##
=========================================
  Coverage   84.65%   84.65%             
=========================================
  Files         883      883             
  Lines       57939    57939             
  Branches     7307     8886   +1579     
=========================================
  Hits        49047    49047             
  Misses       8892     8892             
Flag Coverage Δ
app 79.04% <100.00%> (ø)
database 98.50% <ø> (ø)
packages/agent-runtime 99.63% <ø> (ø)
packages/context-engine 93.53% <ø> (ø)
packages/electron-server-ipc 93.76% <ø> (ø)
packages/file-loaders 92.21% <ø> (ø)
packages/model-bank 100.00% <ø> (ø)
packages/model-runtime 94.51% <ø> (ø)
packages/prompts 87.50% <ø> (ø)
packages/python-interpreter 96.50% <ø> (ø)
packages/utils 94.80% <ø> (ø)
packages/web-crawler 97.07% <ø> (ø)

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

Components Coverage Δ
Store 75.09% <ø> (ø)
Services 60.41% <ø> (ø)
Server 65.66% <100.00%> (ø)
Libs 51.38% <ø> (ø)
Utils 75.00% <ø> (ø)
🚀 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

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@arvinxx arvinxx merged commit c83fe13 into main Oct 16, 2025
49 checks passed
@arvinxx arvinxx deleted the style/improve-welcome branch October 16, 2025 18:16
@lobehubbot
Copy link
Member

❤️ Great PR @arvinxx ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.

lobehubbot pushed a commit that referenced this pull request Oct 16, 2025
### [Version&nbsp;1.138.2](v1.138.1...v1.138.2)
<sup>Released on **2025-10-16**</sup>

#### 💄 Styles

- **misc**: Improve welcome message.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Improve welcome message, closes [#9747](#9747) ([c83fe13](c83fe13))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.138.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

JamieStivala pushed a commit to jaworldwideorg/OneJA-Bot that referenced this pull request Oct 17, 2025
## [Version&nbsp;1.132.0](v1.131.2...v1.132.0)
<sup>Released on **2025-10-17**</sup>

#### ✨ Features

- **misc**: Support Group Chat, Mention, and Multi-Agent Orchestration with feature flag.

#### 🐛 Bug Fixes

- **misc**: Automatic topic creation switch does not work.

#### 💄 Styles

- **misc**: Add Claude Haiku 4.5 model, improve welcome message.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Support Group Chat, Mention, and Multi-Agent Orchestration with feature flag, closes [lobehub#8976](https://github.com/jaworldwideorg/OneJA-Bot/issues/8976) ([03c2838](03c2838))

#### What's fixed

* **misc**: Automatic topic creation switch does not work, closes [lobehub#9693](https://github.com/jaworldwideorg/OneJA-Bot/issues/9693) ([a02b301](a02b301))

#### Styles

* **misc**: Add Claude Haiku 4.5 model, closes [lobehub#9735](https://github.com/jaworldwideorg/OneJA-Bot/issues/9735) ([1cfbc87](1cfbc87))
* **misc**: Improve welcome message, closes [lobehub#9747](https://github.com/jaworldwideorg/OneJA-Bot/issues/9747) ([c83fe13](c83fe13))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💄 Design Design and style issues released size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants