Remove view-all links and preserve manual map zoom

This commit is contained in:
2569718930@qq.com
2026-04-23 06:08:10 +08:00
parent f4c189bdcf
commit e4d43ddf8c
3 changed files with 16 additions and 17 deletions
@@ -2131,12 +2131,6 @@
line-height: 1.2;
}
.root :global(.home-summary-card-head span) {
color: #60a5fa;
font-size: 10px;
font-weight: 700;
}
.root :global(.home-summary-card-body) {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
@@ -2197,13 +2191,6 @@
line-height: 1.25;
}
.root :global(.opportunity-view-all) {
color: #60a5fa;
text-decoration: none;
font-size: 12px;
font-weight: 700;
}
.root :global(.opportunity-card-grid) {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
@@ -1153,7 +1153,6 @@ function OpportunityStrip({ snapshots }: { snapshots: CitySnapshot[] }) {
<div key={card.key} className="home-summary-card">
<div className="home-summary-card-head">
<strong>{card.title}</strong>
<span>{locale === "en-US" ? "View all" : "查看全部"}</span>
</div>
<div className="home-summary-card-body">
{card.items.map((item) => (
@@ -1189,9 +1188,6 @@ function OpportunityStrip({ snapshots }: { snapshots: CitySnapshot[] }) {
: "当前市场问题 · YES/NO 价格 · Edge · 小趋势线"}
</strong>
</div>
<Link href="/docs/intraday-signal" className="opportunity-view-all">
{locale === "en-US" ? "View all" : "查看全部"}
</Link>
</div>
{items.length > 0 ? (
<div className="opportunity-card-grid top-opportunities">
+16
View File
@@ -33,6 +33,7 @@ const AUTO_NEARBY_MIN_ZOOM = 8;
const AUTO_NEARBY_MAX_DISTANCE_M = 120000;
const AUTO_NEARBY_IDLE_REFRESH_DELAY_MS = 10_000;
const AUTO_NEARBY_MIN_REFRESH_INTERVAL_MS = 60_000;
const USER_CAMERA_OVERRIDE_MS = 10 * 60_000;
const MAP_MAX_ZOOM = 19;
const MAP_TILE_URLS = {
dark: "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",
@@ -405,6 +406,8 @@ export function useLeafletMap({
const loadingAutoNearbyRef = useRef(false);
const handlingAutoNearbyRef = useRef(false);
const lastMovedCityRef = useRef<string | null>(null);
const lastCameraSelectionRef = useRef<string | null>(null);
const lastUserCameraInteractionAtRef = useRef(0);
const suspendMotionRef = useRef(suspendMotion);
const hasFittedInitialBoundsRef = useRef(false);
const onClosePanelRef = useRef(onClosePanel);
@@ -482,6 +485,7 @@ export function useLeafletMap({
map.on("click", handleMapClick);
const markInteracting = () => {
lastUserCameraInteractionAtRef.current = Date.now();
if (interactionIdleTimerRef.current) {
clearTimeout(interactionIdleTimerRef.current);
interactionIdleTimerRef.current = null;
@@ -887,6 +891,7 @@ export function useLeafletMap({
useEffect(() => {
if (!selectedCity) {
lastMovedCityRef.current = null;
lastCameraSelectionRef.current = null;
return;
}
@@ -903,6 +908,17 @@ export function useLeafletMap({
const entry = markersRef.current[selectedCity];
if (!entry) return;
const selectionChanged = lastCameraSelectionRef.current !== selectedCity;
lastCameraSelectionRef.current = selectedCity;
if (
!selectionChanged &&
Date.now() - lastUserCameraInteractionAtRef.current < USER_CAMERA_OVERRIDE_MS
) {
lastMovedCityRef.current = selectedCity;
return;
}
// Lock the move
lastMovedCityRef.current = selectedCity;