Add move-up message button
This commit is contained in:
parent
7be9aa3d2e
commit
66ce396b48
|
|
@ -866,6 +866,25 @@ export class ChatPanel {
|
|||
// Передаем выбранную модель при регенерации
|
||||
this.props.plugin.eventBus.emit('regenerate-message', { graphId, nodeId, model: this.selectedModel });
|
||||
});
|
||||
|
||||
// Кнопка "Наверх сообщения"
|
||||
const scrollToTopButton = toolsetContainer.createEl('button', {
|
||||
cls: 'text-token-text-secondary hover:bg-token-bg-secondary rounded-lg ml-1',
|
||||
attr: {
|
||||
'aria-label': 'Перейти к началу сообщения',
|
||||
'data-testid': 'scroll-to-message-top-button',
|
||||
'data-state': 'closed'
|
||||
}
|
||||
});
|
||||
const scrollToTopIconContainer = scrollToTopButton.createSpan({ cls: 'flex items-center justify-center touch:w-10 h-8 w-8' });
|
||||
setIcon(scrollToTopIconContainer, 'arrow-up'); // Иконка стрелки вверх
|
||||
scrollToTopButton.addEventListener('click', () => {
|
||||
// Прокручиваем родительский контейнер (view-content) к началу этого сообщения
|
||||
const scrollContainer = this.container.closest('.view-content') as HTMLElement;
|
||||
if (scrollContainer) {
|
||||
scrollContainer.scrollTop = messageElement.offsetTop;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private copyMessageContent(content: string): Promise<void> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user