oncodsl / Read docs /PROMPT_polish_tooltips_graph.md
govindbalki's picture
Upload folder using huggingface_hub
0fff343 verified
|
Raw
History Blame Contribute Delete
5.5 kB

Prompt β€” Lab polish: plain-English "?" copy, no all-caps, fix the clipped program graph

Three presentation-only fixes to the Lab (web/). No engine, API, DSL, or airgap changes. Read the named files first; don't assume. After each part, build (tsc/next build) and confirm clean.

1. Audit EVERY "?" so it's clear to a layperson and correct per objective (including HPV)

The reader is not a cancer expert or an ML expert. Every tooltip and every click-to-open modal must explain its concept in plain English, define any term it uses, and read correctly for whichever objective/dataset is active.

Where the copy lives (read all of these):

  • web/app/Lab.tsx β€” the TIPS record (short InfoTip strings), FITNESS_TIP_BY_TARGET, FITNESS_LABEL_BY_TARGET, and every inline tip= / <InfoTip> usage (objective cards, parameters, run/live/result/evaluator labels, discovered-axes, rank panels).
  • web/app/paramHelpContent.tsx β€” PARAM_TIPS (short + detailed), the objective modals obj_msi, obj_tmb, obj_unsupervised, obj_hpv, and the shared ObjectiveIntro / ObjectiveFooter / breakdown components.

Requirements:

  • Plain language. No undefined jargon. If a term is unavoidable (AUROC, permutation, held-out, silhouette, residualise), give a one-line plain gloss in the same tip β€” e.g. "held-out = patients the engine never saw during the search, used to check the result isn't a fluke."
  • Objective- and dataset-aware. Any tip shown during an HPV run must talk about HPV+/HPVβˆ’ separation, not MSI or TMB. Sweep for tips that hardcode MSI/TMB wording and make them branch on the active objective (the per-target records already exist for the fitness curve β€” extend the same pattern wherever a result/verdict/axis/chart tip is objective-specific). Confirm each of the four objectives (MSI, TMB, Unsupervised, HPV) shows tips that match what that run actually produces.
  • HPV specifically. The HPV "?" should make clear, in plain words: the engine is detecting a known viral signature (high CDKN2A/p16 and the cell-cycle program the virus switches on), not discovering new causation β€” the cause is the virus itself. Keep obj_hpv consistent with that.
  • Keep tone and length consistent with the existing good tips; don't bloat.

2. Never write in all caps (anywhere in the Lab UI)

All-caps text is currently produced two ways β€” fix both:

  • Tailwind uppercase classes. In web/app/Lab.tsx there are many label/eyebrow elements using uppercase tracking-wide (e.g. lines ~1757, 1799, 1850, 2110, 2119, 2248, 2290, 2298, 2342, 2386, 2394, 2436 β€” and any others). Remove the uppercase utility from every one so labels render in their natural case. Keep tracking-wide/sizing if you like, just drop the uppercasing. Then make sure the underlying strings read well in sentence case (e.g. "Held-out", "Permutation p", "Revealed genes", "Winning program", "Post-hoc alignment", "Opaque ID", "Symbol", "Discovered axes", "Paste a program", "Nodes", "Genes").
  • textTransform: "uppercase" in web/app/ProgramGraph.tsx (~line 196, the Tier label). Remove it; the labels are already literal strings "Tier-1" / "Tier-2 program" β€” render them as-is (Title case), not uppercased.
  • Grep the whole web/app tree for any remaining uppercase class, textTransform, or literal ALL-CAPS string constants in UI copy and convert them to sentence/Title case. No visible UI text should be all-caps after this.

3. Fix the program graph being clipped

Symptom (see screenshot): for a two-tier (Combine) program the dashed "Tier-2 program" wrapper and the lower "Tier-1" group are cut off β€” the graph overflows on the right and the bottom is sliced by the "Paste a program" section.

In web/app/ProgramGraph.tsx (the ProgramGraph component, ~lines 725-760) and ProgramGraph.css:

  • The container height is Math.max(220, height) where height is the laid-out bounding box. Confirm that height for the Combine/Tier-2 case includes the full Tier-2 wrapper (label padding + both Tier-1 lanes + the Combine/Output column). If the wrapper's bbox isn't fully accounted for, the container is too short and clips the bottom.
  • fitView only fits on first mount; when the selected program changes (winner ↔ candidate, or a paste) it doesn't re-fit, so a larger graph overflows instead of scaling down. Make fitView re-run whenever the program changes β€” e.g. give <ReactFlow> a key derived from the program (so it remounts), or call fitView() from an onInit/effect keyed on props.
  • The minZoom={0.4} floor stops fitView from shrinking a large 2-tier graph enough to fit, so it clips. Lower the floor (e.g. minZoom={0.2}) so the whole graph always scales to fit the card width.
  • Ensure the card/section wrapping the graph has no fixed height or overflow: hidden that crops it, and that there's vertical separation from the "Paste a program" block below.

Result: the entire program (both tiers, all Select/Reduce/Combine/Split nodes) is always fully visible inside the card, scaled to fit, for single-tier and two-tier programs alike.

Checkpoint

  • Every "?" reads in plain English and is correct for each of the four objectives; an HPV run shows HPV-framed tips (no MSI/TMB leftovers).
  • No all-caps text anywhere in the Lab.
  • A two-tier program renders fully inside the Program graph card with nothing clipped; switching candidates re-fits.
  • tsc clean; colorectal/HPV runs and airgap tests unaffected.