feat: add dynamic window title updates
All checks were successful
BotUI CI / build (push) Successful in 2m48s

- Window title now shows current window name followed by 'General Bots'
- Title format: '{Window Name} - General Bots' (e.g., 'Chat - General Bots')
- Resets to 'General Bots Desktop' when all windows are closed
- Updated default title from 'BUILD V3 - Web Desktop Environment' to 'General Bots Desktop'
- Added cache-busting parameter to window-manager.js to ensure browser reloads updated code
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-03-03 09:33:38 -03:00
parent 84b7cb63f9
commit 61d90da409
2 changed files with 593 additions and 491 deletions

File diff suppressed because it is too large Load diff

View file

@ -131,6 +131,12 @@ if (typeof window.WindowManager === "undefined") {
windowEl.style.zIndex = this.zIndexCounter++; windowEl.style.zIndex = this.zIndexCounter++;
} }
// Update document title
const windowObj = this.openWindows.find((w) => w.id === id);
if (windowObj) {
document.title = `${windowObj.title} - General Bots`;
}
// Highlight taskbar icon // Highlight taskbar icon
if (this.taskbarApps) { if (this.taskbarApps) {
const icons = this.taskbarApps.querySelectorAll(".taskbar-icon"); const icons = this.taskbarApps.querySelectorAll(".taskbar-icon");
@ -156,7 +162,10 @@ if (typeof window.WindowManager === "undefined") {
this.openWindows = this.openWindows.filter((w) => w.id !== id); this.openWindows = this.openWindows.filter((w) => w.id !== id);
if (this.activeWindowId === id) { if (this.activeWindowId === id) {
this.activeWindowId = null; this.activeWindowId = null;
// Optionally focus the next highest z-index window // Reset title to default when all windows are closed
if (this.openWindows.length === 0) {
document.title = "General Bots Desktop";
}
} }
} }
@ -220,7 +229,7 @@ if (typeof window.WindowManager === "undefined") {
const minibarHeight = 28; const minibarHeight = 28;
windowEl.style.width = "100%"; windowEl.style.width = "100%";
windowEl.style.height = `calc(100% - ${taskbarHeight}px - ${minibarHeight}px)`; windowEl.style.height = `calc(100% - ${minibarHeight}px)`;
windowEl.style.top = `${minibarHeight}px`; windowEl.style.top = `${minibarHeight}px`;
windowEl.style.left = "0px"; windowEl.style.left = "0px";
windowObj.isMaximized = true; windowObj.isMaximized = true;