Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Full transparency the below description is mostly ai generated from git diff, but was tweaked and added to.
v3.0.0 — GraphQL URL prop, Table toolbar API, MSW Storybook mocking
This release introduces breaking changes to both
GenomeSearchandTableto clean uplong-standing API inconsistencies and add a required
graphqlUrlprop so consumers can routeautocomplete fetches through their own API handler (allowing server-injected auth headers).
MSW is added for Storybook so all GenomeSearch stories work without a live network connection.
Breaking changes
GenomeSearch— new requiredgraphqlUrlpropThe component previously hardcoded
https://screen.api.wenglab.org/graphql. That URL nowmust be supplied by the consumer. The intent is for apps to point this at a local route
handler (e.g.
/api/graphql) that attaches any required authentication headers server-sidebefore proxying to the upstream API.
<GenomeSearch assembly="GRCh38" queries={["Gene", "SNP", "cCRE"]} + graphqlUrl="/api/graphql" onSearchSubmit={handleResult} />GenomeSearch— per-type limit props replaced by a singlelimitpropThe six separate limit props are removed in favor of one unified
limitprop that acceptseither a flat number (applied to every type) or a per-type object.
GenomeSearch—slotsnow accepts component types, not elementsPreviously
slots.input/slots.button/slots.boxaccepted pre-rendered JSX elements(
React.ReactElement). They now accept component types (React.ElementType) — the samepattern MUI uses throughout. Props for the slot components go in
slotProps.Table— toolbar customisation props moved intoslotProps.toolbarThe following top-level props are removed. All toolbar customisation now flows through
slotProps.toolbar, which is fully typed via aToolbarPropsOverridesmodule augmentation.toolbarSlotslotProps.toolbar.extralabelTooltipslotProps.toolbar.labelTooltiptoolbarStyleslotProps.toolbar.styletoolbarIconColorslotProps.toolbar.iconColordownloadFileNamelabelis used as the export filename automatically<Table label="My Table" - toolbarSlot={<Button onClick={handleClick}>Action</Button>} - labelTooltip="Helpful description" - toolbarStyle={{ backgroundColor: "#e7eef8" }} - toolbarIconColor="#444" - downloadFileName="export" + slotProps={{ + toolbar: { + extra: <Button onClick={handleClick}>Action</Button>, + labelTooltip: "Helpful description", + style: { backgroundColor: "#e7eef8" }, + iconColor: "#444", + // downloadFileName is no longer needed — string label is used automatically + }, + }} />Other changes
MSW added for Storybook
mswandmsw-storybook-addonare added as dev dependencies. All GenomeSearch stories nowrun against mock handlers defined in
.storybook/mocks/genomeSearchHandlers.ts— no livenetwork access required. A new
Loadingstory demonstrates the loading state by interceptingrequests and delaying them indefinitely.
Result sorting improved in
GenomeSearchRelevance-based sorting of autocomplete results was previously done by inspecting rendered
<li>DOM props insiderenderGroup— fragile and desynchronised from MUI'sdata-option-index-based keyboard navigation. Sorting now happens upstream on the databefore it is passed to Autocomplete, keeping the options array and visual order in sync. fix #100
accessionargument used instead ofaccession_prefixwhen input matches accession lengthUsing
accessionis way faster for copy/pasted full accessions. Fix #89idprefixused to allow searching for Gene ID "ENSG..."Fix #99
useEntityAutocompletedependency array fixedcolumnsWithCheckboxwas missing from theuseMemodependency array inuseSyncedTable,which could cause stale column references after updates.
Gene description fetch is now fault-tolerant
The NLM gene description fetch is wrapped in a
try/catch. A network error no longerpropagates and breaks the autocomplete — it silently returns
nullinstead.