Skip to content

chore(deps): bump @fc-components/monaco-editor to 0.6.0 - #2296

Merged
jsers merged 2 commits into
mainfrom
feat/kql-monaco-editor
Sep 9, 2026
Merged

jsers merged 2 commits into
mainfrom
feat/kql-monaco-editor

Conversation

@jsers

@jsers jsers commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Migrated the KQL query editor to a Monaco-based editing experience.
    • Added support for triggering updates on text changes through the onChange trigger option.
    • Preserved query completion and suggestion behavior through the new editor.
  • Changes

    • Replaced the previous editor’s KQL parsing, theming, and syntax-highlighting implementation.
    • Removed local query-history storage and historical-record-based completion.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: fab6b7ec-d444-40a0-b5f0-b309e00117bb

📥 Commits

Reviewing files that changed from the base of the PR and between 6f95c20 and 7190c85.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • package.json
  • src/components/KQLInput/CMTheme.tsx
  • src/components/KQLInput/complete/hybrid.ts
  • src/components/KQLInput/complete/index.ts
  • src/components/KQLInput/grammar/parser.js
  • src/components/KQLInput/index.tsx
  • src/components/KQLInput/kql.ts
  • src/components/KQLInput/style.less
  • src/components/KQLInput/utils.ts

📝 Walkthrough

Walkthrough

The KQL input migrated from CodeMirror to KQLMonacoEditor. Monaco completion now uses cached and HTTP clients. The previous CodeMirror parser, completion, theme, syntax-highlighting, and local history modules were removed.

Changes

KQL editor migration

Layer / File(s) Summary
Monaco editor component
package.json, src/components/KQLInput/index.tsx
The Monaco editor dependency was upgraded. KQLInput now manages editor state, supports onChange, preserves query ranges without mutation, and handles editor events.
Completion and parser replacement
src/components/KQLInput/index.tsx, src/components/KQLInput/complete/*, src/components/KQLInput/grammar/parser.js, src/components/KQLInput/kql.ts, src/components/KQLInput/CMTheme.tsx, src/components/KQLInput/style.less
Monaco completion delegates field lookups to cached and HTTP clients. The previous CodeMirror completion, parser, language extension, themes, and styles were removed.
Query history removal
src/components/KQLInput/utils.ts
Local query history storage and retrieval utilities were removed.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant KQLInput
  participant KQLMonacoEditor
  participant ESCachedClient
  participant ESHTTPClient
  KQLInput->>KQLMonacoEditor: Render query and callbacks
  KQLMonacoEditor->>KQLInput: Send editor events
  KQLInput->>ESCachedClient: Fetch field names or values
  ESCachedClient->>ESHTTPClient: Request completion data
Loading

Suggested reviewers: guguji5, star-6

✨ 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 feat/kql-monaco-editor

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.

Replace the CodeMirror-based KQL editor with KQLMonacoEditor from
@fc-components/monaco-editor (bumped to ^0.6.2). Reuse the existing
elasticsearch completion client for field/value suggestions. Drop the
now-unused CMTheme, completion, grammar, kql, style and utils modules.
@jsers
jsers marked this pull request as ready for review September 9, 2026 03:47
Copilot AI lite review requested due to automatic review settings September 9, 2026 03:47
@jsers
jsers merged commit a2840d5 into main Sep 9, 2026
1 check passed

Copilot AI 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.

🔵 Needs a closer look

It includes a significant editor migration and behavioral surface-area change beyond a dependency bump, warranting explicit PR scoping and focused manual verification.

Pull request overview

This PR updates @fc-components/monaco-editor and migrates KQLInput from a CodeMirror-based implementation to the KQLMonacoEditor component, removing the now-unused CodeMirror KQL language/completion/theme assets under src/components/KQLInput/.

Changes:

  • Bump @fc-components/monaco-editor dependency (package + lockfile).
  • Replace src/components/KQLInput CodeMirror editor wiring with KQLMonacoEditor and ES-backed field name/value fetchers.
  • Delete KQLInput’s CodeMirror-specific completion, grammar, theming, styles, and local-history utilities.
File summaries
File Description
src/components/KQLInput/index.tsx Switch KQL input editor to KQLMonacoEditor, rewire completion data fetching, and adjust trigger behavior types.
src/components/KQLInput/utils.ts Remove local query-history helpers previously used by the CodeMirror implementation.
src/components/KQLInput/style.less Remove CodeMirror highlight CSS classes for KQL.
src/components/KQLInput/kql.ts Remove CodeMirror LRLanguage definition and extension wrapper.
src/components/KQLInput/grammar/parser.js Remove generated Lezer parser used by CodeMirror completion/highlighting.
src/components/KQLInput/complete/index.ts Remove CodeMirror completion strategy factory.
src/components/KQLInput/complete/hybrid.ts Remove hybrid completion implementation tied to CodeMirror syntax tree analysis.
src/components/KQLInput/CMTheme.tsx Remove CodeMirror theme/highlighter definitions.
package.json Update @fc-components/monaco-editor version range.
package-lock.json Update lockfile entries for @fc-components/monaco-editor to the new resolved version.
Review details

Suppressed comments (1)

src/components/KQLInput/index.tsx:47

  • 这里解构了 historicalRecords 但后续未使用;这会增加阅读负担,也可能触发 no-unused-vars / noUnusedLocals。既然要保留该 prop 兼容旧调用方,可以只保留说明注释而不解构出变量。
  const {
    datasourceValue,
    query,
    historicalRecords, // 新编辑器暂不支持历史记录补全,保留 prop 以兼容旧调用方
    value,
  • Files reviewed: 9/10 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json
"@fc-components/codemirror-promql": "^0.19.13",
"@fc-components/es-query": "^0.0.3",
"@fc-components/monaco-editor": "^0.5.12",
"@fc-components/monaco-editor": "^0.6.2",
Comment on lines +1 to 5
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
import _ from 'lodash';
import i18next from 'i18next';
import { KQLMonacoEditor } from '@fc-components/monaco-editor';
import { IRawTimeRange } from '@/components/TimeRangePicker';
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.

2 participants