Open
Conversation
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.
Purpose
src/config.tswith a declarative, YAML/JSON-authored config surface so embedders can customize categories, tracks, sources, filters, and tooltips without forking.Approach
src/schema/: JSON Schema,js-yaml-backed parser, two-pass validator (Ajv + semantic), normalizer (shorthand expansion, inheritance cascade, duplicate-id detection),extendsmerger (with URL/file fetcher, 2 MiB cap, cycle detection), registry (adapters / kinds / transforms / themes), Vega-Lite-parity transform engine.src/config.tsdeleted →src/default-config.yaml(drives the same 15 UniProt categories).<protvista-uniprot>now consumesNormalizedConfigdirectly viaresolveViewerConfig()(precedence:viewerConfigproperty >config-srcattribute > bundled default).fields/markdown/customresolver backed by Markdoc; helpers frozen; URLs routed through a scheme allowlist; all interpolations HTML-escaped.@floating-ui/domwithrole="tooltip", keyboard Escape, scroll-dismiss, focus capture/restore.setTrackData(categoryId, trackId, data)forfrom: customtracks (spec AC #1143).AbortControllercancels in-flight_loadData()on re-entry and disconnect.CSS.escapeto prevent cross-talk when two viewers co-exist.Testing
tsc --noEmitandeslint src --ext .tsboth clean.validate,normalize,extends(incl. cycle, size-cap, and parse-error-context regression),transforms(incl. Vega-LiteFieldPredicateparity suite),registry,types,schema,load.helpers(incl. XSS regression suite forjavascript:/data:URLs, quote-break,<img onerror>),resolve,popover,defaults,links.render-target,set-track-data,set-track-data-integration(mounts<protvista-uniprot>and drivessetTrackDataend-to-end),load-data-resolver,filter-config.Visual changes
@floating-ui/dom(arrow, flip/shift middleware) instead of the legacy positioning. Content is unchanged by default for every built-in kind. No other UI changes.Checklist