Skip to content

[ZEPPELIN-6557] Add history-based inline completion to the new UI editor - #5339

Open
voidmatcha wants to merge 2 commits into
apache:masterfrom
voidmatcha:monaco-upgrade-spike
Open

[ZEPPELIN-6557] Add history-based inline completion to the new UI editor#5339
voidmatcha wants to merge 2 commits into
apache:masterfrom
voidmatcha:monaco-upgrade-spike

Conversation

@voidmatcha

@voidmatcha voidmatcha commented Jul 25, 2026

Copy link
Copy Markdown
Member

What is this PR for?

Adds ghost-text inline completion to the new UI notebook editor. It is the first, LLM-free, opt-in step of ZEPPELIN-6329 (AI autocomplete). InlineCompletionService registers a Monaco inline-completions provider for python/scala: when a line elsewhere in the note starts with the current line's text before the cursor, it offers the remainder as ghost text (the current cell first, then other paragraphs of the same language). There is no server call and no API key — everything is in-browser, in-memory string matching, in the spirit of fish/JupyterLab history completion.

The feature is off by default and only active with ?aiInlineComplete=true; with the flag off there is no behaviour change and no provider is registered.

This requires bumping Monaco 0.31.1 → 0.52.2 (and monaco-editor-webpack-plugin 7.0.1 → 7.1.1) for the stabilised inline-completion API. The only source compile change is editor.getAction() becoming nullable. Monaco 0.55/0.56 currently break the webpack plugin (unresolved new contrib modules), so 0.52.x is the upper bound.

The ?aiInlineComplete=true flag is an experimental gate for this purely-local tier. When the server-backed LLM tier lands (follow-up sub-task), inline completion will be promoted to a proper, persisted user setting.

What type of PR is it?

Improvement

Todos

  • Bump Monaco to 0.52.2 + webpack plugin, npm ci lock verified
  • InlineCompletionService (opt-in, history-based ghost text)
  • Update find-widget e2e selectors for Monaco 0.52 DOM changes

What is the Jira issue?

ZEPPELIN-6557 (sub-task of ZEPPELIN-6329)

How should this be tested?

  1. cd zeppelin-web-angular && npm run build && npm run lint
  2. ng serve, log in, open a note with a python paragraph (append ?aiInlineComplete=true to the URL)
  3. In one paragraph type users = spark.read.parquet("/data/users"); in another, start typing users = spark.read. — the remainder appears as grey ghost text; press Tab to accept
  4. With the flag off (default), confirm there is no ghost text and behaviour is unchanged

Monaco 0.52.2 changed the find-widget DOM (.button.next/title.codicon-find-next-match/aria-label), so the selectors in e2e/models/editor-search-page.ts were updated accordingly. Tab only accepts a suggestion while one is visible; otherwise it indents normally (built-in Monaco behaviour, not overridden).

Screenshots (if appropriate)

real-typing-demo.mp4

Questions:

  • Does the license files need to update? — No
  • Is there breaking changes for older versions? — No
  • Does this needs documentation? — No

@voidmatcha
voidmatcha force-pushed the monaco-upgrade-spike branch from ab69238 to 6ebfb7e Compare July 28, 2026 13:08
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