移除日历视图:功能与决策卡重叠,维护成本高于价值
- 删除 CalendarView.tsx、calendar-action-utils.ts 及其测试文件 - 删除 ScanTerminalCalendar.module.css - ScanTerminalDashboard:移除日历 tab 按钮、日历渲染分支、ContentView 类型中的 calendar - ScanTerminalLightTheme:清理所有 .scan-calendar-* 规则(~40 行) - scan-root-styles.ts:移除 ScanTerminalCalendar 导入 同时完善地理排序: - scan_terminal_filters.py:market_region_from_tz_offset 细化为 7 个区域(东亚/东南亚/中亚/西亚/欧洲非洲/南美/北美)并增加 sort_order - scan_terminal_city_row.py:传递 trading_region_sort - dashboard-types.ts:增加 trading_region_sort 字段 - decision-utils.ts:sortRowsByUserTime 按 trading_region_sort 优先排序 Rejected: keep-calendar-view, calendar-actions-overlap-with-decision-cards Tested: npx tsc --noEmit, python -m ruff check .
This commit is contained in:
@@ -30,7 +30,6 @@ import type {
|
||||
ScanOpportunityRow,
|
||||
} from "@/lib/dashboard-types";
|
||||
import { AiPinnedForecastView } from "@/components/dashboard/scan-terminal/AiPinnedForecastView";
|
||||
import { CalendarView } from "@/components/dashboard/scan-terminal/CalendarView";
|
||||
import { LoadingSignal } from "@/components/dashboard/scan-terminal/LoadingSignal";
|
||||
import { findDetailForCity } from "@/components/dashboard/scan-terminal/city-detail-utils";
|
||||
import {
|
||||
@@ -46,7 +45,7 @@ import {
|
||||
useUserLocalClock,
|
||||
} from "@/components/dashboard/scan-terminal/use-scan-terminal-ui-state";
|
||||
|
||||
type ContentView = "analysis" | "map" | "calendar";
|
||||
type ContentView = "analysis" | "map";
|
||||
|
||||
const CityDetailPanel = dynamic(
|
||||
() =>
|
||||
@@ -235,12 +234,6 @@ function ScanTerminalScreen() {
|
||||
store.selectedDetail,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!store.proAccess.loading && !isPro && activeView === "calendar") {
|
||||
setActiveView("map");
|
||||
}
|
||||
}, [activeView, isPro, store.proAccess.loading]);
|
||||
|
||||
const resolvedView: ContentView = activeView;
|
||||
const mapFocusedCity = mapSelectedCityName || store.selectedCity;
|
||||
const activeDetailRow =
|
||||
@@ -352,16 +345,6 @@ function ScanTerminalScreen() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (resolvedView === "calendar") {
|
||||
return (
|
||||
<CalendarView
|
||||
rows={timeSortedRows}
|
||||
locale={locale}
|
||||
selectedRowId={selectedRowId}
|
||||
onSelectRow={handleSelectRow}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -507,22 +490,6 @@ function ScanTerminalScreen() {
|
||||
>
|
||||
{isEn ? "Decision Cards" : "城市决策卡"}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={resolvedView === "calendar"}
|
||||
className={resolvedView === "calendar" ? "active" : ""}
|
||||
title={!isPro ? (isEn ? "Pro forecast calendar required" : "日历预测需 Pro") : undefined}
|
||||
onClick={() => {
|
||||
if (!isPro) {
|
||||
openScanPaywall();
|
||||
return;
|
||||
}
|
||||
setActiveView("calendar");
|
||||
}}
|
||||
>
|
||||
{isEn ? "Calendar View" : "日历视图"}
|
||||
</button>
|
||||
</div>
|
||||
<div className="scan-list-status">
|
||||
{terminalData?.generated_at ? (
|
||||
@@ -550,8 +517,8 @@ function ScanTerminalScreen() {
|
||||
disabled={scanLoading}
|
||||
title={
|
||||
isEn
|
||||
? "Force refresh decision cards and calendar"
|
||||
: "强制刷新决策卡和日历视图"
|
||||
? "Force refresh decision cards"
|
||||
: "强制刷新决策卡"
|
||||
}
|
||||
>
|
||||
<RefreshCw size={14} className={scanLoading ? "spin" : undefined} />
|
||||
|
||||
Reference in New Issue
Block a user