mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 17:47:27 +00:00
* ✨ feat(hetero-agent): add hetero-mode actions bar with copy/delete only Hide edit, regenerate, branching, translate, tts, share and delAndRegenerate for heterogeneous-agent sessions where these actions don't apply. Introduce `mode: 'hetero'` on MessageActionsConfig and dispatch to dedicated Hetero action bars for user, assistant, and assistant-group messages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(conversation): replace per-role action hooks with declarative action registry Replace the 4 duplicate per-role action hooks (useUserActions / useAssistantActions / useGroupActions / Task.useAssistantActions) and the 4 copies of stripHandleClick / buildActionsMap / dispatch logic with a single registry + universal MessageActionBar renderer. Each action (copy / del / edit / regenerate / delAndRegenerate / continueGeneration / translate / tts / share / collapse / branching) is now a standalone module under components/MessageActionBar/actions/. Config is declarative — string slot keys (e.g. ['copy', 'divider', 'del']) resolved against the registry at render time. Hetero-agent sessions drop the special mode flag; they just declare copy-only slot lists via config. Dev-mode branching becomes a registry key instead of a factory. Deletes ErrorActionsBar (handled in-place via slot lists), the dead Supervisor/Actions folder, and the HeteroActionsBar scaffold introduced in the previous commit. Net: -1900 lines, one place to add a new action. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 lines
384 B
TypeScript
12 lines
384 B
TypeScript
'use client';
|
|
|
|
import { useMemo } from 'react';
|
|
|
|
import { type ActionsBarConfig } from '@/features/Conversation/types';
|
|
|
|
/**
|
|
* Group-chat conversation action bar config. Currently relies on each role's
|
|
* component-level defaults — no per-session overrides are needed yet.
|
|
*/
|
|
export const useActionsBarConfig = (): ActionsBarConfig =>
|
|
useMemo<ActionsBarConfig>(() => ({}), []);
|