fix(workspace): resize project menu

This commit is contained in:
mesalogo
2026-10-13 01:08:59 +08:00
parent a70fb2c13b
commit 89bf5840aa
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -400,7 +400,7 @@ describe('ProjectSwitcher runtime fields', () => {
expect(trigger.closest('.project-switcher')).not.toContainElement(menu)
expect(menu.closest('.floating-portal')?.parentElement).toBe(document.body)
const surface = screen.getByRole('dialog', { name: '项目与活动' })
expect(surface.style.width).toBe('920px')
expect(surface.style.width).toBe('680px')
const selected = within(menu).getByRole('menuitemradio', { checked: true })
await waitFor(() => expect(screen.getByRole('tab', { name: '全部项目' })).toHaveFocus())
fireEvent.pointerDown(selected)
+1 -1
View File
@@ -172,7 +172,7 @@ export function WorkspaceMenu({
if (!menu || !anchor) return
const position = (): void => {
const rect = anchor.getBoundingClientRect()
const width = Math.min(920, window.innerWidth - 32)
const width = Math.min(680, window.innerWidth - 32)
menu.style.width = `${width}px`
menu.style.left = `${Math.max(16, Math.min(rect.left, window.innerWidth - width - 16))}px`
const top = Math.max(16, rect.bottom + 8)
+1 -1
View File
@@ -19,7 +19,7 @@
.workspace-menu__layout {
display: grid;
grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
grid-template-columns: minmax(260px, 260px) minmax(0, 1fr);
flex: 1;
min-height: 0;
}