Molkit 0.4.0
Released April 8, 2026
New Features
- Preset/scheme separation: structural presets and color schemes are now independent axes that can be mixed freely
- Modification indicators: colored dot next to preset or scheme name in status bar when settings have been modified from the base
- Custom presets: save current structural settings as a named preset, load and manage from the preset dropup
- Custom color schemes: save current element colors as a named scheme from the scheme dropup
- Bond length slider in Structure Settings dialog with live canvas rescaling
- Per-object override scaling prompt on preset switch: proportional or exact, with "Remember my choice" option
- Export Element Colors CSS: generates a .css file with .mk-* element color classes and dark mode media query
- "Apply to All Tabs" action in both preset and scheme dropups with confirmation dialog
- New tabs inherit last-used preset and scheme from previous session
- Color Scheme Editor: full periodic table grid for editing element colors visually
- Color Scheme Editor Code View: table with editable hex inputs, filter/search, sort options, paste support, Copy All as TSV
- Dark mode color editing: explicit dark overrides per element with auto-derive fallback and "A" badge indicator
- WCAG AA contrast ratio checker with configurable background, per-cell warning badges, and header warning counter
- Grayscale preview checkbox for B&W print checking
- Scheme dropdown in the Color Scheme Editor for switching schemes without leaving the editor
- "Save as Scheme" button in the editor footer for saving edited colors as a named custom scheme
- CSS and JSON export/import from within the Color Scheme Editor
- 4 new built-in color schemes: CPK (Jmol), Colorblind Safe (Wong palette), WCAG AA, Publication (all black)
- Canvas right-click "Set Element Color..." opens editor focused on that element
- "Edit Element Colors" button in Settings > Atoms tab opens the Color Scheme Editor
- Resizable editor modal with drag handles on all edges and corners, periodic table cells scale with window size
Improvements
- Switching presets preserves the active color scheme (independent axes, no auto-switching)
- Switching color schemes preserves the active preset
- Re-clicking the active preset or scheme in the dropup resets modifications and clears the dot
- Preset and scheme switches are undoable with Ctrl+Z
- Structure Settings dialog changes are now undoable with debounced undo (one undo entry per editing burst)
- Mid-drag guard prevents preset/scheme switches during active tool operations
- CSS variable sync after preset application prevents stale element colors
- "Reset to Default" button removed from Settings dialog (redundant with dropup reset gesture)
- File migration auto-detects color scheme for .mkit files saved before separation
- Color Scheme Editor is draggable and resizable so users can see canvas updates live
- Editor closes on tab switch to prevent stale state
- Editor refreshes on undo/redo via Store subscriber
- Dismissible "colorByElement is off" banner in editor when element coloring is disabled
- Periodic table cells show element color as background with auto-contrast text (black or white)
- Category legend as clickable text pills for batch element selection
- Multi-select elements with Shift+click (range) and Ctrl+click (toggle)
- Right-click context menu on cells: Copy Color, Paste Color, Reset to Default, Select Category
- rAF-throttled color dispatch prevents jank during ColorPicker scrubbing
- Functional group toolbar labels use primary element color for all characters (matches canvas rendering)
- Applying any color scheme now correctly enables colorByElement (colored schemes on, Publication/B&W off)
- Contrast checker "Check against" background visually updates the grid and code view background for accurate preview
- Custom "Check against" color uses the full ColorPicker instead of a hex text input
- "Apply to All Tabs" shows confirmation dialog with tab count before applying
Bug Fixes
- Changing a color scheme no longer marks the structural preset as "Custom"
- Changing a structural setting no longer resets the color scheme
- Preset application no longer silently loses user's element colors
- colorByElement property correctly migrated from bonds sub-object to top-level on file load and auto-save restore
- Auto-saved tabs from before separation correctly migrated on restore (preset key detection, scheme detection)
- Bond length rescaling uses correct BATCH_UPDATE_ATOMS payload format
- ColorPicker circle indicator now positions correctly on the color field when opening (was always top-left because popup was not yet visible during cursor calculation)
- Functional group button labels no longer show invisible hydrogen text in CPK scheme (H was white on white background)
- "Edit Element Colors" button in Settings dialog now works (was using inline onclick that couldn't reach closure-scoped object)
- ColorPicker transitions smoothly between elements without requiring double-click (removed early-return that swallowed first click on new cell)
- Custom scheme localStorage format migration handles old flat color maps alongside new {colors, darkColors} format
- H element button in toolbar now responds to scheme color changes (was missing CSS variable rule)
- Color Scheme Editor modal no longer renders above menus, About, and What's New dialogs (z-index corrected)
- Applying custom color schemes now correctly enables colorByElement (was only working for built-in schemes)