🪄 feat: Artifacts Badge & Optimize Ephemeral Agent State (#8252)

* 🔧 fix: Update type annotations in useEventHandlers for better type safety

* 🔧 refactor: `useToolToggle` for improved localStorage synchronization and allow string/falsy values for setting to storage

*  feat: Implement Artifacts badge to BadgeRow with toggle options and UI components

- Added Artifacts component to manage artifacts state and options.
- Introduced ArtifactsSubMenu for additional settings related to artifacts.
- Integrated artifacts functionality into BadgeRow and ToolsDropdown components.
- Updated localStorage handling for artifacts state persistence.
- Enhanced localization for artifacts-related strings in translation files.
- Refactored Agent model to include artifacts in the ephemeral agent response.

* fix: set ephemeral agent state for conversation on finalization

* chore: remove beta settings dialog tab

* refactor: improve Ephemeral Agent statefulness

* fix: update setValue parameter to use 'value' instead of 'isChecked' in CheckboxButton

* refactor: update color classes for Artifact toggle and order of dropdown components

* chore: remove unused i18n localization
This commit is contained in:
Danny Avila 2025-07-04 13:23:37 -04:00
parent 458580ec87
commit a288ad1d9c
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
23 changed files with 547 additions and 232 deletions

View file

@ -1,29 +1,10 @@
import dedent from 'dedent';
import { ArtifactModes, shadcnComponents } from 'librechat-data-provider';
import { shadcnComponents } from 'librechat-data-provider';
import type {
SandpackProviderProps,
SandpackPredefinedTemplate,
} from '@codesandbox/sandpack-react';
export const getArtifactsMode = ({
codeArtifacts,
includeShadcnui,
customPromptMode,
}: {
codeArtifacts: boolean;
includeShadcnui: boolean;
customPromptMode: boolean;
}): ArtifactModes | undefined => {
if (!codeArtifacts) {
return undefined;
} else if (customPromptMode) {
return ArtifactModes.CUSTOM;
} else if (includeShadcnui) {
return ArtifactModes.SHADCNUI;
}
return ArtifactModes.DEFAULT;
};
const artifactFilename = {
'application/vnd.mermaid': 'App.tsx',
'application/vnd.react': 'App.tsx',