Skip to content

fix(ai): mirror shared-surface AI autocomplete fixes from openplc-web#922

Merged
thiagoralves merged 1 commit into
developmentfrom
fix/ai-autocomplete-empty-completions
Jul 4, 2026
Merged

fix(ai): mirror shared-surface AI autocomplete fixes from openplc-web#922
thiagoralves merged 1 commit into
developmentfrom
fix/ai-autocomplete-empty-completions

Conversation

@thiagoralves

@thiagoralves thiagoralves commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Byte-identical mirror of the shared frontend / middleware changes landing in openplc-web#583 (fix/ai-autocomplete-empty-completions), kept in sync by the mirror gate.

Changes (shared surface only)

  • monaco/index.tsx: editContext: false (Safari Tab-accept fix) and inlineSuggest.experimental.showOnSuggestConflict: 'always' so AI ghost text renders alongside the STruC++ LSP suggest widget.
  • middleware/shared/ports/ai-port.ts: new completion_empty telemetry event name.
  • CLAUDE.md: documents the app-version bump procedure.

No desktop release

The empty-completion behavioural fixes live in the web-only AI adapter and the autonomy-edge backend. This PR only keeps the shared surface identical — no version bump, no tag, no new build. Merge to development only.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Improved AI suggestion behavior in the editor so inline completions stay visible more reliably alongside the suggestion list.
  • Bug Fixes

    • Fixed Tab key handling for accepting inline AI suggestions in supported browsers.
    • Added support for tracking empty AI completion results for better telemetry coverage.
  • Documentation

    • Clarified version-bumping and release ordering guidance for app updates.

Byte-identical mirror of the shared frontend / middleware changes that
land in openplc-web (PR fix/ai-autocomplete-empty-completions), kept in
sync by the mirror gate:

- monaco editor: `editContext: false` (Safari Tab-accept fix) and
  `inlineSuggest.experimental.showOnSuggestConflict: 'always'` so AI
  ghost text renders alongside the STruC++ LSP suggest widget.
- ai-port: new `completion_empty` telemetry event name.

The empty-completion behavioural fixes themselves live in the web-only
AI adapter (context builder + inline completion provider) and the
autonomy-edge backend, so no desktop release is required — this only
keeps the shared surface identical.

Also documents the app-version bump procedure in CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR updates Monaco editor configuration to disable EditContext for reliable Tab-based AI suggestion acceptance and forces ghost text visibility during suggest widget conflicts, adds a new telemetry event name, and documents the app version bump process in CLAUDE.md.

Changes

Monaco Editor AI Suggestion Behavior

Layer / File(s) Summary
Editor input mode and inline suggest conflict handling
src/frontend/components/_features/[workspace]/editor/monaco/index.tsx
Disables Monaco EditContext (editContext: false) to restore Tab acceptance of AI suggestions and sets inlineSuggest.experimental.showOnSuggestConflict to 'always' to keep AI ghost text visible during suggest widget conflicts.

Telemetry Event and Documentation

Layer / File(s) Summary
Telemetry event addition and version bump docs
src/middleware/shared/ports/ai-port.ts, CLAUDE.md
Adds 'completion_empty' to the AITelemetryEventName union and documents the APP_VERSION bump process and release/tag ordering across repos.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit hopped through Monaco's code,
Fixed the Tab key on Safari's road,
Ghost text stays when suggestions collide,
One new telemetry event to confide,
And version docs, now clear as day —
Hop, hop, ship it away! 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the changes well, but it omits the template's References section and DOD checklist. Add the required References fields and complete the DOD checklist, including test status and any relevant issue or Jira links.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: mirroring shared AI autocomplete fixes from openplc-web.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ai-autocomplete-empty-completions

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/frontend/components/_features/[workspace]/editor/monaco/index.tsx (1)

1295-1313: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add a regression check for Monaco’s inline-suggest conflict mode
inlineSuggest.experimental.showOnSuggestConflict sits outside Monaco’s public IInlineSuggestOptions surface, so a Monaco bump can quietly disable this ghost-text/suggest coexistence path. Add a small runtime/e2e check — or at least a version-bump note — to keep this from regressing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/frontend/components/_features/`[workspace]/editor/monaco/index.tsx around
lines 1295 - 1313, Add a regression check around the Monaco inlineSuggest
configuration in the editor setup so `experimental.showOnSuggestConflict` cannot
silently stop working on a Monaco upgrade. In `monaco/index.tsx`, where
`inlineSuggest` is built and cast to `monacoEditorOptionsType['inlineSuggest']`,
add a small runtime/e2e assertion (or a version-bump guard/note in the same
flow) that verifies the ghost text still coexists with the suggest widget when
`installAiLspCoexistenceKeybindings` is active, and keep the check tied to the
inline-suggest option path so future Monaco bumps are caught early.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/frontend/components/_features/`[workspace]/editor/monaco/index.tsx:
- Around line 1295-1313: Add a regression check around the Monaco inlineSuggest
configuration in the editor setup so `experimental.showOnSuggestConflict` cannot
silently stop working on a Monaco upgrade. In `monaco/index.tsx`, where
`inlineSuggest` is built and cast to `monacoEditorOptionsType['inlineSuggest']`,
add a small runtime/e2e assertion (or a version-bump guard/note in the same
flow) that verifies the ghost text still coexists with the suggest widget when
`installAiLspCoexistenceKeybindings` is active, and keep the check tied to the
inline-suggest option path so future Monaco bumps are caught early.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 535d9ae1-6908-4bd3-ad29-93a60dec653b

📥 Commits

Reviewing files that changed from the base of the PR and between 15fea35 and 6ca0fa6.

📒 Files selected for processing (3)
  • CLAUDE.md
  • src/frontend/components/_features/[workspace]/editor/monaco/index.tsx
  • src/middleware/shared/ports/ai-port.ts

@thiagoralves
thiagoralves merged commit a1de71a into development Jul 4, 2026
13 checks passed
@thiagoralves
thiagoralves deleted the fix/ai-autocomplete-empty-completions branch July 4, 2026 20:49
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