Molkit 0.2.3
Released April 6, 2026
New Features
- Frame-anchored pivot mode for animations: "Pivot: Frame" option in the Center dropdown locks the coordinate system to state box frame geometry instead of atom centroids
- Reference frame normalization: all states use the first state's frame dimensions so different-sized frames still produce consistent pivots
- Instructional/tutorial animations now work correctly with states that have different numbers of atoms or no atoms at all
Improvements
- Alignment tools now anchor to the last-selected object (others move to match it instead of using average/extrema targets)
- Text annotation hit detection tightened from 8px to 3px minimum padding (prevents selecting annotations by clicking well outside their bounds)
- Animation preview allows annotation-only states without showing "No atoms found" error
- Double-click on a state box header outside animation mode now correctly enters animation mode (hit area was above the frame, fixed to match the visible header)
- Animation preview starts from the selected state and plays forward (instead of always starting from state 1)
- Frame-relative paste: copy objects from one state box, paste into another at the same relative position (like PowerPoint paste-in-place across slides)
- Pasted objects set sourceObjectId for animation matcher pairing (zero displacement = pinned in animation)
- Same-state paste staggers 15px to prevent invisible overlap; cross-state first paste is exact, repeated paste staggers
- Arrow endpoint alignment guides appear when dragging arrow endpoints or adjusting gap sliders, showing horizontal/vertical alignment with other arrows
- DevMenu "Sync Appear" toggle: arrows and lines fade in with text annotations instead of wiping in after (for instructional animations)
Bug Fixes
- Arrow animation endpoints now resolve atoms and bonds from the correct animation state instead of the current canvas state (D9 state context fix)
- _withBondContext extended to also patch Store.findBond for correct bond lookup during animation rendering
- State strip thumbnails no longer show content from other tabs or appear mis-centered after tab switch
- State strip thumb cache cleared and rebuilt after synchronous render on tab switch to prevent stale DOM clones
- Right-aligned and center-aligned textboxes no longer shift position when editing text (width growth now pins the alignment-appropriate edge)
- Bond tool in animation mode now prefers atoms and bonds from the active state (prevents cross-state bond creation when atoms from different states overlap)
- Bond auto-assignment requires both atoms to be in the active state (AND instead of OR), preventing cross-state bond pollution
- State duplication skips bonds that reference atoms outside the source state (eliminates invisible-molecule bug after duplicate)
- Orphan carbon cleanup no longer deletes atoms referenced by any animation state
- Shift+click multi-select no longer stops working after 3-4 objects (caused by oversized hit areas on nearby annotations)
- Top menu bar dropdowns no longer render behind the animation toolbar (stacking context z-index fix)
- Text annotations expand downward when content grows (top edge pinned, not center-based expansion)
- Textbox editor uses fresh Store values for position computation instead of stale closure references
- Preview playback speed options extended to 8x, 16x, and 32x
- Text editor overlay now aligns precisely with rendered text using bbox measurement (was offset from actual text position)
- Textbox width no longer auto-grows when re-editing a textbox with a user-set width (text wraps within the set width instead)
- Internal clipboard paste now takes priority over system clipboard (fixes LaTeX and SVG annotations being intercepted by browser paste)
- Manual match wiring now removes atoms from excluded lists (wiring overrides prior exclusion)
- Matched pair badges always render on top of stale excluded/unmatched badges (purple beats gray)
- Bond gradient colors now render correctly in non-path SVG exports (CSS .mk-bond class no longer overrides gradient url() strokes)
- Gradient URL quoting fixed in all SVG serialization paths (post-serialization " stripping)
- Atom label tspan elements no longer appear bold in exports (explicit stroke:none on element color CSS classes)
- syncAnnotations (Sync Appear) toggle now works in SMIL/SVG export, not just preview
- Periodic table now includes all 118 elements (Period 7 main group and actinide series added)
- Default atom label font-weight changed from 500 (medium) to normal (400) for consistent export rendering
- Text tool now always creates a new text annotation on click (no longer selects shapes underneath)
- Bond length input max raised from 200 to 9999 (supports manually drawn long bonds)
- Shift+drag with bond tool snaps to angle grid with free length (matches atom drag behavior)
- Ctrl+Shift+drag with bond tool is now free draw with no constraints (was previously Shift alone)
- Radical dot alignment guides show when dragging atom labels (horizontal/vertical alignment with other atoms' radical dots)
- Flyout toolbar buttons remember last-used sub-tool (clicking the visible icon activates it directly instead of opening the menu)
- Radical radial offset slider range extended from [-3, 3] to [-4, 4]
New Features (continued)
- Mirror Curve: right-click with 2 arrows selected to copy the curve shape from one to the other, mirrored across the chord axis (works with anchored arrows, all curve types)
Improvements (continued)
- Auto-save uses progressive pruning (full data, reduced history, zero history, active-tab-only) instead of immediate emergency fallback that lost inactive tabs
- Emergency mode flag suppresses repeated console warnings (logs once on enter/exit)
- Inactive tabs preserved as metadata (id, filename, settings) even when storage is tight
Bug Fixes (continued)
- Clicking an existing atom with C selected now shows "C" label instead of making the atom disappear (was setting visible:false for carbon)
- Same-element bonds (F-F, O=O) now use element classes (mk-F, mk-O) in SVG export instead of custom color classes, enabling mk-theme.css color overrides
- Stepper backward from state 1 now correctly shows the last state (was hitting SMIL duration boundary causing visual wrap to state 1)
Accessibility
- WCAG AA element color compliance for ChemAcademy light mode: O #cc0000, S #747400, P/Fe/Cu/B/Au #b45800, F/Cl/Mg #008000, Ca/Zn/Be/Al/Si/Ag #767676 (all 4.5:1+ on white)
- SVG export CSS uses zero-specificity :where() scoping so external stylesheets can override embedded element colors, bond colors, and structural rules
- Charge circle fill stays transparent when element color class is present (CSS specificity fix)