fix(web): keep the settings dialog one size and move billing into it (BUG-554)

The four account panes now share a fixed frame, chart profiles open as list then detail, and membership lives in the homepage dialog instead of a separate page.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-06 18:29:51 +08:00
co-authored by Cursor
parent 40bd0e9372
commit dc6598d7e4
48 changed files with 1962 additions and 1411 deletions
@@ -44,14 +44,12 @@ import {
diffRectificationBoard,
RECTIFICATION_BOARD_SPLIT_MIN_PX,
} from "@/lib/rectification-board-model";
import { membershipHref } from "@/lib/membership";
import { rectificationTimelineRows } from "@/lib/rectification-timeline-adapter";
import {
rectificationAdoptingLabel,
RECTIFICATION_EMPTY_ACTION_LABEL,
RECTIFICATION_EMPTY_COPY,
RECTIFICATION_INSUFFICIENT_CREDITS_NOTICE,
RECTIFICATION_INSUFFICIENT_CREDITS_REDIRECT_MS,
RECTIFICATION_QUESTION_PREPARING_LABEL,
RECTIFICATION_QUESTION_RELOAD_LABEL,
RECTIFICATION_QUESTION_RETRY_INTERVAL_MS,
@@ -240,6 +238,7 @@ type RectificationAgenticChatProps = Readonly<{
onCompleted?: () => void;
onPendingChange?: (pending: boolean) => void;
onProfileIncomplete?: () => void;
onOpenBilling?: (options?: { source?: string }) => void;
onSaved?: (time: string, status: "accepted" | "confirmed") => void;
onOpeningConsumed?: () => void;
pendingConsultationQuestion?: string | null;
@@ -476,6 +475,7 @@ export function RectificationAgenticChat(props: RectificationAgenticChatProps) {
onCompleted,
onPendingChange,
onProfileIncomplete,
onOpenBilling,
onSaved,
onOpeningConsumed,
pendingConsultationQuestion,
@@ -824,11 +824,9 @@ export function RectificationAgenticChat(props: RectificationAgenticChatProps) {
return;
}
if (response.status === 402) {
// Say why before the page leaves, instead of vanishing mid-chat.
// Keep the conversation on this page; the settings pane covers billing.
setError(RECTIFICATION_INSUFFICIENT_CREDITS_NOTICE);
window.setTimeout(() => {
window.location.assign(membershipHref("rectification"));
}, RECTIFICATION_INSUFFICIENT_CREDITS_REDIRECT_MS);
onOpenBilling?.({ source: "rectification" });
return;
}
if (response.status === 401) setError("请先登录。");
@@ -1053,7 +1051,7 @@ export function RectificationAgenticChat(props: RectificationAgenticChatProps) {
lastRunOutcome.current = readonly ? "readonly" : runOutcome;
setPending(false);
}
}, [beginLiveRun, busy, caseId, loadCaseSnapshot, onCompleted, onMessagesChange, onProfileIncomplete, readonly, rememberLiveActivity, selectedModelId, sessionId, setPending]);
}, [beginLiveRun, busy, caseId, loadCaseSnapshot, onCompleted, onMessagesChange, onOpenBilling, onProfileIncomplete, readonly, rememberLiveActivity, selectedModelId, sessionId, setPending]);
useEffect(() => {
if (busy) return;