Skip to content

Autocomplete noise: typing a message/title label pops keyword suggestions (e.g. A->B: title screen offers the title keyword) #813

@MrCoder

Description

@MrCoder

Summary

While typing a free-text message label (or title/divider text), the autocomplete popup
offers keyword suggestions whenever a label word prefixes a keyword. A real user writing
natural labels like "title screen", "while loading", "section header", "return policy",
"new feature" gets an irrelevant keyword popup — pure noise.

Steps to reproduce

Type A->B: titl → popup shows title (Diagram title). Type A->B: whil → shows while.

Expected

No completions inside a free-text label — the cursor is in a Content/LineContent node,
which is not a code position.

Cause

zenumlCompletions (web/src/editor/zenumlAutocomplete.ts) resolves the label position to
the 'top' zone (the Content node has no Head/Block/Group ancestor), so
keywordsForZone('top') offers all keywords; CodeMirror's fuzzy filter then surfaces any
that prefix-match the label word.

Fix

Early-return null when the cursor is inside a Content / LineContent node (the message
label / title / divider free-text), alongside the existing Comment-node guard. From/To
endpoints are siblings (not inside Content), so participant completion at message endpoints
is unaffected.

Found via real-user dogfooding in the editor-improvement campaign.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions