Skip to content

Conversation

arvinxx
Copy link
Member

@arvinxx arvinxx commented Jul 29, 2025

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

📝 补充信息 | Additional Information

Summary by Sourcery

Integrate subscriptionPlan into user store and display logic

Bug Fixes:

  • Pass subscriptionPlan to PlanTag in UserInfo component

Enhancements:

  • Add subscriptionPlan field to CommonState and UserInitializationState with corresponding type definitions
  • Populate subscriptionPlan in common slice actions during user initialization

Copy link

vercel bot commented Jul 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-database ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 29, 2025 9:38am
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 29, 2025 9:38am

Copy link
Contributor

sourcery-ai bot commented Jul 29, 2025

Reviewer's Guide

This PR implements end-to-end subscription plan support by extending user state types and initialization, incorporating the subscriptionPlan value from server data in the Redux slice, and updating the UserInfo component to retrieve and pass the subscriptionPlan to the PlanTag component.

Sequence diagram for UserInfo rendering PlanTag with subscriptionPlan

sequenceDiagram
    participant UserInfo
    participant useUserStore
    participant PlanTag
    UserInfo->>useUserStore: get subscriptionPlan
    UserInfo->>PlanTag: render PlanTag(type=subscriptionPlan)
Loading

Entity relationship diagram for user state and subscription plan

erDiagram
    USER_INITIALIZATION_STATE {
        string firstName
        string lastName
        string userId
        string username
        string preference
        string settings
        string subscriptionPlan
    }
    COMMON_STATE {
        boolean isOnboard
        boolean isShowPWAGuide
        boolean isUserCanEnableTrace
        boolean isUserHasConversation
        boolean isUserStateInit
        string subscriptionPlan
    }
    USER_INITIALIZATION_STATE ||--|| COMMON_STATE : shares subscriptionPlan
Loading

Class diagram for updated user state and UserInfo component

classDiagram
    class UserInitializationState {
        string? firstName
        string? lastName
        UserPreference preference
        PartialDeep~UserSettings~ settings
        Plans? subscriptionPlan
        string? userId
        string? username
    }
    class CommonState {
        boolean isOnboard
        boolean isShowPWAGuide
        boolean isUserCanEnableTrace
        boolean isUserHasConversation
        boolean isUserStateInit
        Plans? subscriptionPlan
    }
    class UserInfo {
        +UserInfo(props: UserInfoProps)
    }
    class PlanTag {
        +PlanTag(type: Plans)
    }
    UserInfo --> PlanTag : passes subscriptionPlan
    CommonState <|-- UserInitializationState : extends
    UserInfo --> CommonState : uses subscriptionPlan
Loading

File-Level Changes

Change Details Files
Extend user subscriptionPlan state types and default values
  • Imported Plans type and added optional subscriptionPlan field to CommonState
  • Configured subscriptionPlan in initialCommonState
  • Added subscriptionPlan to UserInitializationState type
src/store/user/slices/common/initialState.ts
src/types/user/index.ts
Initialize subscriptionPlan in common slice with server data
  • Included subscriptionPlan: data.subscriptionPlan in createCommonSlice payload
src/store/user/slices/common/action.ts
Update UserInfo component to read and display subscriptionPlan
  • Expanded useUserStore selector to return subscriptionPlan
  • Passed subscriptionPlan as type prop to PlanTag
src/features/User/UserInfo.tsx

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

@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.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link
Contributor

gru-agent bot commented Jul 29, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 103db4e ✅ Finished

History Assignment

Files

File Pull Request
src/store/user/slices/common/action.ts ❌ Failed (I failed to setup the environment.)
src/store/user/slices/common/initialState.ts ❌ Failed (I failed to setup the environment.)

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 29, 2025
@arvinxx arvinxx changed the title fix plan and menu 🐛 fix: fix plan tag display and menu Jul 29, 2025
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 @arvinxx - 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.

Copy link

codecov bot commented Jul 29, 2025

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8599   +/-   ##
=======================================
  Coverage   85.73%   85.73%           
=======================================
  Files         910      910           
  Lines       69711    69712    +1     
  Branches     4756     4756           
