@proveanything/smartlinks-utils-ui 0.9.8 → 0.9.9
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.
|
@@ -737,26 +737,15 @@ var useFacetBrowse = ({
|
|
|
737
737
|
enabled: queryEnabled,
|
|
738
738
|
staleTime: 3e4,
|
|
739
739
|
queryFn: async () => {
|
|
740
|
-
const t0 = performance.now();
|
|
741
740
|
try {
|
|
742
741
|
if (SL?.facets?.list) {
|
|
743
|
-
console.info(`${LOG} \u2192 SL.facets.list("${collectionId}", { includeValues: true })`);
|
|
744
742
|
const res = await SL.facets.list(collectionId, { includeValues: true });
|
|
745
743
|
const items = res?.items ?? [];
|
|
746
|
-
console.info(
|
|
747
|
-
`${LOG} \u2190 SL.facets.list ok in ${Math.round(performance.now() - t0)}ms \u2014 ${items.length} facet(s)`,
|
|
748
|
-
items
|
|
749
|
-
);
|
|
750
744
|
return items;
|
|
751
745
|
}
|
|
752
746
|
if (SL?.facets?.publicList) {
|
|
753
|
-
console.info(`${LOG} \u2192 SL.facets.publicList("${collectionId}", { includeValues: true })`);
|
|
754
747
|
const res = await SL.facets.publicList(collectionId, { includeValues: true });
|
|
755
748
|
const items = res?.items ?? [];
|
|
756
|
-
console.info(
|
|
757
|
-
`${LOG} \u2190 SL.facets.publicList ok in ${Math.round(performance.now() - t0)}ms \u2014 ${items.length} facet(s)`,
|
|
758
|
-
items
|
|
759
|
-
);
|
|
760
749
|
return items;
|
|
761
750
|
}
|
|
762
751
|
console.warn(`${LOG} queryFn ran but no facets API is available on SL`);
|
|
@@ -773,7 +762,6 @@ var useFacetBrowse = ({
|
|
|
773
762
|
if (signature === lastLoggedRef.current) return;
|
|
774
763
|
lastLoggedRef.current = signature;
|
|
775
764
|
if (!enabled) {
|
|
776
|
-
console.info(`${LOG} skipped \u2014 enabled=false (shell not on facet tab yet)`);
|
|
777
765
|
return;
|
|
778
766
|
}
|
|
779
767
|
if (!collectionId) {
|
|
@@ -787,9 +775,6 @@ var useFacetBrowse = ({
|
|
|
787
775
|
);
|
|
788
776
|
return;
|
|
789
777
|
}
|
|
790
|
-
console.info(
|
|
791
|
-
`${LOG} will fetch facets for collection "${collectionId}" via ${hasAdminList ? "SL.facets.list (admin)" : "SL.facets.publicList (fallback)"}`
|
|
792
|
-
);
|
|
793
778
|
}, [enabled, collectionId, hasAdminList, hasPublicList, hasAnyList, SL]);
|
|
794
779
|
const mergedItems = useMemo(() => {
|
|
795
780
|
const existingByAnchor = new Map(
|
|
@@ -2164,6 +2149,13 @@ var useShellDeepLink = (args) => {
|
|
|
2164
2149
|
}
|
|
2165
2150
|
setPendingDeepLinkRecordId(recordId ?? null);
|
|
2166
2151
|
if (recordId) preserveInitialRecordIdRef.current = true;
|
|
2152
|
+
if (recordId) {
|
|
2153
|
+
console.info("[RecordsAdminShell] deep-link restore \u2014 pending recordId set", {
|
|
2154
|
+
recordId,
|
|
2155
|
+
scope: scope ?? null,
|
|
2156
|
+
view: view ?? null
|
|
2157
|
+
});
|
|
2158
|
+
}
|
|
2167
2159
|
if (!recordId && selectedItemId !== null) {
|
|
2168
2160
|
console.info("[RecordsAdminShell] preserving selected item during restore without recordId", {
|
|
2169
2161
|
selectedItemId,
|
|
@@ -2189,7 +2181,9 @@ var useShellDeepLink = (args) => {
|
|
|
2189
2181
|
warnedMissingRef.current.add(pending);
|
|
2190
2182
|
console.warn("[RecordsAdminShell] deep-linked recordId not found in collection items \u2014 clearing pending selection", {
|
|
2191
2183
|
recordId: pending,
|
|
2192
|
-
scope: editingScope?.raw ?? null
|
|
2184
|
+
scope: editingScope?.raw ?? null,
|
|
2185
|
+
collectionItemsCount: collectionItems.items.length,
|
|
2186
|
+
sampleIds: collectionItems.items.slice(0, 5).map((it) => ({ id: it.id, itemId: it.itemId }))
|
|
2193
2187
|
});
|
|
2194
2188
|
}
|
|
2195
2189
|
preserveInitialRecordIdRef.current = false;
|
|
@@ -2209,7 +2203,10 @@ var useShellDeepLink = (args) => {
|
|
|
2209
2203
|
warnedMissingRef.current.add(pending);
|
|
2210
2204
|
console.warn("[RecordsAdminShell] deep-linked recordId not found in records list \u2014 clearing pending selection", {
|
|
2211
2205
|
recordId: pending,
|
|
2212
|
-
scope: editingScope?.raw ?? null
|
|
2206
|
+
scope: editingScope?.raw ?? null,
|
|
2207
|
+
recordListCount: recordListItems.length,
|
|
2208
|
+
sampleIds: recordListItems.slice(0, 5).map((it) => it.id),
|
|
2209
|
+
activeScopeHint: "check that the shell tab matches the record's scope"
|
|
2213
2210
|
});
|
|
2214
2211
|
}
|
|
2215
2212
|
preserveInitialRecordIdRef.current = false;
|