Skip to content

[Bug] Empty-editor placeholder sits above the insertion caret #92

Open

Description

@BinaryOutlook

Summary

In an empty Binary Markdown visual editor, the “Start typing…” placeholder appears above the insertion caret. Their left edges align, but their text baselines do not. Typing hides the hint and the caret aligns normally with the typed text; deleting all text brings the mismatch back.

Suggested severity: minor visual defect, with normal backlog priority. The observed scope does not justify a release blocker or a general cursor-position/data-loss classification.

Reproduction

  1. Open an empty Markdown document in Binary Markdown's visual editor.
  2. Focus the first empty paragraph and compare the caret with the “Start typing…” hint.
  3. Type Hello: the hint disappears and the caret aligns with the text.
  4. Press Backspace five times: the hint returns above the caret.
  5. Switch to source mode and back: the mismatch remains.

Expected: The hint shares the first editable line's baseline and start position. Typing replaces it at that position without a vertical jump.

Actual: The hint sits above the editable line by the theme's paragraph top margin. Larger font sizes make the mismatch more visible.

Build identity and validation

  • Verified source: e871e7a749df27c45a5d3338ecd806ace7e27bb4, matching fetched origin/main on 2026-09-29; no local source changes.
  • Probe: macOS ARM64, Node.js 24.21.0, Playwright Chromium 145.0.7632.6, current production editor CSS/body/JavaScript with the repository's test host bridge and synthetic content.
  • All seven themes reproduced the mismatch at base font sizes 16, 24 and 32 px: 21 combinations. The offset ranged from 4 to 16 CSS pixels and matched the paragraph's top margin.
  • Example: Night at base font 24 px placed the hint 12 px above the paragraph. After typing, the caret and text range had identical vertical bounds. Deleting the text and switching source/visual modes restored the mismatch. No page errors occurred.
  • The reporter confirmed that the problem is visible only beside the empty-editor hint. The original screenshot's installed extension revision, VS Code version, font setting and zoom remain unrecorded; obtain them with Binary Markdown: Copy Build Information and the relevant settings.

This is a browser reproduction of current source, not a new installed-VSIX or cross-platform acceptance run. Native saving and undo/redo were outside this focused probe.

Likely cause and proposed direction

The placeholder rule creates an absolutely positioned pseudo-element on the editor root. The empty paragraph's top margin, including theme overrides, moves the caret's line without moving the hint. A temporary browser-only margin override reduced the measured offset to zero, supporting this diagnosis.

Prefer anchoring the hint to the actual empty paragraph and inheriting its typography. Preserve normal paragraph layout so typing does not move the line; avoid a fixed pixel correction that fits only one theme or font size.

Acceptance criteria

  • Hint and caret align across supported themes, font sizes, zoom levels and editor widths.
  • Typing/pasting hides the hint without moving the first text line; clearing content restores an aligned hint.
  • Empty-document initialization, delete-to-empty, undo/redo and source/visual switching retain correct behavior.
  • Focus and view-only actions do not insert placeholder text into Markdown or dirty an unchanged document.
  • Add a focused geometry regression check using production CSS and verify the fix in an identified installed VSIX.

Activity

  1. added
    bug
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions