Molkit 0.10.0
Released May 14, 2026
New Features
- Canvas overlay grid (Dots, Square, or Hex pointy-top): toolbar icon, View menu, or Ctrl+' to toggle; customizable spacing, color, opacity, and major lines; hex orientation matches the 60° chemistry bond convention so benzene rings drawn with default angle-snap land on hex centers
- Grid Settings dialog (Ctrl+Shift+', right-click toolbar icon, or long-press on touch): live preview, ColorPicker with "Use theme" reset, "Match bond length" checkbox that tracks the active preset and updates inline if the preset changes mid-dialog
- Grid-snap mode: opt-in "Snap to grid by default" checkbox; hold G during a drag to invert snap behavior for that drag; Alt always escapes all snap; centroid-anchored so the selection's geometric center lands on a grid intersection for single, multi, and mixed selections
- Grid renders across infinite / paged / slides modes, auto-hidden in presentation mode and during animation playback, and automatically excluded from SVG / PNG / PDF exports
- Grid-start-snap on empty-space clicks for bond, ring, arrow, shape, text, and LaTeX tools; existing-target hit-tests keep priority over grid placement
- Hover-type element relabel (ChemDraw-style): with Select tool active, hover any atom and type a 1- or 2-char element to change it; ambiguous letters commit after 500ms, Enter, Escape, or hover-leave
- R-group and placeholder labels via the same gesture: R, X, A, M, L, Q, Y, Z, D, T accepted as single-letter labels, optionally followed by digits to produce subscripted R-group numbering (R1, X2, etc.)
- Replace-on-conflict typing: if a new character cannot extend the current buffer to any valid symbol, the buffer resets to that character rather than appending (typing "BC" over a carbon commits "C")
- One undo entry per relabel gesture; live preview never enters the store, so undo lands on the original atom; same-symbol typing is a no-op
Improvements
- Major-lines controls in Grid Settings are disabled and grayed when type=hex (not applicable to hex grids), with an inline explanatory note; switching back to dots or square re-enables them
- Cross-tab grid pref sync via window storage event listener: toggling grid in one tab updates state in another without reload
- Edge-attached curved-spline arrowhead now rotates around the rendered tip with the tip itself staying anchored at the attachment contact, matching bond-attached behavior; the tip no longer orbits the contact as you rotate
- Length-match snap on the adjustment circle and the smart-guide cpPerp engage / break thresholds now scale with viewport zoom, so zoomed-in canvases no longer feel sticky at the same pixel threshold as zoomed-out ones
Bug Fixes
- Grid snap now works whether Smart Guides is enabled or disabled (initial integration placed the grid branch inside the smart-guides-enabled cascade, so disabling Smart Guides silently disabled grid snap)
- Atom-group drag now has its own grid-snap branch; the select-tool has two parallel snap pipelines and only the annotation drag was patched initially, so atom drags were falling through to smart-align
- Hex grid no longer renders with visible row gaps and dark zigzag artifacts; the corner hex was rendering only its bottom-right quadrant with no adjacent tile filling the rest, fixed by drawing the corner hex at all 4 tile corners + 1 center hex so each world hex collects 4 quadrants from 4 adjacent tiles
- Stale alignment overlay can no longer paint over grid-snap frames; the synchronous OverlayCanvas.clear() in the no-snap-guides else branch now also cancels any pending preview rAF and drops _pendingPreview
- HoverType module explicitly rejects G/g keys so the grid-snap modifier does not accidentally start an atom relabel gesture when the cursor is over an atom
- Export SVG with "Embed chemistry metadata" checked silently failed because enrichWithPubChem was not imported in export-svg-pdf.js (ReferenceError on click)
- Export SVG dialog now logs and continues on PubChem network failures so basic embedded metadata still ships with the download
- Right-click "Delete Point" near a waypoint and "Mirror Curve to/from This" with two arrows selected both threw ReferenceError (init.js was missing WAYPOINT_DELETE_THRESHOLD and mirrorArrowCurve imports)
- Arrow text-zone editor's chemistry-symbol auto-conversion on save (e.g. -> to right arrow) was silently disabled due to an out-of-scope EventHandlers reference
- Export SVG "Convert labels to paths" option threw on click; glyph font constants are now properly exported across the export-svg / export-svg-paths module boundary
- Arrowhead on edge-attached curved splines rotated two spoke steps per one user step; the stored direction was read before assignment so each click applied the rotation twice
- Typing a value directly into the bow slider's number field committed the wrong value (typing 35 produced 41); the inline-edit path bypassed the pointerdown init, leaving the base-handles snapshot null; same bug fixed on the arrow-compression slider
- Bow value rounding off-by-one round-trip (typing 30 committed as 31, typing 40 as 41); bowAmount is now stored as a float so the display percentage round-trips cleanly