Skip to content

fix(ui): render molecular formula numbers as subscripts#1461

Open
vcnainala wants to merge 1 commit into
mainfrom
fix/1432-molecular-formula-subscripts
Open

fix(ui): render molecular formula numbers as subscripts#1461
vcnainala wants to merge 1 commit into
mainfrom
fix/1432-molecular-formula-subscripts

Conversation

@vcnainala

Copy link
Copy Markdown
Member

Summary

  • Adds a shared MolecularFormula Vue component and parseMolecularFormulaDisplayParts utility to render molecular formula counts as subscripts (e.g. C9H8O4).
  • Updates all user-facing molecule views that display molecular formulas: sample/dataset/study sidebars (MolecularInfoPanel), molecule cards (MoleculeCard), and the public studies header (Public/Studies).

Closes #1432

Test plan

  • Open a public sample page with molecular info in the sidebar and confirm formula numbers render as subscripts
  • Open a molecule card listing (e.g. dashboard compounds) and confirm subscript formatting
  • Open a public studies page for a molecule and confirm the header molecular formula uses subscripts
  • Verify formulas that previously included HTML from CAS (e.g. CH<sub>2</sub>O) still render correctly after tag stripping

Add a shared MolecularFormula component and use it wherever molecular
formulas are shown so counts display in standard chemical notation.

Closes #1432
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.58%. Comparing base (632c381) to head (878bd44).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1461      +/-   ##
============================================
- Coverage     76.59%   76.58%   -0.01%     
  Complexity     3590     3590              
============================================
  Files           249      249              
  Lines         13510    13510              
============================================
- Hits          10348    10347       -1     
- Misses         3162     3163       +1     
Flag Coverage Δ
unittests 76.58% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MF should be subscript for numbers on sample page

1 participant