@asd20/ui-next 2.11.0 → 2.11.1
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.11.1](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.11.0...ui-next-v2.11.1) (2026-05-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* remove search parameters from url ([b6bde4c](https://github.com/academydistrict20/asd20-ui-next/commit/b6bde4cb29ea762267ecd03f9739a47d8726ce1e))
|
|
9
|
+
|
|
3
10
|
# [2.11.0](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.10.11...ui-next-v2.11.0) (2026-05-26)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -683,7 +683,6 @@ export default {
|
|
|
683
683
|
searchMode: '',
|
|
684
684
|
routeRestoreInProgress: false,
|
|
685
685
|
lastRestoredSearchKey: '',
|
|
686
|
-
skipNextRouteRestore: false,
|
|
687
686
|
suppressAutoRestore: false,
|
|
688
687
|
lastManualTabChangeAt: 0,
|
|
689
688
|
lastManualTabLabel: '',
|
|
@@ -1077,9 +1076,9 @@ export default {
|
|
|
1077
1076
|
this.focusQuery()
|
|
1078
1077
|
this.refreshResultsScrollLayer()
|
|
1079
1078
|
})
|
|
1080
|
-
this.
|
|
1079
|
+
this.restoreSearchState()
|
|
1081
1080
|
} else {
|
|
1082
|
-
this.
|
|
1081
|
+
this.clearLegacySearchRouteQuery()
|
|
1083
1082
|
if (!this.inline) this.unlockBodyScroll()
|
|
1084
1083
|
this.blurQuery()
|
|
1085
1084
|
}
|
|
@@ -1090,7 +1089,7 @@ export default {
|
|
|
1090
1089
|
if (newVal === 'Answers') {
|
|
1091
1090
|
this.$nextTick(() => this.refreshResultsScrollLayer())
|
|
1092
1091
|
}
|
|
1093
|
-
this.
|
|
1092
|
+
this.syncSearchState({ tab: newVal })
|
|
1094
1093
|
},
|
|
1095
1094
|
|
|
1096
1095
|
aiAnswer() {
|
|
@@ -1115,7 +1114,7 @@ export default {
|
|
|
1115
1114
|
this.selectedGroup = null
|
|
1116
1115
|
this.searchPages({ runId })
|
|
1117
1116
|
this.searchFilesWithGroupOwners({ runId })
|
|
1118
|
-
this.
|
|
1117
|
+
this.syncSearchState()
|
|
1119
1118
|
}
|
|
1120
1119
|
}, 400),
|
|
1121
1120
|
|
|
@@ -1124,7 +1123,7 @@ export default {
|
|
|
1124
1123
|
const runId = this.beginSearchRun()
|
|
1125
1124
|
this.searchPages({ runId })
|
|
1126
1125
|
this.searchFilesWithGroupOwners({ runId })
|
|
1127
|
-
this.
|
|
1126
|
+
this.syncSearchState()
|
|
1128
1127
|
},
|
|
1129
1128
|
// Clear AI answer if user clears the input
|
|
1130
1129
|
|
|
@@ -1137,34 +1136,20 @@ export default {
|
|
|
1137
1136
|
this.aiKeywordsDisplayPages = ''
|
|
1138
1137
|
}
|
|
1139
1138
|
},
|
|
1140
|
-
|
|
1141
|
-
'$route.query': {
|
|
1142
|
-
handler() {
|
|
1143
|
-
if (this.suppressAutoRestore) return
|
|
1144
|
-
if (this.searchingAi) return
|
|
1145
|
-
if (this.hasRecentManualTabSelection()) return
|
|
1146
|
-
if (this.skipNextRouteRestore) {
|
|
1147
|
-
this.skipNextRouteRestore = false
|
|
1148
|
-
return
|
|
1149
|
-
}
|
|
1150
|
-
if (!this.getRouteSearchState(this.$route.query)) {
|
|
1151
|
-
this.lastRestoredSearchKey = ''
|
|
1152
|
-
}
|
|
1153
|
-
if (this.active) this.restoreSearchStateFromRoute()
|
|
1154
|
-
},
|
|
1155
|
-
},
|
|
1156
1139
|
},
|
|
1157
1140
|
|
|
1158
1141
|
mounted() {
|
|
1159
1142
|
if (this.active && !this.inline) {
|
|
1160
1143
|
this.lockBodyScroll()
|
|
1161
1144
|
}
|
|
1162
|
-
|
|
1145
|
+
const didReload = this.didPageReload()
|
|
1146
|
+
if (didReload) {
|
|
1163
1147
|
this.persistSearchState(null)
|
|
1164
1148
|
this.lastRestoredSearchKey = ''
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1149
|
+
}
|
|
1150
|
+
this.clearLegacySearchRouteQuery()
|
|
1151
|
+
if (!didReload && this.active) {
|
|
1152
|
+
this.restoreSearchState()
|
|
1168
1153
|
}
|
|
1169
1154
|
if (typeof window !== 'undefined') {
|
|
1170
1155
|
window.addEventListener('resize', this.onWindowReflow, { passive: true })
|
|
@@ -1323,11 +1308,6 @@ export default {
|
|
|
1323
1308
|
}
|
|
1324
1309
|
},
|
|
1325
1310
|
|
|
1326
|
-
normalizeRouteQueryValue(value) {
|
|
1327
|
-
if (Array.isArray(value)) return value[0]
|
|
1328
|
-
return value
|
|
1329
|
-
},
|
|
1330
|
-
|
|
1331
1311
|
isLocalDevelopmentHost(hostname = '') {
|
|
1332
1312
|
if (!hostname || typeof hostname !== 'string') return false
|
|
1333
1313
|
const lower = hostname.toLowerCase()
|
|
@@ -1406,7 +1386,7 @@ export default {
|
|
|
1406
1386
|
if (this.searchingAi) return
|
|
1407
1387
|
if (this.hasRecentManualTabSelection()) return
|
|
1408
1388
|
if (!this.active || this.routeRestoreInProgress) return
|
|
1409
|
-
this.
|
|
1389
|
+
this.restoreSearchState()
|
|
1410
1390
|
},
|
|
1411
1391
|
|
|
1412
1392
|
hasRecentManualTabSelection() {
|
|
@@ -1560,7 +1540,7 @@ export default {
|
|
|
1560
1540
|
},
|
|
1561
1541
|
|
|
1562
1542
|
persistSearchCacheSnapshot(overrides = {}) {
|
|
1563
|
-
const state = this.
|
|
1543
|
+
const state = this.getCurrentSearchState(overrides)
|
|
1564
1544
|
if (!state) return
|
|
1565
1545
|
this.persistSearchState(state, {
|
|
1566
1546
|
cache: this.buildSearchCacheSnapshot(),
|
|
@@ -1673,33 +1653,7 @@ export default {
|
|
|
1673
1653
|
return true
|
|
1674
1654
|
},
|
|
1675
1655
|
|
|
1676
|
-
|
|
1677
|
-
const rawText = this.normalizeRouteQueryValue(
|
|
1678
|
-
routeQuery[SEARCH_ROUTE_QUERY_KEYS.text]
|
|
1679
|
-
)
|
|
1680
|
-
const rawIncludeDistrictResults = this.normalizeRouteQueryValue(
|
|
1681
|
-
routeQuery[SEARCH_ROUTE_QUERY_KEYS.includeDistrictResults]
|
|
1682
|
-
)
|
|
1683
|
-
const rawMode = this.normalizeRouteQueryValue(
|
|
1684
|
-
routeQuery[SEARCH_ROUTE_QUERY_KEYS.mode]
|
|
1685
|
-
)
|
|
1686
|
-
const rawTab = this.normalizeRouteQueryValue(
|
|
1687
|
-
routeQuery[SEARCH_ROUTE_QUERY_KEYS.tab]
|
|
1688
|
-
)
|
|
1689
|
-
const rawUpdatedAt = this.normalizeRouteQueryValue(
|
|
1690
|
-
routeQuery[SEARCH_ROUTE_QUERY_KEYS.updatedAt]
|
|
1691
|
-
)
|
|
1692
|
-
|
|
1693
|
-
return this.normalizeSearchState({
|
|
1694
|
-
text: rawText,
|
|
1695
|
-
mode: rawMode,
|
|
1696
|
-
tab: rawTab,
|
|
1697
|
-
includeDistrictResults: rawIncludeDistrictResults,
|
|
1698
|
-
updatedAt: rawUpdatedAt,
|
|
1699
|
-
})
|
|
1700
|
-
},
|
|
1701
|
-
|
|
1702
|
-
getCurrentSearchStateForRoute(overrides = {}) {
|
|
1656
|
+
getCurrentSearchState(overrides = {}) {
|
|
1703
1657
|
const hasSubmitted =
|
|
1704
1658
|
typeof overrides.hasSubmitted === 'boolean'
|
|
1705
1659
|
? overrides.hasSubmitted
|
|
@@ -1746,35 +1700,17 @@ export default {
|
|
|
1746
1700
|
}
|
|
1747
1701
|
},
|
|
1748
1702
|
|
|
1749
|
-
|
|
1750
|
-
if (!state) return {}
|
|
1751
|
-
const values = {
|
|
1752
|
-
[SEARCH_ROUTE_QUERY_KEYS.text]: state.text,
|
|
1753
|
-
[SEARCH_ROUTE_QUERY_KEYS.mode]: state.mode,
|
|
1754
|
-
[SEARCH_ROUTE_QUERY_KEYS.tab]: state.tab,
|
|
1755
|
-
[SEARCH_ROUTE_QUERY_KEYS.includeDistrictResults]:
|
|
1756
|
-
state.includeDistrictResults ? '1' : '0',
|
|
1757
|
-
}
|
|
1758
|
-
const updatedAt = Number(state.updatedAt)
|
|
1759
|
-
if (Number.isFinite(updatedAt) && updatedAt > 0) {
|
|
1760
|
-
values[SEARCH_ROUTE_QUERY_KEYS.updatedAt] = String(
|
|
1761
|
-
Math.round(updatedAt)
|
|
1762
|
-
)
|
|
1763
|
-
}
|
|
1764
|
-
return values
|
|
1765
|
-
},
|
|
1766
|
-
|
|
1767
|
-
buildQueryWithSearchState(state) {
|
|
1703
|
+
buildQueryWithoutSearchState() {
|
|
1768
1704
|
const nextQuery = { ...((this.$route && this.$route.query) || {}) }
|
|
1769
1705
|
Object.keys(SEARCH_ROUTE_QUERY_KEYS).forEach(key => {
|
|
1770
1706
|
delete nextQuery[SEARCH_ROUTE_QUERY_KEYS[key]]
|
|
1771
1707
|
})
|
|
1772
|
-
return
|
|
1708
|
+
return nextQuery
|
|
1773
1709
|
},
|
|
1774
1710
|
|
|
1775
|
-
async
|
|
1711
|
+
async clearLegacySearchRouteQuery() {
|
|
1776
1712
|
if (!this.$router || !this.$route) return
|
|
1777
|
-
const nextQuery = this.
|
|
1713
|
+
const nextQuery = this.buildQueryWithoutSearchState()
|
|
1778
1714
|
await this.replaceRouteQuery(nextQuery)
|
|
1779
1715
|
},
|
|
1780
1716
|
|
|
@@ -1800,25 +1736,20 @@ export default {
|
|
|
1800
1736
|
async replaceRouteQuery(query) {
|
|
1801
1737
|
if (!this.$router || !this.$route) return
|
|
1802
1738
|
if (this.isSameQuery(this.$route.query, query)) return
|
|
1803
|
-
this.skipNextRouteRestore = true
|
|
1804
1739
|
try {
|
|
1805
1740
|
await this.$router.replace({ path: this.$route.path, query })
|
|
1806
1741
|
} catch (error) {
|
|
1807
|
-
this.skipNextRouteRestore = false
|
|
1808
1742
|
// Ignore duplicate navigation and transient route replacement races.
|
|
1809
1743
|
}
|
|
1810
1744
|
},
|
|
1811
1745
|
|
|
1812
|
-
|
|
1746
|
+
syncSearchState(overrides = {}) {
|
|
1813
1747
|
if (this.routeRestoreInProgress) return
|
|
1814
|
-
|
|
1815
|
-
const state = this.getCurrentSearchStateForRoute(overrides)
|
|
1748
|
+
const state = this.getCurrentSearchState(overrides)
|
|
1816
1749
|
this.lastRestoredSearchKey = state
|
|
1817
|
-
? `
|
|
1750
|
+
? `storage:${JSON.stringify(state)}`
|
|
1818
1751
|
: ''
|
|
1819
1752
|
this.persistSearchState(state, { preserveCache: true })
|
|
1820
|
-
const nextQuery = this.buildQueryWithSearchState(state)
|
|
1821
|
-
await this.replaceRouteQuery(nextQuery)
|
|
1822
1753
|
},
|
|
1823
1754
|
|
|
1824
1755
|
appendSearchContextToUrl(rawUrl) {
|
|
@@ -1826,14 +1757,11 @@ export default {
|
|
|
1826
1757
|
return rawUrl
|
|
1827
1758
|
},
|
|
1828
1759
|
|
|
1829
|
-
async
|
|
1760
|
+
async restoreSearchState() {
|
|
1830
1761
|
if (this.suppressAutoRestore) return
|
|
1831
1762
|
if (this.searchingAi) return
|
|
1832
|
-
if (
|
|
1763
|
+
if (this.routeRestoreInProgress) return
|
|
1833
1764
|
const restoreStartedAt = Date.now()
|
|
1834
|
-
const routeStateCandidate = this.getRouteSearchState(this.$route.query)
|
|
1835
|
-
const routeStateFresh = this.isSearchStateFresh(routeStateCandidate)
|
|
1836
|
-
const routeState = routeStateFresh ? routeStateCandidate : null
|
|
1837
1765
|
const persistedRecordCandidate = this.readPersistedSearchRecord()
|
|
1838
1766
|
const persistedRecordFresh =
|
|
1839
1767
|
persistedRecordCandidate &&
|
|
@@ -1845,24 +1773,16 @@ export default {
|
|
|
1845
1773
|
if (persistedRecordCandidate && !persistedRecordFresh) {
|
|
1846
1774
|
this.persistSearchState(null)
|
|
1847
1775
|
}
|
|
1848
|
-
if (routeStateCandidate && !routeStateFresh) {
|
|
1849
|
-
await this.clearSearchStateFromRouteQuery()
|
|
1850
|
-
}
|
|
1851
1776
|
|
|
1852
|
-
const
|
|
1853
|
-
? null
|
|
1854
|
-
: persistedRecord && persistedRecord.state
|
|
1855
|
-
? persistedRecord.state
|
|
1856
|
-
: null
|
|
1857
|
-
const restoredState = routeState || persistedState
|
|
1777
|
+
const restoredState =
|
|
1778
|
+
persistedRecord && persistedRecord.state ? persistedRecord.state : null
|
|
1858
1779
|
if (!restoredState) return
|
|
1859
1780
|
|
|
1860
|
-
const restoreSource = routeState ? 'route' : 'storage'
|
|
1861
1781
|
const cacheVersion = this.getSearchCacheVersion(
|
|
1862
1782
|
persistedRecord,
|
|
1863
1783
|
restoredState
|
|
1864
1784
|
)
|
|
1865
|
-
const restoreKey =
|
|
1785
|
+
const restoreKey = `storage:${JSON.stringify(
|
|
1866
1786
|
restoredState
|
|
1867
1787
|
)}:${cacheVersion}`
|
|
1868
1788
|
if (restoreKey === this.lastRestoredSearchKey) return
|
|
@@ -2253,7 +2173,7 @@ export default {
|
|
|
2253
2173
|
|
|
2254
2174
|
dismiss() {
|
|
2255
2175
|
if (!this.active) return
|
|
2256
|
-
this.
|
|
2176
|
+
this.clearLegacySearchRouteQuery()
|
|
2257
2177
|
this.$emit('update:active', false)
|
|
2258
2178
|
},
|
|
2259
2179
|
|
|
@@ -2460,7 +2380,7 @@ export default {
|
|
|
2460
2380
|
await this.clearSearchState()
|
|
2461
2381
|
this.currentTab = 'Answers'
|
|
2462
2382
|
this.persistSearchState(null)
|
|
2463
|
-
|
|
2383
|
+
this.syncSearchState({ hasSubmitted: false, text: '' })
|
|
2464
2384
|
this.lastRestoredSearchKey = ''
|
|
2465
2385
|
|
|
2466
2386
|
this.$nextTick(() => {
|
|
@@ -2602,7 +2522,7 @@ export default {
|
|
|
2602
2522
|
this.searchMode = ''
|
|
2603
2523
|
await this.clearSearchState()
|
|
2604
2524
|
this.persistSearchState(null)
|
|
2605
|
-
|
|
2525
|
+
this.syncSearchState({ hasSubmitted: false, text: '' })
|
|
2606
2526
|
this.lastRestoredSearchKey = ''
|
|
2607
2527
|
this.$nextTick(() => {
|
|
2608
2528
|
this.suppressAutoRestore = false
|
|
@@ -2617,7 +2537,7 @@ export default {
|
|
|
2617
2537
|
this.searchMode = mode
|
|
2618
2538
|
|
|
2619
2539
|
if (mode === 'question') {
|
|
2620
|
-
this.
|
|
2540
|
+
this.syncSearchState({ text, mode, tab: 'Answers' })
|
|
2621
2541
|
this.searchAi(text)
|
|
2622
2542
|
} else {
|
|
2623
2543
|
await this.clearSearchState()
|
|
@@ -2629,7 +2549,7 @@ export default {
|
|
|
2629
2549
|
this.searchFilesWithGroupOwners({ runId })
|
|
2630
2550
|
if (!this.isCurrentSearchRun(runId)) return
|
|
2631
2551
|
this.currentTab = 'Pages'
|
|
2632
|
-
this.
|
|
2552
|
+
this.syncSearchState({ text, mode, tab: 'Pages' })
|
|
2633
2553
|
this.$nextTick(() => this.refreshResultsScrollLayer())
|
|
2634
2554
|
|
|
2635
2555
|
// Log keyword-only search analytics
|