renderMain() { if (!this.state.activeSpaceId) { // Render Spaces Dashboard Grid View const spacesCardsHTML = this.state.spaces.map(s => { const count = s.collections ? s.collections.length : 0; const notifCount = s.notifications ? s.notifications.length : 0; const theme = s.theme || 'violet'; return `
${notifCount > 0 ? `${notifCount}` : ''}

${this.escapeHTML(s.name)}

${count} Collections
${this.state.spaces.length > 1 ? ` ` : ''}
`; }).join(''); const dashboardHTML = `

Workspaces

Select a workspace to access its collections, endpoints, and history.

${spacesCardsHTML}

Create New Space

Add a clean workspace
`; const headerHTML = `
PHOENIX
Workspace Dashboard
`; this.dom.mainPanel.innerHTML = headerHTML + dashboardHTML; return; } const isBulkStart = this.checkBulkStart(); const bulk = this.state.bulk; const activeSpace = this.state.spaces.find(s => s.id === this.state.activeSpaceId); // Tab Strip (Postman-like) const tabStripHTML = `
${this.tabs.map((tab, i) => { const isActive = i === this.activeTabIndex; const tabName = tab.name || (tab.url ? tab.url.split('/').pop() || 'Request' : 'Untitled'); const displayName = tabName.length > 20 ? tabName.substring(0, 20) + '…' : tabName; const method = tab.method || 'GET'; const mc = { GET:'var(--m-get)', POST:'var(--m-post)', PUT:'var(--m-put)', DELETE:'var(--m-delete)', PATCH:'var(--m-patch)' }[method] || 'var(--text-3)'; return `
${method} ${this.escapeHTML(displayName)}
`; }).join('')}