fix: improve Coding sidebar text and remove gallery footer

This commit is contained in:
鲨鱼辣椒 committed 2026-10-14 14:46:31 +08:00
1 parent c812eb4c07
commit b5f31c1259
8 files changed
+72 -40

No files matched your search

+12 -20
View File
@@ -421,27 +421,20 @@ test.describe('Makelore module navigation without setup flow', () => {
expect(returnBox!.x + returnBox!.width).toBeLessThanOrEqual(collapseBox!.x);
expect(sidebarBox!.x + sidebarBox!.width - collapseBox!.x - collapseBox!.width).toBeLessThanOrEqual(14);
await expect(page.getByTestId('titlebar-sidebar-toggle')).toHaveCount(1);
const community = sidebar.getByRole('button', { name: '作品广场', exact: true });
await expect(community).toHaveCount(1);
const communityBox = await community.boundingBox();
await expect(sidebar.getByRole('button', { name: '作品广场', exact: true })).toHaveCount(0);
await expect(sidebar.locator('.classroom-community-footer')).toHaveCount(0);
const newConversation = sidebar.getByRole('button', { name: '新建对话', exact: true });
await expect(newConversation).toHaveCSS('font-size', '14px');
await expect(newConversation).toHaveCSS('font-weight', '500');
await expect(newConversation).toHaveCSS('color', 'rgb(38, 56, 77)');
await expect(sidebar.locator('.classroom-projects-heading')).toHaveCSS('color', 'rgb(80, 97, 118)');
const createBox = await sidebar.getByTestId('sidebar-create-project').boundingBox();
const headingBox = await sidebar.locator('.classroom-projects-heading').boundingBox();
const accountBox = await sidebar.getByTestId('sidebar-member-menu-trigger').boundingBox();
expect(createBox!.y).toBe(sidebarBox!.y);
expect(headingBox!.y - sidebarBox!.y).toBe(56);
expect(communityBox!.x).toBe(createBox!.x);
expect(communityBox!.y).toBeGreaterThan(headingBox!.y + headingBox!.height);
expect(accountBox!.y - communityBox!.y - communityBox!.height).toBeCloseTo(0, 0);
expect(communityBox!.height).toBe(createBox!.height);
await expect(community).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)');
const buttonStyles = await page.evaluate(() => {
const styles = (selector: string) => {
const s = getComputedStyle(document.querySelector(selector)!);
return [s.borderRadius, s.borderWidth, s.borderColor, s.boxShadow, s.padding, s.fontSize, s.fontWeight];
};
return { community: styles('[data-testid=sidebar] .community-link'), create: styles('[data-testid=sidebar-create-project]') };
});
expect(buttonStyles.community).toEqual(buttonStyles.create);
expect(accountBox!.y).toBeGreaterThan(headingBox!.y + headingBox!.height);
expect(accountBox!.y + accountBox!.height).toBeLessThanOrEqual(sidebarBox!.y + sidebarBox!.height);
expect(headingBox!.y).toBeGreaterThanOrEqual(createBox!.y + createBox!.height);
expect(headingBox!.y - createBox!.y - createBox!.height).toBeLessThanOrEqual(14);
await page.screenshot({ path: test.info().outputPath('chat-code-return-entry.png') });
@@ -471,14 +464,15 @@ test.describe('Makelore module navigation without setup flow', () => {
const b = el.getBoundingClientRect();
return el.contains(document.elementFromPoint(b.x + b.width / 2, b.y + b.height / 2));
})).toBe(true);
await expect(community).toBeVisible();
expect(await community.evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true);
await expect(sidebar.getByRole('button', { name: '作品广场', exact: true })).toHaveCount(0);
await expect(sidebar.getByTestId('sidebar-member-menu-trigger')).toBeVisible();
await page.screenshot({ path: test.info().outputPath('chat-narrow-navigation-row.png') });
await sidebarResizer.dblclick();
await expect(sidebarResizer).toHaveAttribute('aria-valuenow', '171');
const readCodeChrome = () => page.evaluate(() => {
if (document.querySelector('[data-testid="sidebar"] .classroom-brand')) throw new Error('Removed Code brand reappeared');
if (document.querySelector('[data-testid="sidebar"] .classroom-community-footer')) throw new Error('Removed Code community footer reappeared');
const selectors = {
sidebar: '[data-testid="sidebar"]',
titlebar: '[data-testid="titlebar-sidebar-surface"]',
@@ -487,8 +481,6 @@ test.describe('Makelore module navigation without setup flow', () => {
toggle: '[data-testid="titlebar-sidebar-toggle"]',
create: '[data-testid="sidebar-create-project"]',
heading: '[data-testid="sidebar"] .classroom-projects-heading',
community: '[data-testid="sidebar"] .community-link[data-variant="sidebar"]',
communityIcon: '[data-testid="sidebar"] .community-link-icon',
account: '[data-testid="sidebar-member-menu-trigger"]',
};
return Object.fromEntries(Object.entries(selectors).map(([name, selector]) => {