Your team of AI agents, on your Mac, Windows or Linux. Agents that talk in channels, write code, review each other and use your tools, on the Claude Code, Codex, OpenCode or Pi you already have. Anything that touches the real world waits for your yes.
TypeScript agent-teamagentic-aiai-agentsai-assistantclaude-codecodexcursorelectrongrokgrok-bot-alternativelinuxlocal-firstmacosmcpmulti-agentopenclaw-alternativeopencodewindows
Truncate long agent roles in sidebar (#29)
marcelogarcia92c5ff4d50d1
diff --git a/src/renderer/src/components/Sidebar.tsx b/src/renderer/src/components/Sidebar.tsxindex a88c348..94bb4a4 100644--- a/src/renderer/src/components/Sidebar.tsx+++ b/src/renderer/src/components/Sidebar.tsx@@ -243,7 +243,7 @@ function AgentItem({ id }: { id: string }): ReactNode {<button className={`nav-item ${active ? 'is-active' : ''}`} onClick={() => navigate({ kind: 'agent', id })}><AgentAvatar agent={agent} size={18} /><span className="nav-item__label">{agent.name}</span>- <span className="nav-item__meta">{agent.role}</span>+ <span className="nav-item__meta nav-item__role" title={agent.role}>{agent.role}</span>{agent.computer && agent.computerKind === 'mac' && (<span className="nav-item__mac" title={L('Roda no seu computador', 'Runs on your computer')}><Icon name="laptop" size={13} />diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.cssindex bbd63ac..bc36678 100644--- a/src/renderer/src/styles.css+++ b/src/renderer/src/styles.css@@ -359,6 +359,13 @@ h3 {font-size: 11.5px;color: var(--text-3);}+.nav-item__role {+ min-width: 0;+ max-width: 40%;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}.badge {background: var(--danger);color: #fff;diff --git a/test/sidebar-layout.test.ts b/test/sidebar-layout.test.tsnew file mode 100644index 0000000..1cfb092--- /dev/null+++ b/test/sidebar-layout.test.ts@@ -0,0 +1,38 @@+import { existsSync, readFileSync } from 'node:fs'+import { chromium } from 'playwright'+import { expect, it } from 'vitest'++// Layout needs a browser: DOM-only tests cannot detect a name squeezed out by flex.+it.skipIf(!existsSync(chromium.executablePath()))('keeps the agent name visible when the sidebar role is long', async () => {+ const browser = await chromium.launch({ headless: true })+ try {+ const page = await browser.newPage()+ await page.setContent(`+ <style>${readFileSync(new URL('../src/renderer/src/styles.css', import.meta.url), 'utf8')}</style>+ <aside style="width: 220px">+ <button class="nav-item">+ <span style="width:18px;flex-shrink:0">A</span>+ <span class="nav-item__label">Mariana</span>+ <span class="nav-item__meta nav-item__role"></span>+ <span class="dot dot--warn"></span>+ </button>+ </aside>`)+ for (const role of ['Research and development of complex projects '.repeat(20), 'Research'.repeat(100)]) {+ await page.locator('.nav-item__role').evaluate((el, text) => { el.textContent = text }, role)+ const layout = await page.locator('.nav-item').evaluate((item) => {+ const name = item.querySelector<HTMLElement>('.nav-item__label')!+ const role = item.querySelector<HTMLElement>('.nav-item__role')!+ return {+ nameVisible: name.clientWidth >= name.scrollWidth && name.clientWidth > 0,+ roleTruncated: role.scrollWidth > role.clientWidth,+ ellipsis: getComputedStyle(role).textOverflow,+ fits: item.scrollWidth <= item.clientWidth,+ singleLine: role.getBoundingClientRect().top < name.getBoundingClientRect().bottom+ }+ })+ expect(layout).toEqual({ nameVisible: true, roleTruncated: true, ellipsis: 'ellipsis', fits: true, singleLine: true })+ }+ } finally {+ await browser.close()+ }+})