Fix sidebar sections, terminal resize, and improve .gitignore
Sidebar: - Add -webkit-user-select: none to section headers (WebKit prefix) - Fix class mismatches: sidebar-section-chevron → section-chevron, sidebar-section-count → section-count, sidebar-section-list → sidebar-list Terminal resize: - Poll container dimensions after creation — retry fit every 50ms until container has non-zero width/height (up to 20 attempts) - Add flex: 1 and min-height: 0 to .xterm inside session-panel so it participates in flex layout correctly .gitignore: - Comprehensive rewrite covering build output, Wails bindings, frontend libs, IDE files, OS metadata, and application data
This commit is contained in:
@@ -77,6 +77,7 @@
|
||||
letter-spacing: 0.06em;
|
||||
cursor: pointer;
|
||||
transition: color var(--transition-fast), background var(--transition-fast);
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
text-align: left;
|
||||
background: none;
|
||||
|
||||
@@ -69,7 +69,9 @@
|
||||
/* xterm.js overrides for consistent look */
|
||||
.terminal-container .xterm,
|
||||
.session-panel .xterm {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,16 +113,16 @@ class Sidebar {
|
||||
// Section header
|
||||
const header = createElement('div', 'sidebar-section-header');
|
||||
header.innerHTML = `
|
||||
<span class="sidebar-section-chevron ${isCollapsed ? 'collapsed' : ''}">${isCollapsed ? '▸' : '▾'}</span>
|
||||
<span class="sidebar-section-title">${escapeHtml(title)}</span>
|
||||
<span class="sidebar-section-count">${profiles.length}</span>
|
||||
<span class="section-chevron ${isCollapsed ? 'collapsed' : ''}">${isCollapsed ? '▸' : '▾'}</span>
|
||||
<span>${escapeHtml(title)}</span>
|
||||
<span class="section-count">${profiles.length}</span>
|
||||
`;
|
||||
header.addEventListener('click', () => this.toggleSection(key));
|
||||
section.appendChild(header);
|
||||
|
||||
// Items
|
||||
if (!isCollapsed) {
|
||||
const list = createElement('div', 'sidebar-section-list');
|
||||
const list = createElement('div', 'sidebar-list');
|
||||
for (const profile of profiles) {
|
||||
list.appendChild(this.renderProfileItem(profile));
|
||||
}
|
||||
|
||||
@@ -67,14 +67,23 @@ class TerminalManager {
|
||||
const container = document.getElementById(containerId);
|
||||
term.open(container);
|
||||
|
||||
// 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.
|
||||
// Fit the terminal once the container has real dimensions.
|
||||
// The panel may have just transitioned from display:none, so we
|
||||
// poll until the container reports a non-trivial size.
|
||||
const doFit = () => { try { fitAddon.fit(); } catch (_) { /* noop */ } };
|
||||
requestAnimationFrame(doFit);
|
||||
setTimeout(doFit, 50);
|
||||
setTimeout(doFit, 150);
|
||||
setTimeout(doFit, 400);
|
||||
let fitAttempts = 0;
|
||||
const tryFit = () => {
|
||||
fitAttempts++;
|
||||
const rect = container.getBoundingClientRect();
|
||||
if (rect.width > 10 && rect.height > 10) {
|
||||
doFit();
|
||||
} else if (fitAttempts < 20) {
|
||||
// Container still has no size — retry
|
||||
setTimeout(tryFit, 50);
|
||||
return;
|
||||
}
|
||||
};
|
||||
requestAnimationFrame(tryFit);
|
||||
|
||||
// Forward user keystrokes to the backend
|
||||
term.onData((data) => {
|
||||
|
||||
Reference in New Issue
Block a user