[ZEPPELIN-6557] Add history-based inline completion to the new UI editor - #5339
Conversation
6ebfb7e to
50ef4e8
Compare
c0e1378 to
ff0d988
Compare
jongyoul
left a comment
There was a problem hiding this comment.
LGTM. I hope we could expand this feature to use AI sooner. 👍
889f418 to
2f98582
Compare
6812528 to
f4baa47
Compare
57edab0 to
9c92321
Compare
|
@tbonelee I stabilized the inline completion E2E by verifying blur through an outside click because Monaco handles the second ESC differently in Firefox and WebKit. Instead of relying on ghost-text-specific DOM, the test polls |
| await expect(inputArea).toBeFocused(); | ||
|
|
||
| // Firefox and WebKit handle Monaco's second Escape differently from Chromium. | ||
| await page.locator('body').click({ position: { x: 5, y: 5 } }); |
There was a problem hiding this comment.
Could we make the test name more explicit first? preserves focus on the first Escape implies a second step, but the body no longer has a second Escape.
Just to confirm the intent: was this meant to verify that the editor blurs on the second Escape? If so, the last commit seems to change direction a little. Clicking outside blurs through native browser behaviour, so I think it never goes through the Escape command or the when clause (!inlineSuggestionVisible). If clicking outside already blurred the editor before this PR, wouldn't the assertion pass regardless of the change here? That feels slightly off from what the test set out to verify.
9c92321 to
6cc9d16
Compare
6cc9d16 to
ecd7fbe
Compare
|
Merged into master |
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).
InlineCompletionServiceregisters 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-plugin7.0.1 → 7.1.1) for the stabilised inline-completion API. The only source compile change iseditor.getAction()becoming nullable. Monaco 0.55/0.56 currently break the webpack plugin (unresolved newcontribmodules), so 0.52.x is the upper bound.The
?aiInlineComplete=trueflag 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
npm cilock verifiedInlineCompletionService(opt-in, history-based ghost text)What is the Jira issue?
ZEPPELIN-6557 (sub-task of ZEPPELIN-6329)
How should this be tested?
cd zeppelin-web-angular && npm run build && npm run lintng serve, log in, open a note with a python paragraph (append?aiInlineComplete=trueto the URL)users = spark.read.parquet("/data/users"); in another, start typingusers = spark.read.— the remainder appears as grey ghost text; press Tab to acceptMonaco 0.52.2 changed the find-widget DOM (
.button.next/title→.codicon-find-next-match/aria-label), so the selectors ine2e/models/editor-search-page.tswere 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: