Skip to content

feat(ui): add inherited custom step editor hints#1994

Merged
yottahmd merged 7 commits intomainfrom
editor-hints
Apr 12, 2026
Merged

feat(ui): add inherited custom step editor hints#1994
yottahmd merged 7 commits intomainfrom
editor-hints

Conversation

@yottahmd
Copy link
Copy Markdown
Collaborator

@yottahmd yottahmd commented Apr 12, 2026

Summary

  • add inherited custom step editor hints from base config to the document-specific DAG editor schema
  • keep custom step type and config inference working when the editor schema is dereferenced inline
  • scope the custom Ctrl/Cmd+Space Monaco action to focused writable editors with completion providers

Why

The DAG editor still needed inherited custom step metadata from base config so autocomplete and schema docs could resolve custom step types beyond the local step_types block. The Monaco shortcut follow-up fixes a regression from the custom suggest action being registered without the built-in focus and provider guards, which made Ctrl/Cmd+Space broader than the default suggest command.

Testing

  • go test ./internal/core/spec -count=1
  • go test ./internal/service/frontend/api/v1 -count=1
  • cd ui && pnpm typecheck
  • cd ui && pnpm test -- src/features/dags/components/dag-editor/__tests__/customStepSchema.test.ts (the target test passed, but Vitest exited non-zero because of an unrelated existing unhandled error in src/features/dags/components/dag-details/__tests__/DAGDetailsSidePanel.test.tsx)

Summary by CodeRabbit

  • New Features

    • Added keyboard shortcut (Ctrl/Cmd+Space) to trigger code suggestions in the DAG editor.
  • Improvements

    • Enhanced error handling and validation for editor hints with better error messages.
    • Refined suggestion behavior in the YAML editor based on read-only state.
  • Chores

    • Internal code organization and formatting improvements.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6abfd64c-6daa-4c49-964f-1088ed42cfd6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Backend editor hint generation now skips nil registry entries and inlines schema serialization instead of delegating to a helper function, with improved error messages. UI Monaco editor configuration enables code suggestions on Ctrl/Cmd+Space for non-read-only editors. Several import statement reorderings and formatting adjustments across TypeScript components and tests.

Changes

Cohort / File(s) Summary
Backend Schema Handling
internal/core/spec/editor_hints.go
Modified InheritedCustomStepTypeEditorHints to skip nil entries and missing InputSchema, inline schema marshal/unmarshal operations replacing previous delegated calls, and wrap errors with context including custom step type names.
Monaco Editor Configuration
ui/src/features/dags/components/dag-editor/DAGEditor.tsx
Added custom Monaco action (dagu.triggerSuggest) bound to Ctrl/Cmd+Space for code suggestion triggering in non-read-only editors. Updated suggestOnTriggerCharacters configuration to depend on readOnly state. Explicit JSONSchema type import added.
Import and Formatting Adjustments
ui/src/features/dags/components/dag-editor/DAGSpec.tsx, ui/src/features/dags/components/dag-editor/customStepSchema.ts, ui/src/features/dags/components/dag-editor/__tests__/customStepSchema.test.ts
Reordered imports in multiple files for consistency. Reformatted function invocations and conditional expressions in test and schema utility files without changing runtime behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(ui): add inherited custom step editor hints' accurately describes the main change—adding inherited custom step editor hints to support autocomplete and schema resolution.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch editor-hints

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
ui/src/features/dags/components/dag-editor/DAGSpec.tsx (1)

1-5: ⚠️ Potential issue | 🟠 Major

Add the required GPL header to this modified TSX file.

This source file is touched by the PR but is missing the repository-required GPL header.

Proposed fix
+// Copyright (C) 2026 Yota Hamada
+// SPDX-License-Identifier: GPL-3.0-or-later
+
 /**
  * DAGSpec component displays and allows editing of a DAG specification.

As per coding guidelines, "**/*.{go,ts,tsx,js}: Apply GPL v3 license headers on source files, managed via make addlicense."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/src/features/dags/components/dag-editor/DAGSpec.tsx` around lines 1 - 5,
This file (DAGSpec.tsx / DAGSpec component) is missing the repository-required
GPL v3 license header; add the standard GPL v3 header used across the repo at
the very top of the file (matching the header added by the project's make
addlicense tooling), ensuring it includes the correct SPDX/license lines and
copyright notice format used elsewhere, then run or simulate make addlicense to
verify consistency.
ui/src/features/dags/components/dag-editor/DAGEditor.tsx (1)

1-5: ⚠️ Potential issue | 🟠 Major

Add the required GPL header to this modified TSX file.

This file is changed in the PR but does not include the GPL license header block required by the repository policy.

Proposed fix
+// Copyright (C) 2026 Yota Hamada
+// SPDX-License-Identifier: GPL-3.0-or-later
+
 /**
  * DAGEditor component provides a Monaco editor for editing DAG YAML definitions.

As per coding guidelines, "**/*.{go,ts,tsx,js}: Apply GPL v3 license headers on source files, managed via make addlicense."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/src/features/dags/components/dag-editor/DAGEditor.tsx` around lines 1 - 5,
This file (DAGEditor.tsx / DAGEditor component) is missing the required GPL v3
license header; add the repository's standard GPL v3 header block at the very
top of the file (matching other .ts/.tsx files in the repo) so the header covers
the whole source file, and then run the automated tool (make addlicense) or
otherwise ensure the exact header format used across the codebase is applied
consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/core/spec/editor_hints.go`:
- Around line 56-75: The current loop drops custom step entries when
entry.InputSchema or entry.InputSchema.Schema() is nil; instead, preserve the
entry and emit a CustomStepTypeEditorHint with an empty InputSchema. Change the
guard to only skip nil entry, and when entry.InputSchema or
entry.InputSchema.Schema() is nil set schemaMap = map[string]any{}; otherwise
marshal/unmarshal as before. Ensure you still return formatted errors from
json.Marshal/unmarshal for the non-nil-schema path and append the hint with
Name, TargetType, Description, and InputSchema (the empty map or the parsed map)
so downstream code receives the hint even without a schema.

---

Outside diff comments:
In `@ui/src/features/dags/components/dag-editor/DAGEditor.tsx`:
- Around line 1-5: This file (DAGEditor.tsx / DAGEditor component) is missing
the required GPL v3 license header; add the repository's standard GPL v3 header
block at the very top of the file (matching other .ts/.tsx files in the repo) so
the header covers the whole source file, and then run the automated tool (make
addlicense) or otherwise ensure the exact header format used across the codebase
is applied consistently.

In `@ui/src/features/dags/components/dag-editor/DAGSpec.tsx`:
- Around line 1-5: This file (DAGSpec.tsx / DAGSpec component) is missing the
repository-required GPL v3 license header; add the standard GPL v3 header used
across the repo at the very top of the file (matching the header added by the
project's make addlicense tooling), ensuring it includes the correct
SPDX/license lines and copyright notice format used elsewhere, then run or
simulate make addlicense to verify consistency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ab42e7eb-f9be-48ea-97c3-227c8d0ad7cd

📥 Commits

Reviewing files that changed from the base of the PR and between d48a0b7 and 564dc70.

📒 Files selected for processing (5)
  • internal/core/spec/editor_hints.go
  • ui/src/features/dags/components/dag-editor/DAGEditor.tsx
  • ui/src/features/dags/components/dag-editor/DAGSpec.tsx
  • ui/src/features/dags/components/dag-editor/__tests__/customStepSchema.test.ts
  • ui/src/features/dags/components/dag-editor/customStepSchema.ts

Comment thread internal/core/spec/editor_hints.go Outdated
@yottahmd yottahmd merged commit 30ecf8f into main Apr 12, 2026
2 checks passed
@yottahmd yottahmd deleted the editor-hints branch April 12, 2026 05:53
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