Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/web-app/app/components/user/ProfileCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ const { app } = useAppConfig()

useSchemaOrg([
definePerson({
name: user.name,
image: user.avatarUrl,
url: `${app.url}/u/${user.username}`,
'@type': 'Person',
'name': user.name,
'image': user.avatarUrl,
'url': `${app.url}/u/${user.username}`,
}),
])
</script>
23 changes: 13 additions & 10 deletions apps/web-app/app/pages/[pageSlug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,19 @@ const submenuItems = computed<NavigationMenuItem[]>(() => [
])

useSchemaOrg([
defineLocalBusiness({
url: `${app.url}/${params.pageSlug}`,
name: page.value?.title,
}),
defineAggregateRating({
'@type': 'AggregateRating',
'ratingValue': page.value?.rating,
'ratingCount': page.value?.reviewsCount,
'bestRating': 5,
'worstRating': 1,
defineOrganization({
'@type': 'LocalBusiness',
'name': page.value?.title,
'url': `${app.url}/${page.value?.slug}`,
'priceRange': '₽',
'aggregateRating': {
'@type': 'AggregateRating',
'ratingValue': page.value?.rating,
'ratingCount': page.value?.reviewsCount,
'reviewCount': page.value?.reviewsCount,
'bestRating': 5,
'worstRating': 1,
},
}),
])
</script>
16 changes: 15 additions & 1 deletion apps/web-app/app/pages/[pageSlug]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const { data: page } = await useFetch(`/api/page/slug/${params.pageSlug}`)

const mainCategory = computed(() => page.value?.categories[0]?.category)

useBreadcrumb().setItems([
const breadcrumbItems = computed(() => [
{
label: 'Главная',
icon: 'i-lucide-house',
Expand All @@ -32,6 +32,20 @@ useBreadcrumb().setItems([
},
])

useBreadcrumb().setItems(breadcrumbItems.value)
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The computed() property's reactivity is not being used. breadcrumbItems.value is read once during setup, so changes to page or mainCategory won't update the breadcrumbs. Consider using watch or watchEffect if reactivity is needed, or remove computed() if it's not.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/web-app/app/pages/[pageSlug]/index.vue, line 35:

<comment>The `computed()` property&#39;s reactivity is not being used. `breadcrumbItems.value` is read once during setup, so changes to `page` or `mainCategory` won&#39;t update the breadcrumbs. Consider using `watch` or `watchEffect` if reactivity is needed, or remove `computed()` if it&#39;s not.</comment>

<file context>
@@ -32,6 +32,20 @@ useBreadcrumb().setItems([
   },
 ])
 
+useBreadcrumb().setItems(breadcrumbItems.value)
+
+useSchemaOrg([
</file context>
Suggested change
useBreadcrumb().setItems(breadcrumbItems.value)
watch(breadcrumbItems, (items) => useBreadcrumb().setItems(items), { immediate: true })
Fix with Cubic


useSchemaOrg([
defineBreadcrumb({
'@type': 'BreadcrumbList',
'itemListElement': breadcrumbItems.value.map((item, index) => ({
'@type': 'ListItem',
'position': index + 1,
'name': item.label,
'item': item.to ?? undefined,
})),
}),
])

useHead({
title: `${mainCategory.value?.title ?? ''} «${page.value?.title}»`,
})
Expand Down
16 changes: 15 additions & 1 deletion apps/web-app/app/pages/[pageSlug]/points.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const { data: page } = await useFetch(`/api/page/slug/${params.pageSlug}`)

const mainCategory = computed(() => page.value?.categories[0]?.category)

useBreadcrumb().setItems([
const breadcrumbItems = computed(() => [
{
label: 'Главная',
icon: 'i-lucide-house',
Expand All @@ -43,6 +43,20 @@ useBreadcrumb().setItems([
},
])

useBreadcrumb().setItems(breadcrumbItems.value)

useSchemaOrg([
defineBreadcrumb({
'@type': 'BreadcrumbList',
'itemListElement': breadcrumbItems.value.map((item, index) => ({
'@type': 'ListItem',
'position': index + 1,
'name': item.label,
'item': item.to ?? undefined,
})),
}),
])

useHead({
title: `Адреса «${page.value?.title}»`,
})
Expand Down
16 changes: 15 additions & 1 deletion apps/web-app/app/pages/[pageSlug]/reviews.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function updateData() {

const mainCategory = computed(() => page.value?.categories[0]?.category)

useBreadcrumb().setItems([
const breadcrumbItems = computed(() => [
{
label: 'Главная',
icon: 'i-lucide-house',
Expand All @@ -71,6 +71,20 @@ useBreadcrumb().setItems([
},
])

useBreadcrumb().setItems(breadcrumbItems.value)

useSchemaOrg([
defineBreadcrumb({
'@type': 'BreadcrumbList',
'itemListElement': breadcrumbItems.value.map((item, index) => ({
'@type': 'ListItem',
'position': index + 1,
'name': item.label,
'item': item.to ?? undefined,
})),
}),
])
Comment on lines +76 to +86
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Schema.org requires absolute URLs for breadcrumb items.

The item property in BreadcrumbList should contain absolute URLs (e.g., https://example.com/page) rather than relative paths. This impacts SEO and structured data validation by search engines.

Consider constructing absolute URLs using the app configuration:

+const { app } = useAppConfig()
+
 useSchemaOrg([
   defineBreadcrumb({
     '@type': 'BreadcrumbList',
     'itemListElement': breadcrumbItems.value.map((item, index) => ({
       '@type': 'ListItem',
       'position': index + 1,
       'name': item.label,
-      'item': item.to ?? undefined,
+      'item': item.to ? `${app.url}${item.to}` : undefined,
     })),
   }),
 ])

Alternatively, omit the item property entirely when to is undefined:

 useSchemaOrg([
   defineBreadcrumb({
     '@type': 'BreadcrumbList',
     'itemListElement': breadcrumbItems.value.map((item, index) => ({
       '@type': 'ListItem',
       'position': index + 1,
       'name': item.label,
-      'item': item.to ?? undefined,
+      ...(item.to && { 'item': `${app.url}${item.to}` }),
     })),
   }),
 ])
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useSchemaOrg([
defineBreadcrumb({
'@type': 'BreadcrumbList',
'itemListElement': breadcrumbItems.value.map((item, index) => ({
'@type': 'ListItem',
'position': index + 1,
'name': item.label,
'item': item.to ?? undefined,
})),
}),
])
const { app } = useAppConfig()
useSchemaOrg([
defineBreadcrumb({
'@type': 'BreadcrumbList',
'itemListElement': breadcrumbItems.value.map((item, index) => ({
'@type': 'ListItem',
'position': index + 1,
'name': item.label,
'item': item.to ? `${app.url}${item.to}` : undefined,
})),
}),
])
🤖 Prompt for AI Agents
In apps/web-app/app/pages/[pageSlug]/reviews.vue around lines 76 to 86, the
BreadcrumbList currently sets each item's "item" to the raw `to` (which may be a
relative path); change this to produce absolute URLs or omit the property when
`to` is undefined: obtain the site base URL from runtime config (e.g.
useRuntimeConfig().public.siteUrl or equivalent), then map breadcrumbItems so
that for entries with a `to` value you build an absolute URL (e.g. new
URL(item.to, base).toString()) and assign that to `item`, and for entries
without `to` either set `item` to undefined or omit the `item` key entirely so
only absolute URLs appear in the Schema.org BreadcrumbList.


useHead({
title: `Отзывы «${page.value?.title}»`,
})
Expand Down