fix(ui): widen and center workspace switcher

This commit is contained in:
dadachann
2026-07-25 23:44:49 +08:00
parent 5ac1ab3eac
commit 741c20af07
2 changed files with 6 additions and 3 deletions
@@ -1916,7 +1916,7 @@ export default function HomeSidebar({
</SidebarHeader>
<div className="px-2 group-data-[collapsible=icon]:px-0">
<WorkspaceSwitcher className="w-1/2 max-w-36 group-data-[collapsible=icon]:min-w-0 group-data-[collapsible=icon]:px-2" />
<WorkspaceSwitcher className="mx-auto w-4/5 group-data-[collapsible=icon]:min-w-0 group-data-[collapsible=icon]:px-2" />
</div>
{/* Navigation items grouped by section */}
@@ -92,8 +92,11 @@ test('moves Cloud plan upgrades into Workspace Settings', () => {
assert.ok(toolbarEnd < membersHeading && membersHeading < cloudInvite);
});
test('keeps the workspace trigger compact and truncates long names', () => {
assert.match(homeSidebarSource, /<WorkspaceSwitcher className="w-1\/2/);
test('fills 80 percent of the sidebar, centers the trigger, and truncates long names', () => {
assert.match(
homeSidebarSource,
/<WorkspaceSwitcher className="mx-auto w-4\/5/,
);
assert.match(workspaceSwitcherSource, /h-9/);
assert.match(workspaceSwitcherSource, /w-64/);
assert.doesNotMatch(workspaceSwitcherSource, /min-w-80/);