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:
@@ -67,8 +67,14 @@ class TerminalManager {
|
||||
const container = document.getElementById(containerId);
|
||||
term.open(container);
|
||||
|
||||
// Initial fit
|
||||
requestAnimationFrame(() => fitAddon.fit());
|
||||
// Fit the terminal once the container has had time to lay out.
|
||||
// A single requestAnimationFrame is not enough — the panel may
|
||||
// still be transitioning from display:none, so we retry briefly.
|
||||
const doFit = () => { try { fitAddon.fit(); } catch (_) { /* noop */ } };
|
||||
requestAnimationFrame(doFit);
|
||||
setTimeout(doFit, 50);
|
||||
setTimeout(doFit, 150);
|
||||
setTimeout(doFit, 400);
|
||||
|
||||
// Forward user keystrokes to the backend
|
||||
term.onData((data) => {
|
||||
|
||||
Reference in New Issue
Block a user