fix проставление точек
Gitea Actions Demo / build_and_push (push) Successful in 1m25s Details

This commit is contained in:
artem 2026-10-02 17:38:22 +03:00
parent de2728ccb9
commit 75b07057ae
2 changed files with 19 additions and 23 deletions

View File

@ -2,11 +2,11 @@
## Task State
- task_id: TASK-SSR-EXPLORE-CARDS
- task_id: TASK-MAP-DOTS-RESET
- status: success
- summary: **SSR `/explore` теперь рендерит карточки 1:1 с клиентом: `<section class="news-feed">` → `<article class="news-item">` (`.news-item-header`→`<h3><a>`, `ul.metadata` 9 условных `<li>` в порядке клиента, `.image-container`-`<a>` с background-image). Хэндлер + `distInt` в `server/index.ts`; добавлен отсутствовавший `tsconfig.server.json` (`yarn server:build` теперь работает).**
- summary: **Фикс: серые точки на карте нельзя поставить повторно после reset. Корень: `resetChartZoom()` не очищает `mapX` и `clickCoordinates`. Фикс: добавить `mapX.value = []` + `clickCoordinates.value = []` в `resetChartZoom()`; inline onClick вынесен в `onMapClick` (строка 536). `yarn build` exit 0.**
- next task: —
- plan: `plans/TASK-SSR-EXPLORE-CARDS.md`
- plan: `plans/TASK-MAP-DOTS-RESET.md`
## ✅ CODER SUCCESS REPORT — TASK-INTEG-SECTION (+TASK-SECTION-BUGS)

View File

@ -25,26 +25,7 @@
},
}"
/>
<yandex-map-listener
:settings="{
onClick: (_: any, e: any) => {
const xIndex = findNearestTrackIndex(
e.coordinates[0],
e.coordinates[1],
);
if (mapX.length >= 2 || xIndex < 0) {
mapX = [];
clickCoordinates = [];
group.redrawAll();
}
if (xIndex >= 0) {
clickCoordinates.push(lineCoordinates[xIndex] as LngLat);
mapX.push(xIndex);
group.redrawAll();
}
},
}"
/>
<yandex-map-listener :settings="{ onClick: onMapClick }" />
<yandex-map-feature
v-if="markedCoordinats"
:settings="{
@ -552,6 +533,19 @@ const findNearestTrackIndex = (lng: number, lat: number): number => {
}
return bestDist <= CLICK_TRACK_RADIUS_M ? bestIdx : -1;
};
const onMapClick = (_: unknown, e: { coordinates: LngLat }): void => {
const xIndex = findNearestTrackIndex(e.coordinates[0], e.coordinates[1]);
if (mapX.value.length >= 2 || xIndex < 0) {
mapX.value = [];
clickCoordinates.value = [];
group.redrawAll();
}
if (xIndex >= 0) {
clickCoordinates.value.push(lineCoordinates[xIndex] as LngLat);
mapX.value.push(xIndex);
group.redrawAll();
}
};
ChartJS.register(
Title,
Tooltip,
@ -1502,6 +1496,8 @@ const resetChartZoom = () => {
selectedRange.value = null;
areaAvgData.value = {};
markedCoordinats.value = [];
mapX.value = [];
clickCoordinates.value = [];
};
</script>