mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-23 19:04:10 +01:00
🏷️ refactor: EditPresetDialog UI and Remove chatGptLabel from Presets (#7543)
* fix: add necessary dep., remove unnecessary dep from useMentions memoization * fix: Migrate deprecated chatGptLabel to modelLabel in cleanupPreset and simplify getPresetTitle logic * fix: Enhance cleanupPreset to remove empty chatGptLabel and add comprehensive tests for label migration and preset handling * chore: Update endpointType prop in PopoverButtons to allow null values for better flexibility * refactor: Replace Dialog with OGDialog in EditPresetDialog for improved UI consistency and structure * style: Update EditPresetDialog layout and styling for improved responsiveness and consistency
This commit is contained in:
parent
fc8d24fa5b
commit
b45ff8e4ed
7 changed files with 717 additions and 122 deletions
|
|
@ -17,18 +17,10 @@ export const getPresetTitle = (preset: TPreset, mention?: boolean) => {
|
|||
let title = '';
|
||||
let label = '';
|
||||
|
||||
const usesChatGPTLabel: TEndpoints = [
|
||||
EModelEndpoint.azureOpenAI,
|
||||
EModelEndpoint.openAI,
|
||||
EModelEndpoint.custom,
|
||||
];
|
||||
const usesModelLabel: TEndpoints = [EModelEndpoint.google, EModelEndpoint.anthropic];
|
||||
|
||||
if (endpoint != null && endpoint && usesChatGPTLabel.includes(endpoint)) {
|
||||
label = chatGptLabel ?? '';
|
||||
} else if (endpoint != null && endpoint && usesModelLabel.includes(endpoint)) {
|
||||
label = modelLabel ?? '';
|
||||
if (modelLabel) {
|
||||
label = modelLabel;
|
||||
}
|
||||
|
||||
if (
|
||||
label &&
|
||||
presetTitle != null &&
|
||||
|
|
@ -47,13 +39,13 @@ export const getPresetTitle = (preset: TPreset, mention?: boolean) => {
|
|||
}${
|
||||
tools
|
||||
? ` | ${tools
|
||||
.map((tool: TPlugin | string) => {
|
||||
if (typeof tool === 'string') {
|
||||
return tool;
|
||||
}
|
||||
return tool.pluginKey;
|
||||
})
|
||||
.join(', ')}`
|
||||
.map((tool: TPlugin | string) => {
|
||||
if (typeof tool === 'string') {
|
||||
return tool;
|
||||
}
|
||||
return tool.pluginKey;
|
||||
})
|
||||
.join(', ')}`
|
||||
: ''
|
||||
}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue