Skip to content

[WS-90] 修复模型选择与流程状态 - #26

Merged
BSTester merged 2 commits into
mainfrom
agent/agent/a53a04a2
Aug 3, 2026
Merged

[WS-90] 修复模型选择与流程状态#26
BSTester merged 2 commits into
mainfrom
agent/agent/a53a04a2

Conversation

@BSTester

Copy link
Copy Markdown
Owner

Summary

  • Make the backend-managed default model selectable on the analysis launch surface while rendering model labels only.
  • Keep Risk Judge as a permanent terminal band and give the optional legacy executor a non-conflicting phase ID.
  • Apply reusable loading, empty, and recoverable error states across route and data-loading surfaces.

Validation

  • npm run test:run — passed.
  • npm run typecheck — passed.
  • npm run build — attempted repeatedly, but this runtime terminated Next.js during compilation with exhausted Swap and no generated BUILD_ID; no source diagnostic was emitted.

Scope

Frontend only. No backend or OpenAPI changes.

运维工程师 and others added 2 commits July 12, 2026 20:40
…elector, graph stages

Implements the Workflow Desk redesign per ui-designer/ui-spec.md and
ui-designer/design/implementation-plan.md (frontend-only; no backend or
OpenAPI contract changes).

- Tokens + typography: remap globals.css :root + tailwind.config.js to the
  Workflow Desk palette (ink #0a0d12, surface #171f2b, line #304154, mint
  #9bffbe action, sky-blue #8acbff flow) and add Instrument Serif / DM Mono /
  Noto Sans SC fonts. Mint/blue accent buttons now use dark ink text for
  correct contrast across all routes.
- Shell: rebuild AppNavbar as a fixed desktop research rail (248px) + slim top
  status bar + mobile drawer; reserve rail space via desktop body padding.
  Admin-only gating preserved (AppNavbar.test.tsx passes).
- Privacy boundary (WS-13/story-001): new ModelSelector exposes model display
  names only — never provider, endpoint, key state, or system-default
  provenance. AnalysisConfigForm step 5 now drives selection through it and
  drops the provider dropdown, provenance bars and inline API-key input;
  provider/backend_url/key are still resolved silently for the payload.
  ModelSelector.test.tsx proves model-name-only exposure + no-model recovery.
- Graph fidelity: new lib/workflow-stages.ts encodes the real GraphSetup
  5-band / 12-node model; AnalysisProgress rebuilt to 5 bands (Analyst Team →
  Bull/Bear debate → Research Manager → Trader → Risky/Safe/Neutral → Risk
  Judge) with Risk Judge split into its own terminal band. workflow-stages
  .test.ts asserts graph fidelity.
- State primitives: add EmptyState + ErrorState (PageLoading already existed).

Verification (web/frontend): npm run typecheck ✓, npm run test:run 42/42 ✓,
npm run build ✓ (18 routes prerendered). npm run lint: no new errors
(3 pre-existing errors in untouched files; next.config ignores eslint during
build).

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
@BSTester
BSTester marked this pull request as ready for review August 3, 2026 07:45
Copilot AI review requested due to automatic review settings August 3, 2026 07:45
@BSTester
BSTester merged commit 2adbf4f into main Aug 3, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the frontend “Workflow Desk” experience by (1) reskinning the UI (theme + typography), (2) introducing reusable loading/empty/error primitives, and (3) aligning the analysis launch + progress surfaces with the backend’s workflow semantics (model selection privacy boundary, Risk Judge terminal band, executor phase ID separation).

Changes:

  • Introduce “Workflow Desk” design tokens (Tailwind + CSS variables), typography, and navigation rail layout.
  • Add canonical workflow stage model + tests, and update AnalysisProgress to keep Risk Judge as a permanent terminal band while isolating the optional executor phase.
  • Add reusable PageLoading / EmptyState / ErrorState components and adopt them across route and data-loading surfaces; add model-only ModelSelector + tests and wire into the analysis launch form.

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
web/frontend/tailwind.config.js Update theme colors, spacing, fonts, shadows, and animations for Workflow Desk.
web/frontend/src/lib/workflow-stages.ts Add canonical workflow stage/band model aligned to backend agent codes.
web/frontend/src/lib/workflow-stages.test.ts Add tests asserting workflow stage fidelity and routing.
web/frontend/src/lib/types.ts Extend system-default provider summary with shallow/deep model fields.
web/frontend/src/components/ui/ErrorState.tsx Add reusable recoverable error UI primitive with optional retry.
web/frontend/src/components/ui/EmptyState.tsx Add reusable empty-state UI primitive with optional action.
web/frontend/src/components/profile/ProviderFormDrawer.tsx Adjust button text color to match new accent palette.
web/frontend/src/components/profile/LocalKeyField.tsx Adjust button text color to match new accent palette.
web/frontend/src/components/profile/AISettingsCard.tsx Adjust “管理” CTA text color to match new accent palette.
web/frontend/src/components/conversation/SessionSidebar.tsx Update CTA text color for new gradient buttons.
web/frontend/src/components/conversation/MessageBubble.tsx Update user bubble/avatar text color for new gradient buttons.
web/frontend/src/components/conversation/LoginNudge.tsx Update login CTA text color for new gradient buttons.
web/frontend/src/components/conversation/Composer.tsx Update send button text color for new gradient buttons.
web/frontend/src/components/common/AppNavbar.tsx Redesign navigation into desktop rail + top status bar + mobile drawer.
web/frontend/src/components/auth/LoginForm.tsx Update segmented control + submit button text color for new theme.
web/frontend/src/components/analysis/ModelSelector.tsx Add model-only selector enforcing privacy boundary (labels only).
web/frontend/src/components/analysis/ModelSelector.test.tsx Add tests ensuring model-only UI does not leak provider/key/endpoint.
web/frontend/src/components/analysis/AnalysisResults.tsx Replace ad-hoc loading/error UI with PageLoading + ErrorState.
web/frontend/src/components/analysis/AnalysisProgress.tsx Make Risk Judge a permanent terminal band; isolate optional executor phase ID.
web/frontend/src/components/analysis/AnalysisProgress.test.tsx Add test ensuring Risk Judge band persists when executor is disabled.
web/frontend/src/components/analysis/AnalysisHistory.tsx Replace ad-hoc loading/empty/error UI with shared primitives.
web/frontend/src/components/analysis/AnalysisConfigForm.tsx Wire model-only ModelSelector into launch form; remove launch-surface key entry messaging.
web/frontend/src/components/admin/system-default-provider/SystemDefaultForm.tsx Replace ad-hoc loading/error UI with shared primitives; update button text color.
web/frontend/src/components/admin/ResponsiveUserCard.tsx Update avatar gradient text color for non-admin users.
web/frontend/src/components/admin/llm-config/ProviderForm.tsx Update submit button text color for new theme.
web/frontend/src/components/admin/llm-config/ModelForm.tsx Update submit button text color for new theme.
web/frontend/src/app/scheduled-tasks/page.tsx Adopt shared loading/empty/error UI and update pagination active styles.
web/frontend/src/app/profile/page.tsx Use PageLoading for auth loading; update CTA button text colors.
web/frontend/src/app/profile/ai-settings/page.tsx Add loading/error states via shared primitives; update CTA styles.
web/frontend/src/app/page.tsx Replace auth-loading spinner with PageLoading.
web/frontend/src/app/not-found.tsx Use EmptyState for migrated 404 page.
web/frontend/src/app/loading.tsx Add global App Router route-level loading UI using PageLoading.
web/frontend/src/app/layout.tsx Update metadata, theme-color, fonts, and apply font-sans on body.
web/frontend/src/app/history/progress/page.tsx Replace ad-hoc loading/error UI with shared primitives + Suspense fallback.
web/frontend/src/app/history/page.tsx Replace auth-loading spinner with PageLoading.
web/frontend/src/app/history/detail/page.tsx Replace ad-hoc loading/error UI with shared primitives + Suspense fallback.
web/frontend/src/app/globals.css Update CSS variables + body font + focus-visible styling + reserve rail padding on lg+.
web/frontend/src/app/error.tsx Add global route-level error boundary using ErrorState.
web/frontend/src/app/auth/page.tsx Replace redirect spinner with PageLoading.
web/frontend/src/app/analysis/page.tsx Replace ad-hoc loading/error UI with shared primitives + Suspense fallback.
web/frontend/src/app/admin/users/page.tsx Adopt shared loading/empty/error UI primitives.
web/frontend/src/app/admin/system-default-provider/page.tsx Replace auth-loading spinner with PageLoading.
web/frontend/src/app/admin/llm-config/page.tsx Add loading/error states for providers/models and update CTA button styles.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 390 to +393
// 查找对应的阶段
const executorPhaseIndex = newPhases.findIndex(
(phase) => phase.id === TRADING_EXECUTOR_PHASE_ID,
);
Comment on lines +107 to +111
const handleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
const label = e.target.value;
const next = options.find((o) => o.label === label) || null;
onChange(next);
};
@BSTester
BSTester deleted the agent/agent/a53a04a2 branch August 7, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants