Skip to content

Show bond hover previews in the browser editor - #543

Merged
dhsohn merged 1 commit into
mainfrom
fix/web-bond-hover
Oct 4, 2026
Merged

dhsohn merged 1 commit into
mainfrom
fix/web-bond-hover

Conversation

@dhsohn

@dhsohn dhsohn commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Motivation

I found that selecting Bond and moving the pointer over the browser canvas produced no faint preview until a mouse press. The unpressed pointer path refreshed only the Ring and Mark previews.

Changes

  • Added a read-only bond-hover query using the shared drawing geometry, with a separate faint SVG overlay and target rings.
  • Coalesced pointer requests and suppressed stale replies after movement, leave, press, tool/style changes or document changes. Hover leaves the accepted drawing, undo history and recovery draft unchanged.
  • Added frontend interaction regressions and backend checks, including all 21 free/atom/bond × seven-style comparisons against the native two-carbon fixture. Updated the changelog.

Verification

  • bash scripts/check.sh — passed on macOS with Python 3.13.14: 16,914 passed, 424 skipped and 1,036 passing subtests; Ruff, formatting and mypy passed. Full line coverage 94.40%, branch coverage 86.52%. RDKit was not installed.
  • node --test --experimental-test-coverage tests/web_adapter.test.mjs — 187 passed. Against the merged baseline, the four new regressions fail while the existing 183 tests pass.
  • Twenty-one actual HTTP preview requests preserved the accepted drawing response and recovery draft byte for byte. Served HTML and JavaScript matched the tested source.
  • Visible browser interaction was not verified in this environment. The retained SVG was materialized from the HTTP response; it is not a browser screenshot.

Related issue

User-reported missing Bond hover preview in the browser editor.

Checklist

  • The whole local gate passes, including file-isolated tests and contract checks.
  • Added regression tests for the change.
  • Architecture boundary tests pass.
  • Updated CHANGELOG.md under Unreleased.
  • Existing controls and usage are unchanged; no README update is needed.

Notes for reviewers

The preview uses the shared committed-drawing planner. Exact native geometry parity for labelled atoms, ring/neighbour context and perspective is not established by the two-carbon fixture. After a cancelled press, the preview resumes on the next pointer movement. Preview requests replan on a copy with one request in flight.

@dhsohn
dhsohn merged commit f497227 into main Oct 4, 2026
6 checks passed
@dhsohn
dhsohn deleted the fix/web-bond-hover branch October 4, 2026 05:16
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.

1 participant