diff --git a/CHANGELOG.md b/CHANGELOG.md index d358908867..2236e7e78e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,55 @@ +yarn run v1.22.19 $ lerna-changelog --silent --next-version 2.8.0 + +## 2.8.0 (2023-11-09) + +#### :rocket: Enhancement + +- Other + - [#4045](https://github.com/GMOD/jbrowse-components/pull/4045) Create + multi-region arc display type for variant tracks + ([@cmdcolin](https://github.com/cmdcolin)) + - [#4050](https://github.com/GMOD/jbrowse-components/pull/4050) Allow + specifying alternative config.json path via global variable + ([@cmdcolin](https://github.com/cmdcolin)) + - [#4046](https://github.com/GMOD/jbrowse-components/pull/4046) Show last + autosave on jbrowse-web start screen + ([@cmdcolin](https://github.com/cmdcolin)) + - [#4044](https://github.com/GMOD/jbrowse-components/pull/4044) Speed up + "multi-region" navigation in search box + ([@cmdcolin](https://github.com/cmdcolin)) + - [#4032](https://github.com/GMOD/jbrowse-components/pull/4032) Add + `jbrowse sort-gff` subcommand ([@cmdcolin](https://github.com/cmdcolin)) +- `product-core` + - [#4040](https://github.com/GMOD/jbrowse-components/pull/4040) Strip baseUri + in 'About track' copy config ([@cmdcolin](https://github.com/cmdcolin)) +- `core` + - [#4035](https://github.com/GMOD/jbrowse-components/pull/4035) Prompt to + horizontally flip view when launching linear synteny view on inverted + feature ([@cmdcolin](https://github.com/cmdcolin)) +- `app-core` + - [#4024](https://github.com/GMOD/jbrowse-components/pull/4024) Add + right-handed arrow to view title to emphasize the focused view + ([@carolinebridge-oicr](https://github.com/carolinebridge-oicr)) + +#### :bug: Bug Fix + +- [#4052](https://github.com/GMOD/jbrowse-components/pull/4052) Fix browser back + button behavior in jbrowse-web ([@cmdcolin](https://github.com/cmdcolin)) +- [#4043](https://github.com/GMOD/jbrowse-components/pull/4043) Fix crash in + "Open session" widget for sessions that have 'track-less views' + ([@cmdcolin](https://github.com/cmdcolin)) + +#### :memo: Documentation + +- [#4027](https://github.com/GMOD/jbrowse-components/pull/4027) Add office hours + and community meetings ([@cmdcolin](https://github.com/cmdcolin)) + +#### Committers: 2 + +- Caroline Bridge + ([@carolinebridge-oicr](https://github.com/carolinebridge-oicr)) +- Colin Diesh ([@cmdcolin](https://github.com/cmdcolin)) Done in 2.23s. + yarn run v1.22.19 $ lerna-changelog --silent --next-version 2.7.2 ## 2.7.2 (2023-10-27) diff --git a/README.md b/README.md index e3402347dd..cef11bb108 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ new community meeting that anyone can join via a public Google Meet link. Details below: - [Schedule 1-on-1 appointment](https://calendar.app.google/E9i5fyZN4UcZawuNA) -- [Community call - Monthly on the third Thursday, 10am EST (North America, Europe friendly)](https://meet.google.com/rnq-exdt-tuz) -- [Community call - Monthly on the last Tuesday, 8pm EST (Asia Pacific friendly)](https://meet.google.com/uti-xsjf-xbu) +- [Community call - Monthly on the third Thursday, 10am EST (North America, Europe friendly)](https://meet.google.com/uti-xsjf-xbu) +- [Community call - Monthly on the last Tuesday, 8pm EST (Asia Pacific friendly)](https://meet.google.com/rnq-exdt-tuz) - [Add both events to your Google calendar](https://calendar.google.com/calendar/u/2?cid=ZDgxZmE0Yjk3YjdiZTAxYThjMDAzYzNkOThkMjUyOGQ1ZWM4YzNkMzRjNjgwMmQ3YjZhOWEwYmU4NDYxZDBiM0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t) ## Pre-requisites diff --git a/lerna.json b/lerna.json index 8dd93d0743..4c9d35d01c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.2", + "version": "2.8.0", "npmClient": "yarn", "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/notes/package.json.explainer.md b/notes/package.json.explainer.md deleted file mode 100644 index a21c7d43c3..0000000000 --- a/notes/package.json.explainer.md +++ /dev/null @@ -1,5 +0,0 @@ -## Reasons for packages in package.json - -### ts-loader - -Used by storybook in e.g. products/jbrowse-react-linear-genome-view diff --git a/package.json b/package.json index 41de60ee26..db841fa5ab 100644 --- a/package.json +++ b/package.json @@ -78,11 +78,10 @@ "@types/node-fetch": "^2.5.7", "@types/offscreencanvas": "^2019.6.4", "@types/pako": "^2.0.0", - "@types/pluralize": "^0.0.30", + "@types/pluralize": "^0.0.33", "@types/range-parser": "^1.2.3", "@types/rbush": "^3.0.0", "@types/react": "^18.0.26", - "@types/react-color": "^3.0.4", "@types/react-dom": "^18.0.0", "@types/react-virtualized-auto-sizer": "^1.0.0", "@types/set-value": "^4.0.1", @@ -106,7 +105,7 @@ "dependency-graph": "^0.11.0", "dotenv": "^16.3.1", "dotenv-expand": "^10.0.0", - "electron": "27.0.2", + "electron": "27.0.4", "electron-builder": "^24.8.0", "electron-mock-ipc": "^0.3.8", "eslint": "^8.0.0", @@ -116,7 +115,7 @@ "eslint-plugin-react-hooks": "^4.3.0", "eslint-plugin-react-refresh": "^0.4.3", "eslint-plugin-tsdoc": "^0.2.4", - "eslint-plugin-unicorn": "^48.0.0", + "eslint-plugin-unicorn": "^49.0.0", "express": "^4.18.2", "express-basic-auth": "^1.2.1", "file-loader": "^6.2.0", @@ -153,7 +152,6 @@ "storybook": "^7.0.0", "style-loader": "^3.3.1", "terser-webpack-plugin": "^5.2.5", - "ts-loader": "^9.5.0", "ts-node": "^10.4.0", "tslib": "^2.0.1", "tss-react": "^4.0.0", diff --git a/packages/app-core/package.json b/packages/app-core/package.json index 8748efef7a..15eed22640 100644 --- a/packages/app-core/package.json +++ b/packages/app-core/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/app-core", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 code shared between the 'full featured' apps e.g. jbrowse-web and jbrowse-desktop", "keywords": [ "jbrowse", @@ -42,7 +42,7 @@ }, "dependencies": { "@babel/runtime": "^7.16.3", - "@jbrowse/product-core": "^2.7.2", + "@jbrowse/product-core": "^2.8.0", "@mui/icons-material": "^5.0.0", "@mui/material": "^5.10.17", "clsx": "^2.0.0", diff --git a/packages/core/BaseFeatureWidget/BaseFeatureDetail/util.ts b/packages/core/BaseFeatureWidget/BaseFeatureDetail/util.ts index 650b26ed65..843b215679 100644 --- a/packages/core/BaseFeatureWidget/BaseFeatureDetail/util.ts +++ b/packages/core/BaseFeatureWidget/BaseFeatureDetail/util.ts @@ -39,6 +39,6 @@ export function accessNested(arr: string[], obj: Record = {}) { return typeof obj2 === 'string' ? obj2 : isObject(obj2) && typeof obj2?.Description === 'string' - ? obj2.Description - : undefined + ? obj2.Description + : undefined } diff --git a/packages/core/PluginLoader.ts b/packages/core/PluginLoader.ts index 6b90b0149e..7a9eb75b0a 100644 --- a/packages/core/PluginLoader.ts +++ b/packages/core/PluginLoader.ts @@ -194,8 +194,8 @@ export default class PluginLoader { 'url' in def ? new URL(def.url, baseUri) : 'umdUrl' in def - ? new URL(def.umdUrl, baseUri) - : new URL(def.umdLoc.uri, def.umdLoc.baseUri) + ? new URL(def.umdUrl, baseUri) + : new URL(def.umdLoc.uri, def.umdLoc.baseUri) if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') { throw new Error( diff --git a/packages/core/configuration/types.ts b/packages/core/configuration/types.ts index 03d2c37ba7..825bdb3e04 100644 --- a/packages/core/configuration/types.ts +++ b/packages/core/configuration/types.ts @@ -23,13 +23,13 @@ export type GetOptions = SCHEMA extends ConfigurationSchemaType< export type GetBase = SCHEMA extends undefined ? never : GetOptions extends ConfigurationSchemaOptions - ? undefined - : GetOptions extends ConfigurationSchemaOptions< - infer BASE extends AnyConfigurationSchemaType, - any - > - ? BASE - : never + ? undefined + : GetOptions extends ConfigurationSchemaOptions< + infer BASE extends AnyConfigurationSchemaType, + any + > + ? BASE + : never export type GetExplicitIdentifier = GetOptions extends ConfigurationSchemaOptions< @@ -48,13 +48,13 @@ export type ConfigurationSchemaForModel = MODEL extends IStateTreeNode< export type ConfigurationSlotName = SCHEMA extends undefined ? never : SCHEMA extends ConfigurationSchemaType - ? - | (keyof D & string) - | GetExplicitIdentifier - | (GetBase extends ConfigurationSchemaType - ? ConfigurationSlotName> - : never) - : never + ? + | (keyof D & string) + | GetExplicitIdentifier + | (GetBase extends ConfigurationSchemaType + ? ConfigurationSlotName> + : never) + : never export type AnyConfigurationSchemaType = ConfigurationSchemaType export type AnyConfigurationModel = Instance diff --git a/packages/core/package.json b/packages/core/package.json index d6753af2b8..a13e87c745 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/core", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 core libraries used by plugins", "keywords": [ "jbrowse", diff --git a/packages/core/ui/CascadingMenu.tsx b/packages/core/ui/CascadingMenu.tsx index 581e53dd93..13119aaefc 100644 --- a/packages/core/ui/CascadingMenu.tsx +++ b/packages/core/ui/CascadingMenu.tsx @@ -7,6 +7,7 @@ import { Menu, MenuItem, PopoverOrigin, + SvgIconProps, } from '@mui/material' import { MenuItem as JBMenuItem, MenuItemEndDecoration } from './Menu' import { @@ -49,6 +50,7 @@ function CascadingMenuItem({ function CascadingSubmenu({ title, + Icon, inset, popupId, ...props @@ -56,8 +58,10 @@ function CascadingSubmenu({ children: React.ReactNode title: string onMenuItemClick: Function - menuItems: JBMenuItem[] + Icon: React.ComponentType | undefined + inset: boolean + menuItems: JBMenuItem[] popupId: string }) { const { parentPopupState } = React.useContext(CascadingContext) @@ -69,6 +73,11 @@ function CascadingSubmenu({ return ( <> + {Icon ? ( + + + + ) : null} @@ -167,9 +176,7 @@ function CascadingMenuList({ } } - const hasIcon = menuItems.some( - menuItem => 'icon' in menuItem && menuItem.icon, - ) + const hasIcon = menuItems.some(m => 'icon' in m && m.icon) return ( <> {menuItems.map((item, idx) => { @@ -178,7 +185,8 @@ function CascadingMenuList({ key={`subMenu-${item.label}-${idx}`} popupId={`subMenu-${item.label}`} title={item.label} - inset={hasIcon} + Icon={item.icon} + inset={hasIcon && !item.icon} onMenuItemClick={onMenuItemClick} menuItems={item.subMenu} > diff --git a/packages/core/ui/react-colorful.js b/packages/core/ui/react-colorful.js index 7d6c2e6847..f3c799242e 100644 --- a/packages/core/ui/react-colorful.js +++ b/packages/core/ui/react-colorful.js @@ -247,8 +247,8 @@ const i = (e, r = 0, t = 1) => (e > t ? t : e < r ? r : e), ? a === e ? (r - t) / l : a === r - ? 2 + (t - e) / l - : 4 + (e - r) / l + ? 2 + (t - e) / l + : 4 + (e - r) / l : 0 return { h: b(60 * (n < 0 ? n + 6 : n)), diff --git a/packages/core/util/simpleFeature.ts b/packages/core/util/simpleFeature.ts index 0cc78d0de5..2e414595b9 100644 --- a/packages/core/util/simpleFeature.ts +++ b/packages/core/util/simpleFeature.ts @@ -156,8 +156,8 @@ export default class SimpleFeature implements Feature { return name === 'subfeatures' ? this.subfeatures : name === 'parent' - ? this.parent() - : this.data[name] + ? this.parent() + : this.data[name] } /** diff --git a/packages/embedded-core/package.json b/packages/embedded-core/package.json index 4b0c2746e5..d396634ecf 100644 --- a/packages/embedded-core/package.json +++ b/packages/embedded-core/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/embedded-core", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 code shared between embedded products", "keywords": [ "jbrowse", @@ -42,7 +42,7 @@ }, "dependencies": { "@babel/runtime": "^7.16.3", - "@jbrowse/product-core": "^2.7.2", + "@jbrowse/product-core": "^2.8.0", "@mui/icons-material": "^5.0.0", "@mui/material": "^5.10.17", "copy-to-clipboard": "^3.3.1", diff --git a/packages/product-core/package.json b/packages/product-core/package.json index 72f69dc6c8..c72e09aca8 100644 --- a/packages/product-core/package.json +++ b/packages/product-core/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/product-core", - "version": "2.7.2", + "version": "2.8.0", "sideEffects": false, "description": "JBrowse 2 code shared between products but not used by plugins", "keywords": [ @@ -43,7 +43,7 @@ }, "dependencies": { "@babel/runtime": "^7.16.3", - "@jbrowse/core": "^2.7.2", + "@jbrowse/core": "^2.8.0", "@mui/icons-material": "^5.0.0", "@mui/material": "^5.10.17", "copy-to-clipboard": "^3.3.1", diff --git a/packages/text-indexing/package.json b/packages/text-indexing/package.json index 1aaead3b81..a5fa3c0a70 100644 --- a/packages/text-indexing/package.json +++ b/packages/text-indexing/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/text-indexing", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 text indexing for desktop", "keywords": [ "jbrowse", diff --git a/packages/web-core/package.json b/packages/web-core/package.json index 36b2254b0f..1f28c56904 100644 --- a/packages/web-core/package.json +++ b/packages/web-core/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/web-core", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 code shared between web-app type products", "keywords": [ "jbrowse", @@ -42,8 +42,8 @@ }, "dependencies": { "@babel/runtime": "^7.16.3", - "@jbrowse/app-core": "^2.7.2", - "@jbrowse/product-core": "^2.7.2", + "@jbrowse/app-core": "^2.8.0", + "@jbrowse/product-core": "^2.8.0", "@mui/icons-material": "^5.0.0", "@mui/material": "^5.10.17", "clone": "^2.0.0", diff --git a/plugins/alignments/package.json b/plugins/alignments/package.json index 795c00c88f..1563c850af 100644 --- a/plugins/alignments/package.json +++ b/plugins/alignments/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/plugin-alignments", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 alignments adapters, tracks, etc.", "keywords": [ "jbrowse", diff --git a/plugins/arc/package.json b/plugins/arc/package.json index ebd6073d62..6a63376caf 100644 --- a/plugins/arc/package.json +++ b/plugins/arc/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/plugin-arc", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 arc adapters, tracks, etc.", "keywords": [ "jbrowse", diff --git a/plugins/arc/src/LinearPairedArcDisplay/components/Arcs.tsx b/plugins/arc/src/LinearPairedArcDisplay/components/Arcs.tsx index 98bdbdd3c3..5c36a1f876 100644 --- a/plugins/arc/src/LinearPairedArcDisplay/components/Arcs.tsx +++ b/plugins/arc/src/LinearPairedArcDisplay/components/Arcs.tsx @@ -3,6 +3,7 @@ import { observer } from 'mobx-react' import { AbstractSessionModel, Feature, + assembleLocString, getContainingView, getSession, measureText, @@ -36,10 +37,10 @@ function f(feature: Feature, alt?: string) { if (symbolicAlleles.some(a => alt?.startsWith(a))) { // END is defined to be a single value, not an array. CHR2 not defined in // VCF spec, but should be similar - const e = feature.get('INFO')?.END || feature.get('end') + const e = feature.get('INFO')?.END?.[0] || feature.get('end') mateEnd = e mateStart = e - 1 - mateRefName = feature.get('INFO')?.CHR2 ?? refName + mateRefName = feature.get('INFO')?.CHR2?.[0] ?? refName // re-adjust the arc to be from start to end of feature by re-assigning end // to the 'mate' start = feature.get('start') @@ -58,9 +59,12 @@ function f(feature: Feature, alt?: string) { } function makeSummary(feature: Feature, alt?: string) { + const { k1, k2 } = f(feature, alt) return [ feature.get('name'), feature.get('id'), + assembleLocString(k1), + assembleLocString(k2), feature.get('INFO')?.SVTYPE, alt, ] @@ -68,6 +72,39 @@ function makeSummary(feature: Feature, alt?: string) { .join(' - ') } +// conditionally rendered tooltip only on mouseover, speeds up +const SvgTooltip = React.forwardRef< + SVGPathElement, + { feature: Feature; alt?: string } +>(function SvgTooltip2({ feature, alt }, ref) { + const caption = makeSummary(feature, alt) + const tooltipWidth = 20 + measureText(caption) + return ref !== null ? ( + // @ts-expect-error + + + + {caption} + + + ) : null +}) + const Arc = observer(function ({ model, feature, @@ -93,8 +130,6 @@ const Arc = observer(function ({ const p2 = k2.start const r1 = view.bpToPx({ refName: ra1, coord: p1 })?.offsetPx const r2 = view.bpToPx({ refName: ra2, coord: p2 })?.offsetPx - const caption = makeSummary(feature, alt) - const tooltipWidth = 20 + measureText(caption) if (r1 !== undefined && r2 !== undefined) { const radius = (r2 - r1) / 2 @@ -105,12 +140,12 @@ const Arc = observer(function ({ const left = p1 const right = p2 - return ( + return absrad > 1 ? ( <> setMouseOvered(false)} onMouseOver={() => setMouseOvered(true)} @@ -118,29 +153,11 @@ const Arc = observer(function ({ fill="none" pointerEvents="stroke" /> - - - - {caption} - - + {mouseOvered ? ( + + ) : null} - ) + ) : null } return null }) @@ -196,6 +213,7 @@ const Arcs = observer(function ({ /> )) ?? ( { - const name = 'LinearPairedArcDisplay' - const configSchema = configSchemaFactory(name) + const configSchema = configSchemaFactory() return new DisplayType({ - name, + name: 'LinearPairedArcDisplay', displayName: 'Arc display', configSchema, - stateModel: stateModelFactory(configSchema, name), + stateModel: stateModelFactory(configSchema), trackType: 'VariantTrack', viewType: 'LinearGenomeView', ReactComponent: lazy(() => import('./components/ReactComponent')), diff --git a/plugins/arc/src/LinearPairedArcDisplay/model.ts b/plugins/arc/src/LinearPairedArcDisplay/model.ts index 5cb12237cc..b98b2f352b 100644 --- a/plugins/arc/src/LinearPairedArcDisplay/model.ts +++ b/plugins/arc/src/LinearPairedArcDisplay/model.ts @@ -20,16 +20,13 @@ import { } from '@jbrowse/plugin-linear-genome-view' /** - * #stateModel LinearArcDisplay - * extends BaseDisplay + * #stateModel LinearPairedArcDisplay + * extends BaseDisplay, TrackHeightMixin, FeatureDensityMixin */ -export function stateModelFactory( - configSchema: AnyConfigurationSchemaType, - name: string, -) { +export function stateModelFactory(configSchema: AnyConfigurationSchemaType) { return types .compose( - name, + 'LinearPairedArcDisplay', BaseDisplay, TrackHeightMixin(), FeatureDensityMixin(), @@ -37,7 +34,7 @@ export function stateModelFactory( /** * #property */ - type: types.literal(name), + type: types.literal('LinearPairedArcDisplay'), /** * #property */ @@ -120,6 +117,9 @@ export function stateModelFactory( } })() }, + /** + * #action + */ async renderSvg(opts: { rasterizeLayers?: boolean }): Promise { diff --git a/plugins/arc/src/index.ts b/plugins/arc/src/index.ts index 5fb0ec58fe..c64b0651f3 100644 --- a/plugins/arc/src/index.ts +++ b/plugins/arc/src/index.ts @@ -4,6 +4,7 @@ import LinearArcDisplayF from './LinearArcDisplay' import LinearPairedArcDisplayF from './LinearPairedArcDisplay' import ArcRendererF from './ArcRenderer' import { Feature } from '@jbrowse/core/util' +import { set1 } from '@jbrowse/core/ui/colors' export default class ArcPlugin extends Plugin { name = 'ArcRenderer' @@ -20,16 +21,18 @@ export default class ArcPlugin extends Plugin { pluginManager.jexl.addFunction( 'defaultPairedArcColor', (_feature: Feature, alt: string) => { - if (alt.startsWith(' [n, extra[idx]])) + ? Object.fromEntries(names.slice(10).map((n, idx) => [n, extra[idx]])) : extra + let ALT + if (['DUP', 'TRA', 'INV', 'CNV', 'DEL'].includes(extra[0])) { + ALT = `<${extra[0]}>` + } return new SimpleFeature({ start: start1, end: end1, refName: ref1, + ...(ALT ? { ALT: [ALT] } : {}), // it's an array in VCF strand: strand1, name, ...rest, @@ -104,9 +109,7 @@ export default class BedpeAdapter extends BaseFeatureDataAdapter { if (!feats2[r2]) { feats2[r2] = [] } - feats1[r1]!.push(line) - feats2[r2]!.push(line) } const columnNames = this.getConf('columnNames') diff --git a/plugins/bed/src/index.ts b/plugins/bed/src/index.ts index bf3c027293..8011927df0 100644 --- a/plugins/bed/src/index.ts +++ b/plugins/bed/src/index.ts @@ -55,7 +55,7 @@ export default class BedPlugin extends Plugin { index?: FileLocation, adapterHint?: string, ) => { - const regexGuess = /\.bedpe\.gz$/i + const regexGuess = /\.bedpe(\.gz)?$/i const adapterName = 'BedpeAdapter' const fileName = getFileName(file) if (regexGuess.test(fileName) || adapterHint === adapterName) { @@ -120,14 +120,10 @@ export default class BedPlugin extends Plugin { pluginManager.addToExtensionPoint( 'Core-guessTrackTypeForLocation', - (trackTypeGuesser: TrackTypeGuesser) => { - return (adapterName: string) => { - if (adapterName === 'BedpeAdapter') { - return 'VariantTrack' - } - return trackTypeGuesser(adapterName) - } - }, + (trackTypeGuesser: TrackTypeGuesser) => (adapterName: string) => + adapterName === 'BedpeAdapter' + ? 'VariantTrack' + : trackTypeGuesser(adapterName), ) } } diff --git a/plugins/breakpoint-split-view/package.json b/plugins/breakpoint-split-view/package.json index 6b2f36d5d8..80e4afa0ff 100644 --- a/plugins/breakpoint-split-view/package.json +++ b/plugins/breakpoint-split-view/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/plugin-breakpoint-split-view", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 breakpoint detail split view", "keywords": [ "jbrowse", diff --git a/plugins/circular-view/package.json b/plugins/circular-view/package.json index 131dea9c5e..027a31e119 100644 --- a/plugins/circular-view/package.json +++ b/plugins/circular-view/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/plugin-circular-view", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 circular view", "keywords": [ "jbrowse", diff --git a/plugins/comparative-adapters/package.json b/plugins/comparative-adapters/package.json index 63585340ed..ec5dd8b1ac 100644 --- a/plugins/comparative-adapters/package.json +++ b/plugins/comparative-adapters/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/plugin-comparative-adapters", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 comparative adapters", "keywords": [ "jbrowse", diff --git a/plugins/config/package.json b/plugins/config/package.json index 45774d2cd8..56b4a0a8a2 100644 --- a/plugins/config/package.json +++ b/plugins/config/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/plugin-config", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 config utilities", "keywords": [ "jbrowse", diff --git a/plugins/data-management/package.json b/plugins/data-management/package.json index e01c435628..6c0f3c442f 100644 --- a/plugins/data-management/package.json +++ b/plugins/data-management/package.json @@ -1,6 +1,6 @@ { "name": "@jbrowse/plugin-data-management", - "version": "2.7.2", + "version": "2.8.0", "description": "JBrowse 2 linear genome view", "keywords": [ "jbrowse", diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/ShoppingCart.tsx b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/ShoppingCart.tsx index 4b420c3271..2878795b98 100644 --- a/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/ShoppingCart.tsx +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/ShoppingCart.tsx @@ -1,8 +1,7 @@ -import React, { useState } from 'react' -import { Badge, IconButton } from '@mui/material' -import { makeStyles } from 'tss-react/mui' +import React from 'react' +import { Badge } from '@mui/material' import { observer } from 'mobx-react' -import JBrowseMenu, { MenuItem } from '@jbrowse/core/ui/Menu' +import { MenuItem } from '@jbrowse/core/ui/Menu' import { getSession, getEnv } from '@jbrowse/core/util' // icons @@ -10,66 +9,37 @@ import ShoppingCartIcon from '@mui/icons-material/ShoppingCart' // locals import { HierarchicalTrackSelectorModel } from '../model' - -const useStyles = makeStyles()(theme => ({ - searchBox: { - margin: theme.spacing(2), - }, - menuIcon: { - marginRight: theme.spacing(1), - marginBottom: 0, - }, -})) +import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton' const ShoppingCart = observer(function ({ model, }: { model: HierarchicalTrackSelectorModel }) { - const { classes } = useStyles() const { selection } = model const { pluginManager } = getEnv(model) const session = getSession(model) - const [selectionEl, setSelectionEl] = useState() const items = pluginManager.evaluateExtensionPoint( 'TrackSelector-multiTrackMenuItems', [], { session }, ) as MenuItem[] - return ( - <> - {selection.length ? ( - setSelectionEl(event.currentTarget)} - > - - - - - ) : null} - - { - callback() - setSelectionEl(undefined) - }} - onClose={() => setSelectionEl(undefined)} - menuItems={[ - { label: 'Clear', onClick: () => model.clearSelection() }, - ...items.map(item => ({ - ...item, - ...('onClick' in item - ? { onClick: () => item.onClick(model) } - : {}), - })), - ]} - /> - - ) + return selection.length ? ( + model.clearSelection() }, + ...items.map(item => ({ + ...item, + ...('onClick' in item ? { onClick: () => item.onClick(model) } : {}), + })), + ]} + > + + + + + ) : null }) export default ShoppingCart diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap index 362224cd0e..98f237b597 100644 --- a/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap @@ -91,11 +91,119 @@ exports[`renders nothing with no assembly 1`] = ` style="position: relative; height: 9000px; overflow: auto; will-change: transform; direction: ltr;" >
+
+
+
+

+ + ✨Favorites + +

+
+
+
+
+
+
+
+
+

+ + 🕒 Recently used + +

+
+
+
+
+
+
+
+
+

+ + ✨Favorites + +

+
+
+
+
+
+
+
+
+

+ + 🕒 Recently used + +

+
+
+
+
+
Reference sequence (volMyt1)
Track
Track
+

+
+
+
+
+
+
+
+
+

+ + 🕒 Recently used + +

+
+
+
+
+
Reference sequence (volMyt1)
Track
Track