Skip to content

Commit 25fc58c

Browse files
authored
ZhuLinsen#602 [PR 7] 首页工作台状态管理收口与追问链路优化 (ZhuLinsen#760)
* feat(theme): establish theme-aware design system and normalize UI tokens * refactor(web): implement stockPoolStore and modernize dashboard architecture * feat(web): enhance analysis follow-up flow and user experience * test(web): fix layout regressions and strengthen automated coverage * update CHANGELOG.md * feat(ChatPage): enhance follow-up context handling and update tests for hydration logic. update CHANGELOG.md * feat(AuthContext): update login logic to reset dashboard state based on auth status test(AuthContext): add test for dashboard state reset behavior when auth is enabled feat(stockPoolStore): implement request sequencing to ignore late history responses * fix(web): harden dashboard task sync and follow-up flow
1 parent f688c4e commit 25fc58c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3010
-959
lines changed

apps/dsa-web/e2e/smoke.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ test.describe('web smoke', () => {
5252
test('home page shows analysis entry and history panel after login', async ({ page }) => {
5353
await login(page);
5454

55-
const stockInput = page.getByPlaceholder('输入股票代码,如 600519、00700、AAPL');
55+
const stockInput = page.getByPlaceholder('输入股票代码,如 600519、HK00700、AAPL');
5656
await expect(stockInput).toBeVisible({ timeout: 10_000 });
5757
await expect(page.getByRole('link', { name: '首页' })).toBeVisible();
5858
await expect(page.getByRole('link', { name: '问股' })).toBeVisible();
@@ -108,8 +108,8 @@ test.describe('web smoke', () => {
108108
await page.waitForLoadState('domcontentloaded');
109109
await page.waitForTimeout(1000);
110110

111-
// Use text content instead of role for heading
112-
await expect(page.getByText('系统设置')).toBeVisible({ timeout: 10_000 });
111+
// Use heading role for more precise selection
112+
await expect(page.getByRole('heading', { name: '系统设置' })).toBeVisible({ timeout: 10_000 });
113113
await expect(page.getByRole('button', { name: '重置' })).toBeVisible();
114114
await expect(page.getByRole('button', { name: // })).toBeVisible();
115115
});

apps/dsa-web/package-lock.json

Lines changed: 23 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/dsa-web/src/components/common/ApiErrorAlert.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ export const ApiErrorAlert: React.FC<ApiErrorAlertProps> = ({
3333
{onDismiss ? (
3434
<button
3535
type="button"
36-
className="shrink-0 rounded-md border border-white/10 px-2 py-1 text-[11px] text-red-100/85 transition hover:bg-white/5"
36+
className="shrink-0 rounded-md border border-danger/25 bg-danger/5 px-2 py-1 text-[11px] text-danger transition hover:bg-danger/12"
3737
onClick={onDismiss}
3838
>
3939
{dismissLabel}
4040
</button>
4141
) : null}
4242
</div>
4343
{showDetails ? (
44-
<details className="mt-3 rounded-lg border border-white/8 bg-black/15 px-3 py-2">
45-
<summary className="cursor-pointer text-xs text-red-100/90">查看详情</summary>
46-
<pre className="mt-2 whitespace-pre-wrap break-words text-[11px] leading-5 text-red-100/85">
44+
<details className="mt-3 rounded-lg border border-subtle bg-surface-2 px-3 py-2">
45+
<summary className="cursor-pointer text-xs text-danger opacity-90">查看详情</summary>
46+
<pre className="mt-2 whitespace-pre-wrap break-words text-[11px] leading-5 text-danger opacity-85">
4747
{error.rawMessage}
4848
</pre>
4949
</details>

apps/dsa-web/src/components/common/Button.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { cn } from '../../utils/cn';
33

44
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5-
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'gradient' | 'danger' | 'settings-primary' | 'settings-secondary';
5+
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'gradient' | 'danger' | 'danger-subtle' | 'settings-primary' | 'settings-secondary' | 'home-action-ai' | 'home-action-report';
66
size?: 'sm' | 'md' | 'lg' | 'xl';
77
isLoading?: boolean;
88
/** Custom loading text. */
@@ -20,12 +20,15 @@ const BUTTON_SIZE_STYLES = {
2020
const BUTTON_VARIANT_STYLES = {
2121
primary: 'border border-cyan/30 bg-primary-gradient text-primary-foreground shadow-lg shadow-cyan/20 hover:brightness-105',
2222
secondary: 'border border-border/70 bg-card text-foreground shadow-soft-card hover:bg-hover',
23-
'settings-primary': 'border border-[rgba(0,212,255,0.26)] bg-gradient-to-br from-[rgba(0,212,255,0.96)] to-[rgba(0,168,204,0.96)] text-[#041118] shadow-lg shadow-cyan/20 hover:brightness-105 hover:shadow-xl hover:shadow-cyan/22',
24-
'settings-secondary': 'border border-[rgba(255,255,255,0.08)] bg-[rgba(255,255,255,0.03)] text-secondary-text hover:translate-y-[-1px] hover:border-[rgba(0,212,255,0.3)] hover:bg-[rgba(0,212,255,0.06)] hover:text-foreground',
23+
'settings-primary': 'border settings-button-primary hover:brightness-105 hover:shadow-xl',
24+
'settings-secondary': 'border settings-button-secondary hover:translate-y-[-1px]',
2525
outline: 'border border-cyan/25 bg-transparent text-cyan hover:bg-cyan/10',
2626
ghost: 'border border-transparent bg-transparent text-secondary-text hover:bg-hover hover:text-foreground',
2727
gradient: 'border border-cyan/20 bg-gradient-to-r from-cyan to-purple text-primary-foreground shadow-lg shadow-cyan/20 hover:brightness-105',
2828
danger: 'border border-danger/40 bg-danger text-destructive-foreground shadow-lg shadow-danger/20 hover:brightness-105',
29+
'danger-subtle': 'border border-danger/60 bg-danger/10 text-danger hover:bg-danger/15',
30+
'home-action-ai': 'bg-[var(--home-action-ai-bg)] border border-[var(--home-action-ai-border)] text-[var(--home-action-ai-text)] hover:bg-[var(--home-action-ai-hover-bg)]',
31+
'home-action-report': 'bg-[var(--home-action-report-bg)] border border-[var(--home-action-report-border)] text-[var(--home-action-report-text)] hover:bg-[var(--home-action-report-hover-bg)]',
2932
} as const;
3033

3134
/**
@@ -43,7 +46,7 @@ export const Button: React.FC<ButtonProps> = ({
4346
type = 'button',
4447
...props
4548
}) => {
46-
const glowStyles = glow ? 'shadow-glow-cyan hover:shadow-[0_0_30px_rgba(0,212,255,0.38)]' : '';
49+
const glowStyles = glow ? 'shadow-glow-cyan settings-glow-cyan-hover' : '';
4750

4851
return (
4952
<button

apps/dsa-web/src/components/common/Card.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const Card: React.FC<CardProps> = ({
3232

3333
const variantStyles = {
3434
default: 'terminal-card',
35-
bordered: 'terminal-card terminal-card-hover',
35+
bordered: 'terminal-card',
3636
gradient: 'gradient-border-card',
3737
};
3838

@@ -45,7 +45,7 @@ export const Card: React.FC<CardProps> = ({
4545
{(title || subtitle) && (
4646
<div className="mb-3">
4747
{subtitle ? <span className="label-uppercase">{subtitle}</span> : null}
48-
{title ? <h3 className="mt-1 text-lg font-semibold text-white">{title}</h3> : null}
48+
{title ? <h3 className="mt-1 text-lg font-semibold text-foreground">{title}</h3> : null}
4949
</div>
5050
)}
5151
{children}
@@ -61,7 +61,7 @@ export const Card: React.FC<CardProps> = ({
6161
{(title || subtitle) && (
6262
<div className="mb-3">
6363
{subtitle ? <span className="label-uppercase">{subtitle}</span> : null}
64-
{title ? <h3 className="mt-1 text-lg font-semibold text-white">{title}</h3> : null}
64+
{title ? <h3 className="mt-1 text-lg font-semibold text-foreground">{title}</h3> : null}
6565
</div>
6666
)}
6767
{children}

apps/dsa-web/src/components/common/Checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const Checkbox: React.FC<CheckboxProps> = ({
3636
{label && (
3737
<label
3838
htmlFor={checkboxId}
39-
className="cursor-pointer select-none text-sm font-medium text-white"
39+
className="cursor-pointer select-none text-sm font-medium text-foreground"
4040
>
4141
{label}
4242
</label>

apps/dsa-web/src/components/common/Collapsible.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ export const Collapsible: React.FC<CollapsibleProps> = ({
2424
return (
2525
<div
2626
className={cn(
27-
'overflow-hidden rounded-2xl border border-white/8 bg-card/70 shadow-soft-card transition-all duration-300',
28-
'hover:border-cyan/20',
27+
'overflow-hidden rounded-2xl border border-subtle bg-card/70 shadow-soft-card transition-all duration-300',
28+
'hover:border-accent',
2929
className,
3030
)}
3131
>
3232
<button
3333
type="button"
3434
onClick={() => setIsOpen(!isOpen)}
35-
className="flex w-full items-center justify-between px-4 py-3 text-left transition-colors hover:bg-white/5"
35+
className="flex w-full items-center justify-between px-4 py-3 text-left transition-colors hover:bg-hover"
3636
>
3737
<div className="flex items-center gap-3">
38-
{icon && <span className="text-cyan-400">{icon}</span>}
39-
<span className="font-medium text-gray-100">{title}</span>
38+
{icon && <span className="text-cyan">{icon}</span>}
39+
<span className="font-medium text-foreground">{title}</span>
4040
</div>
4141
<svg
4242
className={cn('h-5 w-5 text-secondary-text transition-transform duration-300', isOpen && 'rotate-180')}
@@ -51,7 +51,7 @@ export const Collapsible: React.FC<CollapsibleProps> = ({
5151
<div
5252
className={cn('overflow-hidden transition-all duration-300 ease-in-out', isOpen ? 'max-h-[2000px] opacity-100' : 'max-h-0 opacity-0')}
5353
>
54-
<div className="border-t border-white/8 px-4 pb-4 pt-2">
54+
<div className="border-t border-subtle px-4 pb-4 pt-2">
5555
{children}
5656
</div>
5757
</div>

apps/dsa-web/src/components/common/Drawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const Drawer: React.FC<DrawerProps> = ({
7676
className={cn(
7777
'relative flex w-full flex-col bg-card',
7878
borderClass,
79-
side === 'right' ? 'border-white/50' : 'border-border/70 shadow-2xl',
79+
side === 'right' ? 'border-border/80' : 'border-border/70 shadow-2xl',
8080
side === 'left' ? 'animate-slide-in-left' : 'animate-slide-in-right'
8181
)}
8282
>

0 commit comments

Comments
 (0)