Skip to content

Conversation

@TonyGeez
Copy link
Contributor

@TonyGeez TonyGeez commented Feb 8, 2026

πŸ’» Change Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ‘· build
  • ⚑️ perf
  • βœ… test
  • πŸ“ docs
  • πŸ”¨ chore

πŸ”— Related Issue

πŸ”€ Description of Change

-Added Settings icon button to the right side of the mobile chat header to access chat model settings (agent profile) on mobile/PWA

  • Added missing tab content for Meta, Prompt, and TTS tabs that were not rendering on mobile/PWA.

  • Navigation Fix: Used activeAgentId from agent store instead of session store activeId to correctly navigate to settings page with proper agent ID

πŸ§ͺ How to Test

  • Tested locally

    1. Open the app on mobile browser or PWA
    2. Navigate to a chat/agent conversation
    3. Click the Settings icon (gear) in the top right header
    4. Verify the settings page opens with all tabs working (Agent Info, Prompt, Opening, Chat, Model, TTS)

πŸ“Έ Screenshots / Videos

Alt text

πŸ“ Additional Information

Files changed:

  • src/app/[variants]/(mobile)/chat/features/ChatHeader/index.tsx - Added Settings button
  • src/features/AgentSetting/AgentSettingsContent.tsx - Added missing tab content

Summary by Sourcery

Fix mobile/PWA agent settings visibility and navigation while tightening PNPM’s built-dependencies configuration.

Bug Fixes:

  • Ensure the mobile chat header provides access to the agent settings page using the correct active agent ID.
  • Render the Meta, Prompt, and TTS tabs in the agent settings view so their content appears on mobile/PWA.

Enhancements:

  • Add a settings icon button to the mobile chat header alongside the share button for quicker access to agent settings.

Build:

  • Restrict PNPM to only build a defined set of heavy dependencies via the onlyBuiltDependencies configuration.

@vercel
Copy link

vercel bot commented Feb 8, 2026

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

A member of the Team first needs to authorize it.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 8, 2026

Reviewer's Guide

Adds a settings icon to the mobile chat header that navigates to the correct agent settings page using the active agent ID, restores missing Agent Settings tab content on mobile/PWA, and configures pnpm to only build a defined set of native/heavy dependencies.

Sequence diagram for opening agent settings from mobile chat header

sequenceDiagram
  actor User
  participant MobileHeader
  participant AgentStore
  participant Router

  User->>MobileHeader: Tap Settings icon
  MobileHeader->>AgentStore: get activeAgentId
  AgentStore-->>MobileHeader: activeAgentId
  alt activeAgentId exists
    MobileHeader->>Router: navigate /agent/{activeAgentId}/settings
    Router-->>User: Render AgentSettings page
  else activeAgentId missing
    MobileHeader-->>User: No navigation (no-op)
  end
Loading

Updated class diagram for AgentSettingsContent tab rendering

classDiagram
  class AgentSettingsContent {
    ReactNode loadingSkeleton
    ChatSettingsTabs tab
    ReactNode~ReactNode~ children
    +render()
  }

  class ChatSettingsTabs {
    <<enumeration>>
    Meta
    Prompt
    Opening
    Chat
    Modal
    TTS
  }

  class AgentMeta {
    +render()
  }

  class AgentPrompt {
    +render()
  }

  class AgentOpening {
    +render()
  }

  class AgentChat {
    +render()
  }

  class AgentModal {
    +render()
  }

  class AgentTTS {
    +render()
  }

  AgentSettingsContent --> ChatSettingsTabs : uses tab
  AgentSettingsContent --> AgentMeta : renders when tab Meta
  AgentSettingsContent --> AgentPrompt : renders when tab Prompt
  AgentSettingsContent --> AgentOpening : renders when tab Opening
  AgentSettingsContent --> AgentChat : renders when tab Chat
  AgentSettingsContent --> AgentModal : renders when tab Modal
  AgentSettingsContent --> AgentTTS : renders when tab TTS
Loading

Class diagram for MobileHeader settings navigation logic

classDiagram
  class MobileHeader {
    +boolean open
    +handleOpenSettings()
    +render()
  }

  class AgentStore {
    +string activeAgentId
  }

  class QueryRouteHook {
    +push(path, query, replace)
  }

  class RouterNavigateHook {
    +navigate(path)
  }

  class ChatHeaderComponent {
    +onBackClick()
    +right
  }

  MobileHeader --> AgentStore : reads activeAgentId
  MobileHeader --> QueryRouteHook : uses onBackClick
  MobileHeader --> RouterNavigateHook : uses navigate to settings
  MobileHeader --> ChatHeaderComponent : configures right actions
Loading

File-Level Changes

Change Details Files
Add a settings button to the mobile chat header that routes to the active agent’s settings page.
  • Import ActionIcon, Flexbox, Settings icon, i18n hook, navigation hook, layout token, and agent store in the mobile ChatHeader component.
  • Create a handleOpenSettings callback that reads activeAgentId from the agent store and navigates to /agent/{activeAgentId}/settings when present.
  • Wrap the existing ShareButton in a horizontal Flexbox and prepend a Settings ActionIcon with appropriate size and localized title in the ChatHeader right slot.
src/app/[variants]/(mobile)/chat/features/ChatHeader/index.tsx
Render all agent settings tab panes (Meta, Prompt, TTS) that were previously missing on mobile/PWA.
  • Import AgentMeta, AgentPrompt, and AgentTTS components into the AgentSettingsContent container.
  • Extend the conditional rendering switch to show AgentMeta for the Meta tab, AgentPrompt for the Prompt tab, and AgentTTS for the TTS tab while preserving existing Opening, Chat, and Modal handling.
src/features/AgentSetting/AgentSettingsContent.tsx
Tighten pnpm install behavior by restricting which dependencies are built from source.
  • Define pnpm.onlyBuiltDependencies with a whitelist of packages (e.g., @lobehub/editor, @playwright/browser-chromium, @swc/core, sharp, tree-sitter, onnxruntime-node, etc.) in package.json so only those are built during installation.
package.json

Possibly linked issues

  • #: PR adds proper navigation and tab content so clicking settings correctly opens and displays model settings.

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

@gru-agent
Copy link
Contributor

gru-agent bot commented Feb 8, 2026

TestGru Assignment

Summary

Link CommitId Status Reason
Detail c227428 🚫 Skipped No files need to be tested {"package.json":"File path does not match include patterns.","src/app/[variants]/(mobile)/chat/features/ChatHeader/index.tsx":"File path does not match include patterns.","src/features/AgentSetting/AgentSettingsContent.tsx":"File path does not match include patterns."}

History Assignment

Tip

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

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 - I've left some high level feedback:

  • Consider hiding or disabling the settings icon when activeAgentId is falsy so the button never becomes a no-op in edge cases where no agent is active.
  • It may be worth standardizing on a single navigation mechanism in this component (either useQueryRoute or useNavigate) to keep routing behavior consistent and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider hiding or disabling the settings icon when `activeAgentId` is falsy so the button never becomes a no-op in edge cases where no agent is active.
- It may be worth standardizing on a single navigation mechanism in this component (either `useQueryRoute` or `useNavigate`) to keep routing behavior consistent and easier to maintain.

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.

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.

1 participant