Hide buttons on welcome assistant message

This commit is contained in:
Cohee
2025-05-14 10:41:15 +03:00
parent 587cecb12c
commit 7a23fe794e
3 changed files with 11 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
#chat .mes[type="assistant_message"] .mes_button {
display: none;
}
.welcomePanel { .welcomePanel {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -638,6 +638,7 @@ export const system_message_types = {
MACROS: 'macros', MACROS: 'macros',
WELCOME_PROMPT: 'welcome_prompt', WELCOME_PROMPT: 'welcome_prompt',
ASSISTANT_NOTE: 'assistant_note', ASSISTANT_NOTE: 'assistant_note',
ASSISTANT_MESSAGE: 'assistant_message',
}; };
/** /**
@@ -2298,6 +2299,7 @@ function getMessageFromTemplate({
timestamp, timestamp,
tokenCount, tokenCount,
extra, extra,
type,
}) { }) {
const mes = messageTemplate.clone(); const mes = messageTemplate.clone();
mes.attr({ mes.attr({
@@ -2309,6 +2311,7 @@ function getMessageFromTemplate({
'bookmark_link': bookmarkLink, 'bookmark_link': bookmarkLink,
'force_avatar': !!forceAvatar, 'force_avatar': !!forceAvatar,
'timestamp': timestamp, 'timestamp': timestamp,
...(type ? { type } : {}),
}); });
mes.find('.avatar img').attr('src', avatarImg); mes.find('.avatar img').attr('src', avatarImg);
mes.find('.ch_name .name_text').text(characterName); mes.find('.ch_name .name_text').text(characterName);
@@ -2520,6 +2523,7 @@ export function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll
timestamp: timestamp, timestamp: timestamp,
extra: mes.extra, extra: mes.extra,
tokenCount: mes.extra?.token_count ?? 0, tokenCount: mes.extra?.token_count ?? 0,
type: mes.extra?.type ?? '',
...formatGenerationTimer(mes.gen_started, mes.gen_finished, mes.extra?.token_count, mes.extra?.reasoning_duration, mes.extra?.time_to_first_token), ...formatGenerationTimer(mes.gen_started, mes.gen_finished, mes.extra?.token_count, mes.extra?.reasoning_duration, mes.extra?.time_to_first_token),
}; };

View File

@@ -71,7 +71,9 @@ function sendAssistantMessage() {
mes: t`If you're connected to an API, try asking me something!` + '\n***\n' + t`**Hint:** Set any character as your welcome page assistant from their "More..." menu.`, mes: t`If you're connected to an API, try asking me something!` + '\n***\n' + t`**Hint:** Set any character as your welcome page assistant from their "More..." menu.`,
is_system: false, is_system: false,
is_user: false, is_user: false,
extra: {}, extra: {
type: system_message_types.ASSISTANT_MESSAGE,
},
}; };
chat.push(message); chat.push(message);