Add edit button to sidebar items and fix initial terminal fit
- Add pencil edit button on each sidebar profile item (visible on hover) - Fire fitAddon.fit() multiple times after terminal creation (50/150/400ms) to catch the panel finishing its CSS layout - Re-fit terminal when session:state transitions to 'connected'
This commit is contained in:
@@ -170,6 +170,17 @@ class Sidebar {
|
||||
textWrapper.appendChild(subEl);
|
||||
item.appendChild(textWrapper);
|
||||
|
||||
// Edit button (visible on hover)
|
||||
const editBtn = createElement('button', 'sidebar-item-edit', {
|
||||
textContent: '✎',
|
||||
title: 'Edit profile',
|
||||
});
|
||||
editBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
this.app.profileEditor.openEdit(profile.id);
|
||||
});
|
||||
item.appendChild(editBtn);
|
||||
|
||||
// Favourite star
|
||||
if (profile.favourite) {
|
||||
const star = createElement('span', 'sidebar-item-star is-favourite', { textContent: '★' });
|
||||
|
||||
Reference in New Issue
Block a user