merge: retire Canvas inspiration entry

# Conflicts:
#	README.md
#	src/components/layout/MainLayout.tsx
#	src/components/layout/Sidebar.tsx
#	tests/e2e/image-workspace-v2.spec.ts
#	tests/unit/app-module-provider-gate.test.tsx
#	tests/unit/title-bar.test.tsx
This commit is contained in:
inman
2026-09-07 10:24:24 +08:00
12 changed files with 128 additions and 114 deletions

View File

@@ -123,6 +123,14 @@ describe('App programming provider initialization gate', () => {
expect(screen.queryByText('项目尚未初始化')).not.toBeInTheDocument();
});
it('redirects the retired inspiration route to the Canvas workspace', async () => {
await renderAt('/image-prompts/example');
expect(await screen.findByText('Canvas workspace')).toBeInTheDocument();
expect(screen.queryByText('Module chooser')).not.toBeInTheDocument();
expect(initProviders).not.toHaveBeenCalled();
});
it('redirects an orphaned token without a user identity away from a direct workspace route', async () => {
useAuthStore.setState({
initialized: true,

View File

@@ -64,16 +64,6 @@ describe('MainLayout module isolation', () => {
expect(screen.queryByTestId('sidebar-stub')).not.toBeInTheDocument();
});
it('keeps the user sidebar preference while moving the inspiration title into the title bar', () => {
renderLayout('/image-prompts');
expect(screen.getByTestId('titlebar-stub')).toHaveAttribute('data-page-title', '获取灵感');
expect(screen.getByTestId('titlebar-stub')).toHaveAttribute('data-overlay', 'false');
expect(screen.getByTestId('titlebar-stub')).toHaveAttribute('data-sidebar-collapsed', 'unset');
expect(screen.getByTestId('sidebar-stub')).toHaveAttribute('data-sidebar-collapsed', 'unset');
expect(useSettingsStore.getState().sidebarCollapsed).toBe(false);
});
it('does not overlay the local project initialization gate on AI hardware', () => {
renderLayout('/ai-hardware');

View File

@@ -132,13 +132,13 @@ describe('TitleBar platform behavior', () => {
expect(screen.getByTestId('titlebar-logo')).toBeInTheDocument();
});
it('keeps the painting page title after the macOS traffic-light safe area', () => {
it('keeps an optional page title after the macOS traffic-light safe area', () => {
window.electron.platform = 'darwin';
useSettingsStore.setState({ sidebarCollapsed: true });
render(<TitleBar integrated pageTitle="获取灵感" />);
render(<TitleBar integrated pageTitle="页面标题" />);
expect(screen.getByTestId('titlebar-page-title')).toHaveTextContent('获取灵感');
expect(screen.getByTestId('titlebar-page-title')).toHaveTextContent('页面标题');
expect(screen.getByTestId('titlebar-sidebar-surface')).toHaveClass('w-[132px]');
expect(screen.queryByTestId('titlebar-project-context')).not.toBeInTheDocument();
expect(screen.getByTestId('titlebar-logo').querySelectorAll('img')).toHaveLength(1);