gramene-search 2.15.0 → 2.15.2

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/dist/index.js CHANGED
@@ -4673,7 +4673,7 @@ var $4f15cd8a7d970b18$export$2e2bcd8739ae039 = $4f15cd8a7d970b18$var$exprViz;
4673
4673
 
4674
4674
 
4675
4675
 
4676
- // Shared vocabulary and helpers for the sorghum_v11 per-gene expression
4676
+ // Shared vocabulary and helpers for the sorghum_v10b per-gene expression
4677
4677
  // attributes (`expr_*__attr_*`). Used by both the Homology tbrowse Expression
4678
4678
  // zone (results/details/exprAttrsZone.js) and the Attribute table view
4679
4679
  // (attrTable/AttrTableView.js) so organ ordering and the ordinal level colors
@@ -6700,7 +6700,7 @@ const $85a9f6732ceb79db$var$savedViews = {
6700
6700
  state: snapshot
6701
6701
  })
6702
6702
  });
6703
- if (!res.ok) throw new Error(`Save failed (${res.status})`);
6703
+ if (!res.ok) throw $85a9f6732ceb79db$var$savedViewsError('Save', res.status);
6704
6704
  }
6705
6705
  const shareUrl = $85a9f6732ceb79db$var$buildShareUrl(hash);
6706
6706
  dispatch({
@@ -6748,7 +6748,7 @@ const $85a9f6732ceb79db$var$savedViews = {
6748
6748
  });
6749
6749
  if (res.status === 401) throw new Error('Sign in to load this private view.');
6750
6750
  if (res.status === 404) throw new Error('Saved view not found (it may have been deleted).');
6751
- if (!res.ok) throw new Error(`Fetch failed (${res.status})`);
6751
+ if (!res.ok) throw $85a9f6732ceb79db$var$savedViewsError('Fetch', res.status);
6752
6752
  row = await res.json();
6753
6753
  }
6754
6754
  const out = {
@@ -6802,7 +6802,7 @@ const $85a9f6732ceb79db$var$savedViews = {
6802
6802
  const res = await fetch(url, {
6803
6803
  headers: headers
6804
6804
  });
6805
- if (!res.ok) throw new Error(`List failed (${res.status})`);
6805
+ if (!res.ok) throw $85a9f6732ceb79db$var$savedViewsError('List', res.status);
6806
6806
  rows = await res.json();
6807
6807
  }
6808
6808
  dispatch({
@@ -6846,7 +6846,7 @@ const $85a9f6732ceb79db$var$savedViews = {
6846
6846
  },
6847
6847
  body: JSON.stringify(updates)
6848
6848
  });
6849
- if (!res.ok) throw new Error(`Update failed (${res.status})`);
6849
+ if (!res.ok) throw $85a9f6732ceb79db$var$savedViewsError('Update', res.status);
6850
6850
  return res.json();
6851
6851
  },
6852
6852
  // DELETE one of my saved views. Mirrors deleteList.
@@ -6865,7 +6865,7 @@ const $85a9f6732ceb79db$var$savedViews = {
6865
6865
  Authorization: `Bearer ${token}`
6866
6866
  }
6867
6867
  });
6868
- if (!res.ok) throw new Error(`Delete failed (${res.status})`);
6868
+ if (!res.ok) throw $85a9f6732ceb79db$var$savedViewsError('Delete', res.status);
6869
6869
  return res.json();
6870
6870
  },
6871
6871
  doResetSavedViewState: ()=>({ dispatch: dispatch })=>dispatch({
@@ -6882,6 +6882,13 @@ const $85a9f6732ceb79db$var$savedViews = {
6882
6882
  }
6883
6883
  };
6884
6884
  // ── helpers ─────────────────────────────────────────────────────────────
6885
+ // A 405 on any saved_views call means the API route isn't deployed on this
6886
+ // backend — the request falls through to the read-only /{collection} handler.
6887
+ // Surface that as a clear, non-alarming message rather than a raw status code.
6888
+ function $85a9f6732ceb79db$var$savedViewsError(action, status) {
6889
+ if (status === 405) return new Error('Saved views are not available on this server yet.');
6890
+ return new Error(`${action} failed (${status})`);
6891
+ }
6885
6892
  // Test/dev: either set the runtime-only flag (`window.__SAVED_VIEWS_MOCK__ = true`,
6886
6893
  // cleared on reload), or persist via localStorage (`localStorage.setItem(
6887
6894
  // '__SAVED_VIEWS_MOCK__', 'true')`, survives reloads — needed for the
@@ -20644,11 +20651,13 @@ const $693dd8c7a5607c3a$var$ResultsCmp = (props)=>{
20644
20651
  const divRef = (0, $gXNCa$react.useRef)(null);
20645
20652
  (0, $gXNCa$react.useEffect)(()=>{
20646
20653
  if (v.shouldScroll) {
20647
- const navBarHeight = 0;
20648
- const scrollPosition = divRef.current.offsetTop - navBarHeight;
20649
- window.scrollTo({
20650
- top: scrollPosition,
20651
- behavior: 'smooth'
20654
+ // scrollIntoView scrolls whichever ancestor is scrollable — the
20655
+ // window on most layouts, or the results pane when the sidebar and
20656
+ // results scroll independently (e.g. the sorghumbase app shell).
20657
+ // window.scrollTo would be a no-op in that pane-scroll case.
20658
+ if (divRef.current) divRef.current.scrollIntoView({
20659
+ behavior: 'smooth',
20660
+ block: 'start'
20652
20661
  });
20653
20662
  props.doCancelShouldScroll();
20654
20663
  }