in src/gemini_95/index.ts [286:315]
function minimizeApp(appName: string): void {
const appData = openApps.get(appName);
if (!appData) return;
const { windowEl, taskbarButton } = appData;
windowEl.style.display = 'none'; // Hide the window
windowEl.classList.remove('active');
taskbarButton.classList.remove('active'); // Deactivate taskbar button
if (activeWindow === windowEl) {
activeWindow = null;
// Activate the next highest window if minimizing the active one
let nextAppToActivate: string | null = null;
let maxZ = 0;
openApps.forEach((data, name) => {
// Only consider windows that are currently visible
if (data.windowEl.style.display !== 'none') {
const z = parseInt(data.windowEl.style.zIndex || '0', 10);
if (z > maxZ) {
maxZ = z;
nextAppToActivate = name;
}
}
});
if (nextAppToActivate) {
bringToFront(openApps.get(nextAppToActivate)!.windowEl);
}
}
}