diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 0dad2c5..d7bd37d 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -25,7 +25,7 @@ jobs: path: dist/ test: - name: Test (${{ matrix.jbrowse-version }}) + name: Test production builds needs: build-and-lint runs-on: ubuntu-latest strategy: diff --git a/config.json b/config.json index 8ccba33..4a3c192 100644 --- a/config.json +++ b/config.json @@ -117,5 +117,6 @@ } ] } - ] + ], + "aggregateTextSearchAdapters": [] } diff --git a/eslint.config.mjs b/eslint.config.mjs index 130ea74..42d1a9b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -15,6 +15,7 @@ export default defineConfig( 'esbuild-watch.mjs', 'eslint.config.mjs', 'ucsc/*', + '.test*', '.test-jbrowse/*', ], }, diff --git a/package.json b/package.json index ecae472..2dc82ac 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build": "tsc && NODE_ENV=production node esbuild.mjs && cp distconfig.json dist/config.json", "prebuild": "yarn clean", "lint": "eslint --report-unused-disable-directives --max-warnings 0", - "pretest": "test -d .test-jbrowse || npx @jbrowse/cli create .test-jbrowse --nightly", + "pretest": "rm -rf .test-jbrowse && npx @jbrowse/cli create .test-jbrowse --nightly", "test": "vitest run", "test:watch": "vitest", "test:setup": "node scripts/test-versions.mjs setup", @@ -31,8 +31,9 @@ "dependencies": { "@emotion/styled": "^11.14.1", "g2p_mapper": "^2.0.0", - "pako": "^2.1.0", - "react-msaview": "^5.0.3", + "idb": "^8.0.3", + "pako-esm2": "^2.0.0", + "react-msaview": "^5.0.5", "swr": "^2.3.8" }, "devDependencies": { @@ -58,7 +59,6 @@ "eslint-plugin-unicorn": "^62.0.0", "mobx": "^6.15.0", "mobx-react": "^9.2.1", - "msa-parsers": "^5.0.3", "prettier": "^3.7.4", "pretty-bytes": "^7.1.0", "puppeteer": "^24.34.0", diff --git a/src/AddHighlightModel/GenomeMouseoverHighlight.tsx b/src/AddHighlightModel/GenomeMouseoverHighlight.tsx index 5963897..ccac8df 100644 --- a/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +++ b/src/AddHighlightModel/GenomeMouseoverHighlight.tsx @@ -12,35 +12,51 @@ const GenomeMouseoverHighlight = observer(function ({ }: { model: LinearGenomeViewModel }) { - const { hovered } = getSession(model) - return hovered && - typeof hovered === 'object' && - 'hoverPosition' in hovered ? ( - - ) : null + const session = getSession(model) + const { hovered, views } = session + + // Early return if no MSA view exists + const hasMsaView = views.some(s => s.type === 'MsaView') + if (!hasMsaView) { + return null + } + + // Early return if no hover position + if ( + !hovered || + typeof hovered !== 'object' || + !('hoverPosition' in hovered) + ) { + return null + } + + return }) -const GenomeMouseoverHighlightPostNullCheck = observer(function ({ +const GenomeMouseoverHighlightRenderer = observer(function ({ model, + hovered, }: { model: LinearGenomeViewModel + + hovered: any }) { const { classes } = useStyles() - const session = getSession(model) - if (session.views.some(s => s.type === 'MsaView')) { - const { hovered } = session - const { offsetPx } = model - // @ts-expect-error - const { coord, refName } = hovered.hoverPosition - - const s = model.bpToPx({ refName, coord: coord - 1 }) - const e = model.bpToPx({ refName, coord: coord }) - if (s && e) { - const width = Math.max(Math.abs(e.offsetPx - s.offsetPx), 4) - const left = Math.min(s.offsetPx, e.offsetPx) - offsetPx - return