@asd20/ui-next 2.21.5 → 2.21.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.21.6](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.21.5...ui-next-v2.21.6) (2026-08-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * improve relevance of related pages in search results ([ecbcad7](https://github.com/academydistrict20/asd20-ui-next/commit/ecbcad7f5df39273dc6a5b1299b1c94d766d6af3))
9
+
3
10
  ## [2.21.5](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.21.4...ui-next-v2.21.5) (2026-08-21)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asd20/ui-next",
3
- "version": "2.21.5",
3
+ "version": "2.21.6",
4
4
  "private": false,
5
5
  "description": "ASD20 UI component library for Vue 3.",
6
6
  "license": "MIT",
@@ -2441,10 +2441,19 @@ export default {
2441
2441
  return turn.relatedPages
2442
2442
  },
2443
2443
 
2444
- buildAiRelatedPagesPreview(items = this.pageListItems) {
2445
- if (!Array.isArray(items) || !items.length) return []
2444
+ buildAiRelatedPagesPreview(items = null) {
2445
+ const previewItems = Array.isArray(items)
2446
+ ? items
2447
+ : Array.isArray(this.currentPages)
2448
+ ? this.currentPages.map(page => ({
2449
+ page,
2450
+ label: page && page.title ? page.title : '',
2451
+ link: page && page.url ? page.url : '',
2452
+ }))
2453
+ : []
2454
+ if (!previewItems.length) return []
2446
2455
 
2447
- return items
2456
+ return previewItems
2448
2457
  .map((item, index) => {
2449
2458
  const page = item && item.page ? item.page : {}
2450
2459
  if (page.isNoResultsFallback) return null
@@ -2491,12 +2500,13 @@ export default {
2491
2500
  },
2492
2501
 
2493
2502
  completeAiTurnRelatedPages(turnId, runId) {
2494
- if (!turnId || !this.isCurrentSearchRun(runId)) return false
2503
+ if (!turnId || !this.isCurrentSearchRun(runId)) return []
2504
+ const relatedPages = this.buildAiRelatedPagesPreview()
2495
2505
  this.updateAiTranscriptTurn(turnId, {
2496
- relatedPages: this.buildAiRelatedPagesPreview(),
2506
+ relatedPages,
2497
2507
  relatedPagesStatus: 'complete',
2498
2508
  })
2499
- return true
2509
+ return relatedPages
2500
2510
  },
2501
2511
 
2502
2512
  setAiTurnSearchLogId(turnId, searchLogId) {
@@ -2691,6 +2701,7 @@ export default {
2691
2701
  keywords: this.keywords,
2692
2702
  question: this.searchQuestion || this.inputText,
2693
2703
  }
2704
+ if (options.purpose) searchInput.purpose = options.purpose
2694
2705
 
2695
2706
  this.searchingPages = true
2696
2707
  try {
@@ -3116,12 +3127,16 @@ export default {
3116
3127
  this.keywordsFromAi = true
3117
3128
  this.skipKeywordWatcher = true
3118
3129
  this.keywords = keywordsToUse
3119
- await this.searchPages({ keepAnswersTab: true, runId })
3130
+ await this.searchPages({
3131
+ keepAnswersTab: true,
3132
+ purpose: 'ai-related-pages',
3133
+ runId,
3134
+ })
3120
3135
  if (!this.isCurrentSearchRun(runId)) return
3121
- this.completeAiTurnRelatedPages(assistantTurnId, runId)
3122
- relatedPagesForAnalytics = this.getAnalyticsPages()
3123
- .slice(0, 10)
3124
- .map(p => ({ title: p.title || '', url: p.url || '' }))
3136
+ relatedPagesForAnalytics = this.completeAiTurnRelatedPages(
3137
+ assistantTurnId,
3138
+ runId
3139
+ ).map(p => ({ title: p.title || '', url: p.url || '' }))
3125
3140
  this.searchFilesWithGroupOwners({ runId })
3126
3141
  }
3127
3142
 
@@ -3169,29 +3184,12 @@ export default {
3169
3184
  }
3170
3185
 
3171
3186
  // Log AI search analytics
3172
- const logPagesFromPages =
3173
- relatedPagesForAnalytics.length > 0
3174
- ? relatedPagesForAnalytics
3175
- : this.getAnalyticsPages()
3176
- .slice(0, 10)
3177
- .map(p => ({ title: p.title || '', url: p.url || '' }))
3178
- const logPagesFromSources = (
3179
- Array.isArray(this.aiSources) ? this.aiSources : []
3180
- )
3181
- .slice(0, 10)
3182
- .map(source => ({
3183
- title: source && source.title ? source.title : '',
3184
- url: source && source.url ? source.url : '',
3185
- }))
3186
- .filter(source => source.url)
3187
- const logPages =
3188
- logPagesFromPages.length > 0 ? logPagesFromPages : logPagesFromSources
3189
3187
  const logPromise = logSearchAnalytics({
3190
3188
  question: normalizedQuestion,
3191
3189
  searchType: 'ai_chat',
3192
3190
  keywords: this.keywords || '',
3193
3191
  hadResults: !!this.aiAnswer,
3194
- relatedPages: logPages,
3192
+ relatedPages: relatedPagesForAnalytics,
3195
3193
  organizationId:
3196
3194
  this.organization && this.organization.id
3197
3195
  ? this.organization.id