Skip to content

Fix intermittent CodeMirror editor initialization in snippet preview modal #448

Description

@code-snippets-bot

Problem

The code editor in the snippet preview modal sometimes fails to initialise. When this occurs, the editor text is rendered underneath or overlaps the line-number gutter.

Reproduction

Not currently reliable. The issue has been observed intermittently while manually testing the 3.10 beta.

Expected behaviour

The editor initialises consistently, with code text positioned correctly beside the line-number gutter and no overlap.

Actual behaviour

On some modal opens, the editor does not initialise correctly and the code text overlaps the line-number gutter.

Scope

Investigate the CodeMirror/editor initialisation lifecycle introduced for the snippet preview modal, including timing, mount/unmount behaviour, and container sizing. Consider whether the current editor integration is contributing.

Release context

Observed during Code Snippets 3.10 beta testing. This should be assessed for 3.10.1 unless a reliable reproduction shows that it blocks the current release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions