fix: terminal shift-left bug and session sidebar naming/filtering
- Guard ResizeObserver in terminal against internal xterm DOM changes by tracking last width/height and only calling fit() on real resize - Remove padding from .terminal-container and conflicting .xterm height override that caused measurement mismatches with xterm-addon-fit - Filter live session sidebar to active statuses only (running, building, pending) instead of showing all sessions including stopped ones - Add display name fallback across sidebar, sessions page, and instance list to prevent blank names when display_name is empty Quality gates: tsc (pass), eslint (pass)
This commit is contained in:
@@ -178,12 +178,26 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
|
||||
// Resize observer for container-level resize detection
|
||||
let resizeTimeout: ReturnType<typeof setTimeout> | null = null;
|
||||
const resizeObserver = new ResizeObserver(() => {
|
||||
let lastWidth = 0;
|
||||
let lastHeight = 0;
|
||||
const resizeObserver = new ResizeObserver((entries) => {
|
||||
if (resizeTimeout) {
|
||||
clearTimeout(resizeTimeout);
|
||||
}
|
||||
const entry = entries[0];
|
||||
if (!entry) return;
|
||||
const { width, height } = entry.contentRect;
|
||||
resizeTimeout = setTimeout(() => {
|
||||
resizeTimeout = null;
|
||||
// Guard against internal xterm DOM changes that don't affect container size
|
||||
if (
|
||||
Math.abs(width - lastWidth) < 1 &&
|
||||
Math.abs(height - lastHeight) < 1
|
||||
) {
|
||||
return;
|
||||
}
|
||||
lastWidth = width;
|
||||
lastHeight = height;
|
||||
const prevCols = term.cols;
|
||||
const prevRows = term.rows;
|
||||
fitAddon.fit();
|
||||
|
||||
Reference in New Issue
Block a user