💄 style: improve auto scroll and group profile#11725
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #11725 +/- ##
==========================================
- Coverage 74.18% 74.18% -0.01%
==========================================
Files 1194 1194
Lines 95149 95146 -3
Branches 10521 13007 +2486
==========================================
- Hits 70587 70584 -3
Misses 24472 24472
Partials 90 90
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Reviewer's GuideRefactors group context injection to insert a separate user message before the first user message, adjusts message engine ordering and streaming executor agent selection for group orchestration, and overhauls auto-scroll behavior and UI debug tooling while polishing the agent profile tools layout. Sequence diagram for first user message context injection ordersequenceDiagram
participant MessagesEngine
participant SystemRoleInjector
participant UserMemoryInjector
participant GroupContextInjector
participant GTDPlanInjector
participant LLM
MessagesEngine->>SystemRoleInjector: doProcess(context)
SystemRoleInjector-->>MessagesEngine: context1
alt user_memory_enabled
MessagesEngine->>UserMemoryInjector: doProcess(context1)
UserMemoryInjector-->>MessagesEngine: context2
else user_memory_disabled
MessagesEngine-->>MessagesEngine: context2 = context1
end
MessagesEngine->>GroupContextInjector: doProcess(context2)
GroupContextInjector->>GroupContextInjector: buildContent()
alt group_context_enabled
GroupContextInjector-->>MessagesEngine: context3 (injection before first user message, metadata.groupContextInjected = true)
else group_context_disabled
GroupContextInjector-->>MessagesEngine: context3 (unchanged)
end
alt gtd_plan_enabled
MessagesEngine->>GTDPlanInjector: doProcess(context3)
GTDPlanInjector-->>MessagesEngine: context4
else gtd_plan_disabled
MessagesEngine-->>MessagesEngine: context4 = context3
end
MessagesEngine->>LLM: sendMessages(context4.messages)
Sequence diagram for agent selection in streaming executor with group orchestrationsequenceDiagram
participant Client
participant StreamingExecutor
participant OperationStore
participant ContextEngine
Client->>StreamingExecutor: internal_fetchAIChatMessage(operationId)
StreamingExecutor->>OperationStore: getOperation(operationId)
OperationStore-->>StreamingExecutor: operation
StreamingExecutor->>StreamingExecutor: read context (agentId, subAgentId, groupId, topicId, threadId, scope)
alt groupId and subAgentId present
StreamingExecutor-->>StreamingExecutor: agentId = subAgentId
else no groupId or no subAgentId
StreamingExecutor-->>StreamingExecutor: agentId = operation.context.agentId
end
StreamingExecutor->>ContextEngine: build pipeline with agentId, groupId, topicId, threadId, scope
ContextEngine-->>StreamingExecutor: messages
StreamingExecutor-->>Client: stream AI response
Sequence diagram for AutoScroll component reacting to streaming messagessequenceDiagram
participant Store as ConversationStore
participant VirtualizedList
participant AutoScroll
participant BackBottom
participant User
VirtualizedList->>Store: subscribe virtuaListSelectors.atBottom,isScrolling
VirtualizedList->>Store: subscribe messageStateSelectors.isAIGenerating
VirtualizedList->>Store: subscribe dataSelectors.dbMessages
loop streaming tokens
Store-->>AutoScroll: atBottom,isScrolling,isAIGenerating,dbMessages
AutoScroll->>AutoScroll: compute shouldAutoScroll = atBottom && isAIGenerating && !isScrolling
alt shouldAutoScroll
AutoScroll->>Store: scrollToBottom(animated=false)
end
AutoScroll->>BackBottom: visible = !atBottom
end
User->>BackBottom: click
BackBottom->>Store: scrollToBottom(animated=true)
Class diagram for updated first user message context providersclassDiagram
class MessagesEngine {
+buildPipeline()
}
class BaseProvider {
<<abstract>>
+name string
+config any
+doProcess(context PipelineContext) PipelineContext
+cloneContext(context PipelineContext) PipelineContext
+markAsExecuted(context PipelineContext) PipelineContext
}
class BaseFirstUserContentProvider {
<<abstract>>
+name string
+config any
+doProcess(context PipelineContext) PipelineContext
+buildContent() string
}
class GroupContextInjector {
+name string
+config GroupContextInjectorConfig
+constructor(options ProcessorOptions, config GroupContextInjectorConfig)
+buildContent() string
+doProcess(context PipelineContext) PipelineContext
-buildGroupContextBlock() string
}
class SystemRoleInjector {
+constructor(config any)
+doProcess(context PipelineContext) PipelineContext
}
class UserMemoryInjector {
+constructor(config any)
+doProcess(context PipelineContext) PipelineContext
}
class GTDPlanInjector {
+constructor(config any)
+doProcess(context PipelineContext) PipelineContext
}
MessagesEngine --> SystemRoleInjector : uses
MessagesEngine --> UserMemoryInjector : uses
MessagesEngine --> GroupContextInjector : uses
MessagesEngine --> GTDPlanInjector : uses
BaseProvider <|-- SystemRoleInjector
BaseProvider <|-- UserMemoryInjector
BaseProvider <|-- GTDPlanInjector
BaseFirstUserContentProvider <|-- GroupContextInjector
Class diagram for updated auto-scroll components and debug toolingclassDiagram
class ConversationStore {
+virtuaScrollMethods any
+scrollToBottom(animated boolean)
+dbMessages Message[]
+atBottom boolean
+isScrolling boolean
+isAIGenerating boolean
}
class VirtualizedList {
+dataSource string[]
+itemContent(index number, id string) ReactNode
}
class AutoScroll {
+shouldAutoScroll boolean
+useEffect()
}
class DebugInspector {
+AT_BOTTOM_THRESHOLD number
+OPEN_DEV_INSPECTOR boolean
}
class AutoScrollShadow {
+content string
+streaming boolean
}
class useAutoScroll {
+ref HTMLDivElement
+handleScroll(event any)
+resetScrollLock()
}
class BackBottom {
+onScrollToBottom()
+visible boolean
}
VirtualizedList --> AutoScroll : renders for last item
AutoScroll --> ConversationStore : uses scrollToBottom
AutoScroll --> ConversationStore : reads atBottom,isScrolling,isAIGenerating,dbMessages
AutoScroll --> BackBottom : renders
AutoScroll --> DebugInspector : uses AT_BOTTOM_THRESHOLD,OPEN_DEV_INSPECTOR
DebugInspector --> ConversationStore : reads atBottom,isScrolling,isAIGenerating,virtuaScrollMethods
AutoScrollShadow --> useAutoScroll : uses hook
AutoScrollShadow --> ConversationStore : indirectly via useAutoScroll
AutoScrollShadow ..> DebugInspector : shares scroll behavior threshold via hooks
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
TestGru AssignmentSummary
Files
Tip You can |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
GroupContextInjector.doProcess,metadata.groupContextInjectedis set based only onconfig.enabled; if no user message exists and no content is actually injected, this flag becomes misleading—consider tying it to whether an injection actually occurred rather than configuration alone. - In
VirtualizedList, thehandleCheckAtBottomcallback includesAT_BOTTOM_THRESHOLD(a module-level constant) in its dependency array; since this value is static, you can simplify the deps to[]to avoid unnecessary re-creations and make the intent clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `GroupContextInjector.doProcess`, `metadata.groupContextInjected` is set based only on `config.enabled`; if no user message exists and no content is actually injected, this flag becomes misleading—consider tying it to whether an injection actually occurred rather than configuration alone.
- In `VirtualizedList`, the `handleCheckAtBottom` callback includes `AT_BOTTOM_THRESHOLD` (a module-level constant) in its dependency array; since this value is static, you can simplify the deps to `[]` to avoid unnecessary re-creations and make the intent clearer.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5ddf2057f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return ( | ||
| <WideScreenContainer key={messageId} style={{ position: 'relative' }}> | ||
| {content} | ||
| {isLast && <AutoScroll />} | ||
| </WideScreenContainer> |
There was a problem hiding this comment.
Keep back-to-bottom control outside virtualized items
Here AutoScroll (which owns the BackBottom button) is only rendered for the last item (isLast && <AutoScroll />). Because the list is virtualized, the last item is unmounted whenever the user scrolls up far enough, so the back-to-bottom control disappears exactly when it’s needed. In any long thread where the last message is off‑screen, users lose the UI to jump back to the bottom. Previously this control lived outside the virtualized list; consider keeping it mounted in a non-virtualized overlay so it remains available while scrolled away from the end.
Useful? React with 👍 / 👎.
|
❤️ 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. |
## [Version 2.0.0-next.345](v2.0.0-next.344...v2.0.0-next.345) <sup>Released on **2026-01-23**</sup> #### ✨ Features - **misc**: Remove Clerk authentication code. #### 🐛 Bug Fixes - **misc**: Slove the agents header switch agents the lobeAI not show problem. #### 💄 Styles - **misc**: Improve auto scroll and group profile. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Remove Clerk authentication code, closes [#11711](#11711) ([395595a](395595a)) #### What's fixed * **misc**: Slove the agents header switch agents the lobeAI not show problem, closes [#11726](#11726) ([f45f508](f45f508)) #### Styles * **misc**: Improve auto scroll and group profile, closes [#11725](#11725) ([550acc2](550acc2)) </details> <div align="right"> [](#readme-top) </div>
|
🎉 This PR is included in version 2.0.0-next.345 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.153.0](v1.152.0...v1.153.0) <sup>Released on **2026-01-23**</sup> #### ♻ Code Refactoring - **auth**: Remove NEXT_PUBLIC_AUTH_URL env variable. - **model-select**: Migrate FunctionCallingModelSelect to LobeSelect. - **ModelSwitchPanel**: Migrate from Popover to DropdownMenu with virtual scrolling. - **userMemories**: Removed un-used code. - **misc**: Improve memory data with experience and identity, move vercel-react-best-practices skills to .agents directory. #### ✨ Features - **database**: Added user memory activity. - **desktop**: Add legacy local database detection and migration guidance. - **misc**: Add platform-aware download client menu option, add server version check for desktop app, remove Clerk authentication code, skill setting page and skill store, support agent group unpublish agents, support client tasks mode, update the sandbox preinstall libs in sys role. #### 🐛 Bug Fixes - **copilot**: Pass correct scope when creating new session in PageEditor. - **desktop**: Gracefully handle missing update manifest 404 errors. - **model-runtime**: Filter unsupported image types (SVG) before sending to vision models. - **pdf**: Upgrade pdfjs-dist and react-pdf to v5.x. - **sidebar-drawer**: Fix drawer positioning and title style. - **misc**: Fix group broadcast trigger tool use, fix local system tools, fix memory schema, fix multi agent tasks issue, fix multi tasks no summary issue, fix scope issue, fix tool argument scape and improve multi task run, fixed the sandbox tools call when error should use right callback, improve e2e server and complete i18n resources, slove the agent group editor not focus in editdata area, slove the agents header switch agents the lobeAI not show problem, sloved the old removeSessionTopics not work, TypewriterEffect not refreshing on language change, updata cron job ui & fixed commnuity pagenation goto error, update the agentbuilder tools not always use humanIntervention. #### 💄 Styles - **misc**: Improve auto scroll and group profile, update og, update share style. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **auth**: Remove NEXT_PUBLIC_AUTH_URL env variable, closes [lobehub#11658](https://github.com/jaworldwideorg/OneJA-Bot/issues/11658) ([c0f9875](c0f9875)) * **model-select**: Migrate FunctionCallingModelSelect to LobeSelect, closes [lobehub#11664](https://github.com/jaworldwideorg/OneJA-Bot/issues/11664) ([ad51305](ad51305)) * **ModelSwitchPanel**: Migrate from Popover to DropdownMenu with virtual scrolling, closes [lobehub#11663](https://github.com/jaworldwideorg/OneJA-Bot/issues/11663) ([c9d9dff](c9d9dff)) * **userMemories**: Removed un-used code, closes [lobehub#11713](https://github.com/jaworldwideorg/OneJA-Bot/issues/11713) ([89750fc](89750fc)) * **misc**: Improve memory data with experience and identity, closes [lobehub#11717](https://github.com/jaworldwideorg/OneJA-Bot/issues/11717) ([bdb3eb4](bdb3eb4)) * **misc**: Move vercel-react-best-practices skills to .agents directory, closes [lobehub#11703](https://github.com/jaworldwideorg/OneJA-Bot/issues/11703) ([6df7731](6df7731)) #### What's improved * **database**: Added user memory activity, closes [lobehub#11680](https://github.com/jaworldwideorg/OneJA-Bot/issues/11680) ([0160fbd](0160fbd)) * **desktop**: Add legacy local database detection and migration guidance, closes [lobehub#11682](https://github.com/jaworldwideorg/OneJA-Bot/issues/11682) ([5664b84](5664b84)) * **misc**: Add platform-aware download client menu option, closes [lobehub#11676](https://github.com/jaworldwideorg/OneJA-Bot/issues/11676) ([55abddc](55abddc)) * **misc**: Add server version check for desktop app, closes [lobehub#11710](https://github.com/jaworldwideorg/OneJA-Bot/issues/11710) ([0cf2723](0cf2723)) * **misc**: Remove Clerk authentication code, closes [lobehub#11711](https://github.com/jaworldwideorg/OneJA-Bot/issues/11711) ([395595a](395595a)) * **misc**: Skill setting page and skill store, closes [lobehub#11665](https://github.com/jaworldwideorg/OneJA-Bot/issues/11665) ([d8c0c26](d8c0c26)) * **misc**: Support agent group unpublish agents, closes [lobehub#11687](https://github.com/jaworldwideorg/OneJA-Bot/issues/11687) ([4e060be](4e060be)) * **misc**: Support client tasks mode, closes [lobehub#11666](https://github.com/jaworldwideorg/OneJA-Bot/issues/11666) ([98cf57b](98cf57b)) * **misc**: Update the sandbox preinstall libs in sys role, closes [lobehub#11688](https://github.com/jaworldwideorg/OneJA-Bot/issues/11688) ([404c577](404c577)) #### What's fixed * **copilot**: Pass correct scope when creating new session in PageEditor, closes [lobehub#11714](https://github.com/jaworldwideorg/OneJA-Bot/issues/11714) ([0259270](0259270)) * **desktop**: Gracefully handle missing update manifest 404 errors, closes [lobehub#11625](https://github.com/jaworldwideorg/OneJA-Bot/issues/11625) ([13e95b9](13e95b9)) * **model-runtime**: Filter unsupported image types (SVG) before sending to vision models, closes [lobehub#11698](https://github.com/jaworldwideorg/OneJA-Bot/issues/11698) ([c0c99a7](c0c99a7)) * **pdf**: Upgrade pdfjs-dist and react-pdf to v5.x, closes [lobehub#11686](https://github.com/jaworldwideorg/OneJA-Bot/issues/11686) ([2b620df](2b620df)) * **sidebar-drawer**: Fix drawer positioning and title style, closes [lobehub#11655](https://github.com/jaworldwideorg/OneJA-Bot/issues/11655) ([cf5320e](cf5320e)) * **misc**: Fix group broadcast trigger tool use, closes [lobehub#11646](https://github.com/jaworldwideorg/OneJA-Bot/issues/11646) ([831a9b3](831a9b3)) * **misc**: Fix local system tools, closes [lobehub#11702](https://github.com/jaworldwideorg/OneJA-Bot/issues/11702) ([6548fc7](6548fc7)) * **misc**: Fix memory schema, closes [lobehub#11645](https://github.com/jaworldwideorg/OneJA-Bot/issues/11645) ([3baf780](3baf780)) * **misc**: Fix multi agent tasks issue, closes [lobehub#11672](https://github.com/jaworldwideorg/OneJA-Bot/issues/11672) ([9de773b](9de773b)) * **misc**: Fix multi tasks no summary issue, closes [lobehub#11685](https://github.com/jaworldwideorg/OneJA-Bot/issues/11685) ([26ce317](26ce317)) * **misc**: Fix scope issue, closes [lobehub#11719](https://github.com/jaworldwideorg/OneJA-Bot/issues/11719) ([17adde8](17adde8)) * **misc**: Fix tool argument scape and improve multi task run, closes [lobehub#11691](https://github.com/jaworldwideorg/OneJA-Bot/issues/11691) ([b13bb8a](b13bb8a)) * **misc**: Fixed the sandbox tools call when error should use right callback, closes [lobehub#11721](https://github.com/jaworldwideorg/OneJA-Bot/issues/11721) ([e8fce68](e8fce68)) * **misc**: Improve e2e server and complete i18n resources, closes [lobehub#11678](https://github.com/jaworldwideorg/OneJA-Bot/issues/11678) ([d450dd9](d450dd9)) * **misc**: Slove the agent group editor not focus in editdata area, closes [lobehub#11677](https://github.com/jaworldwideorg/OneJA-Bot/issues/11677) ([9ac84e6](9ac84e6)) * **misc**: Slove the agents header switch agents the lobeAI not show problem, closes [lobehub#11726](https://github.com/jaworldwideorg/OneJA-Bot/issues/11726) ([f45f508](f45f508)) * **misc**: Sloved the old removeSessionTopics not work, closes [lobehub#11671](https://github.com/jaworldwideorg/OneJA-Bot/issues/11671) ([06d41e5](06d41e5)) * **misc**: TypewriterEffect not refreshing on language change, closes [lobehub#11657](https://github.com/jaworldwideorg/OneJA-Bot/issues/11657) ([ba30f46](ba30f46)) * **misc**: Updata cron job ui & fixed commnuity pagenation goto error, closes [lobehub#11700](https://github.com/jaworldwideorg/OneJA-Bot/issues/11700) ([42ad2a0](42ad2a0)) * **misc**: Update the agentbuilder tools not always use humanIntervention, closes [lobehub#11696](https://github.com/jaworldwideorg/OneJA-Bot/issues/11696) ([0d3017b](0d3017b)) #### Styles * **misc**: Improve auto scroll and group profile, closes [lobehub#11725](https://github.com/jaworldwideorg/OneJA-Bot/issues/11725) ([550acc2](550acc2)) * **misc**: Update og, closes [lobehub#11709](https://github.com/jaworldwideorg/OneJA-Bot/issues/11709) ([01cf4e4](01cf4e4)) * **misc**: Update share style, closes [lobehub#11716](https://github.com/jaworldwideorg/OneJA-Bot/issues/11716) ([3c70dfa](3c70dfa)) </details> <div align="right"> [](#readme-top) </div>
💻 Change Type
🔗 Related Issue
🔀 Description of Change
🧪 How to Test
📸 Screenshots / Videos
📝 Additional Information
Summary by Sourcery
Adjust context injection order and auto-scroll behavior for group chats and virtualized message lists.
New Features:
Bug Fixes:
Enhancements:
Tests: