完善搜索点位分类与稳定定位
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-12 04:10:34 +08:00
parent d8420fc7c2
commit f94af2de4d
5 changed files with 188 additions and 37 deletions

View File

@@ -86,13 +86,17 @@ const toGuideRenderPoi = (poi: MuseumPoi): GuideRenderPoi => ({
const toSgsRenderPoi = (poi: ReturnType<typeof toMuseumPoiFromSgs>) => toGuideRenderPoi(poi)
const getRenderPoiDedupeKeys = (poi: GuideRenderPoi) => [
poi.id ? `id:${poi.id}` : '',
poi.sourceSpaceId ? `space:${poi.floorId}:${poi.sourceSpaceId}` : '',
poi.spaceId ? `space:${poi.floorId}:${poi.spaceId}` : '',
poi.sourcePlaceId ? `place:${poi.floorId}:${poi.sourcePlaceId}` : '',
poi.sourceObjectName ? `object:${poi.floorId}:${poi.sourceObjectName}` : ''
].filter(Boolean)
const getRenderPoiDedupeKeys = (poi: GuideRenderPoi) => {
const stableKeys = [
poi.id ? `id:${poi.id}` : '',
poi.sourceSpaceId ? `space:${poi.floorId}:${poi.sourceSpaceId}` : '',
poi.spaceId ? `space:${poi.floorId}:${poi.spaceId}` : '',
poi.sourcePlaceId ? `place:${poi.floorId}:${poi.sourcePlaceId}` : ''
].filter(Boolean)
if (stableKeys.length) return stableKeys
return poi.sourceObjectName ? [`object:${poi.floorId}:${poi.sourceObjectName}`] : []
}
const dedupeRenderPoisById = (pois: GuideRenderPoi[]) => {
const seen = new Set<string>()
@@ -523,7 +527,7 @@ export class SgsSdkGuideModelRepository implements GuideModelRepository {
fallbackHallY: floorPoiMedianY ?? null
})
if (hallDiagnostics.hallPoiWithPositionCount > 0 && !renderPois.some((poi) => poi.primaryCategory === 'exhibition_hall')) {
if (hallDiagnostics.hallPoiWithPositionCount > 0 && !renderHallPois.length) {
warnSgsGuideModelDiagnostics('render POI filter removed all hall POIs', {
floorId: resolvedFloorId,
...hallDiagnostics,