=======================================
+ Hits        59766    59767    +1     
  Misses       9945     9945           
Flag Coverage Δ
app 85.73% <100.00%> (+<0.01%) ⬆️
server 96.26% <ø> (ø)

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.

@arvinxx arvinxx changed the title 🐛 fix: fix plan tag display and menu 🐛 fix: fix plan tag display Jul 29, 2025
@arvinxx arvinxx changed the title 🐛 fix: fix plan tag display 🐛 fix: fix subscription plan tag display Jul 29, 2025
@arvinxx arvinxx merged commit 2a3754a into main Jul 29, 2025
24 checks passed
@arvinxx arvinxx deleted the fix/plan-and-menu branch July 29, 2025 09:41
@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.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

github-actions bot pushed a commit that referenced this pull request Jul 29, 2025
### [Version&nbsp;1.105.3](v1.105.2...v1.105.3)
<sup>Released on **2025-07-29**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix subscription plan tag display.

<br/>

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

#### What's fixed

* **misc**: Fix subscription plan tag display, closes [#8599](#8599) ([2a3754a](2a3754a))

</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.105.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to jaworldwideorg/OneJA-Bot that referenced this pull request Jul 29, 2025
## [Version&nbsp;1.105.0](v1.104.1...v1.105.0)
<sup>Released on **2025-07-29**</sup>

#### ✨ Features

- **misc**: Add support for Okta Authentication.

#### 🐛 Bug Fixes

- **misc**: Fix subscription plan tag display, reorder AppTheme and Locale to fix modal i18n, revert jose to ^5 to fix auth issue on desktop.

#### 💄 Styles

- **misc**: Open new topic by tap Just Chat again, support Minimax T2I models.

<br/>

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

#### What's improved

* **misc**: Add support for Okta Authentication, closes [lobehub#8547](https://github.com/jaworldwideorg/OneJA-Bot/issues/8547) ([67abdfe](67abdfe))

#### What's fixed

* **misc**: Fix subscription plan tag display, closes [lobehub#8599](https://github.com/jaworldwideorg/OneJA-Bot/issues/8599) ([2a3754a](2a3754a))
* **misc**: Reorder AppTheme and Locale to fix modal i18n, closes [lobehub#8600](https://github.com/jaworldwideorg/OneJA-Bot/issues/8600) ([3264cf2](3264cf2))
* **misc**: Revert jose to ^5 to fix auth issue on desktop, closes [lobehub#8603](https://github.com/jaworldwideorg/OneJA-Bot/issues/8603) ([57118b0](57118b0))

#### Styles

* **misc**: Open new topic by tap Just Chat again, closes [lobehub#8426](https://github.com/jaworldwideorg/OneJA-Bot/issues/8426) ([018ca75](018ca75))
* **misc**: Support Minimax T2I models, closes [lobehub#8583](https://github.com/jaworldwideorg/OneJA-Bot/issues/8583) ([f8a01aa](f8a01aa))

</details>

<div align="right">

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

</div>
bbbugg pushed a commit to bbbugg/lobe-chat that referenced this pull request Aug 14, 2025
bbbugg pushed a commit to bbbugg/lobe-chat that referenced this pull request Aug 14, 2025
### [Version&nbsp;1.105.3](lobehub/lobe-chat@v1.105.2...v1.105.3)
<sup>Released on **2025-07-29**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix subscription plan tag display.

<br/>

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

#### What's fixed

* **misc**: Fix subscription plan tag display, closes [lobehub#8599](lobehub#8599) ([e37ee42](lobehub@e37ee42))

</details>

<div align="right">

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

</div>
cy948 pushed a commit to cy948/lobe-chat that referenced this pull request Aug 23, 2025
cy948 pushed a commit to cy948/lobe-chat that referenced this pull request Aug 23, 2025
### [Version&nbsp;1.105.3](lobehub/lobe-chat@v1.105.2...v1.105.3)
<sup>Released on **2025-07-29**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix subscription plan tag display.

<br/>

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

#### What's fixed

* **misc**: Fix subscription plan tag display, closes [lobehub#8599](lobehub#8599) ([2a3754a](lobehub@2a3754a))

</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
released size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants