发布

  • [OPIK-6231] [FE] feat: add OpenClaw to onboarding integrations grid (#7114)

    frostbyte_neo 发布于 2026-06-17 09:30:00 +00:00

    • [OPIK-6231] [FE] feat: add OpenClaw to onboarding integrations grid

    Adds OpenClaw to the onboarding Get Started page integrations grid at
    the last position of the first row, with a CLI-driven quickstart
    snippet linking to the existing OpenClaw docs at /integrations/openclaw.

    The logo is a placeholder copy of opik.png and will be replaced with
    the official OpenClaw mark before merge.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • chore(integrations): swap OpenClaw placeholder PNG for official SVG

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • fix(integrations): tailor install copy and snippet for OpenClaw
    • Add optional installTitle/installDescription fields to the
      Integration type so non-pip integrations can override the shared
      "Install Opik using pip" copy. Defaults remain unchanged for the
      other 27 entries.
    • Render the new fields with fallbacks in the v1 and v2
      IntegrationDetailsDialog.
    • Wire OpenClaw to use OpenClaw-specific install copy.
    • Rewrite OpenClaw quickstart snippet to follow the README's primary
      4-step CLI flow and preview the JSON config the wizard writes.
      Drop the env-var fallback block since it wasn't being substituted
      by putConfigInCode and the README treats env vars as a fallback.

    Addresses baz-reviewer feedback on PR #6847.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • feat(integrations): bash highlighting for non-Python integrations

    Adds optional codeLanguage on the Integration type and wires it through
    the v1/v2 IntegrationDetailsDialog code preview so non-pip integrations
    can pick a more appropriate language than the default python.

    • Extract SUPPORTED_LANGUAGE into src/constants/codeLanguage.ts so it
      can be referenced from src/constants/ without violating the
      no-constants-importing-runtime dependency rule. Re-export from
      CodeHighlighter and CodeExecutor to avoid touching existing callers.
    • Add bash to SUPPORTED_LANGUAGE, backed by @codemirror/legacy-modes
      shell mode. Declare @codemirror/language explicitly while adding the
      legacy-modes dep.
    • Mirror the enum + plugin map change in CodeExecutor.
    • Rename OpenClaw.py → OpenClaw.sh, drop the # -comment-everything
      workaround, mirror the README's 4 numbered steps as real shell with
      a JSON config block below.
    • Set OpenClaw codeLanguage to bash.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • feat(integrations): render multi-step CLI flows as separate IntegrationStep rows

    The OpenClaw README presents setup as 4 numbered steps (install,
    configure, status, run+test). The dialog was cramming all of step 2-4
    into a single "Run the following code" block, which hid the structure
    and required commenting-out every line in the source snippet to avoid
    syntax errors.

    • Add optional additionalSteps[] (IntegrationStepConfig) to the
      Integration type. When set, the v1/v2 IntegrationDetailsDialog and
      ManualIntegrationDetail render each step as its own IntegrationStep
      row instead of the single bundled code block. Other integrations are
      unchanged.
    • Each step carries its own title/description/code/language and runs
      through putConfigInCode so PROJECT_NAME_PLACEHOLDER substitution
      still works.
    • Plumb installTitle/installDescription overrides into
      ManualIntegrationDetail (previously only the dialog used them) and
      hide the Python-specific opik.configure(...) extra block when an
      integration provides its own install copy.
    • Wire OpenClaw to 3 additionalSteps mirroring README steps 2-4. The
      README's step 1 (install) is already the dialog's first row.
    • Delete the now-redundant OpenClaw.sh placeholder snippet.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • refactor(integrations): extract AdditionalIntegrationSteps; make additionalSteps additive

    Addresses baz-reviewer feedback on PR #6847.

    Before: additionalSteps replaced the canonical "Run the following code"
    block via a ternary. The field name said "additional" but the behavior
    was "replace", and three call sites (v1 dialog, v2 dialog,
    ManualIntegrationDetail) duplicated the same map+putConfigInCode loop.

    After:

    • Extract the per-step rendering into a shared component at
      src/shared/OnboardingIntegrationsPage/AdditionalIntegrationSteps.tsx.
      It takes IntegrationStep as a render-prop so the v1 and v2 dialog
      copies (and ManualIntegrationDetail) all pass their own without
      cross-version imports.
    • All three call sites now render additionalSteps (when present) AND
      the canonical "Run the following code" block (when integration.code
      is non-empty). For OpenClaw, code is "" so only the additionalSteps
      show — same UX as before. Future integrations that set both fields
      get both blocks.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • refactor(integrations): dedupe install copy + codemirror language map

    Addresses baz-reviewer feedback on PR #7114.

    • Extract the install-step fallback copy into shared constants
      (INSTALL_OPIK_DEFAULT_TITLE, INSTALL_OPIK_DEFAULT_DESCRIPTION)
      in constants/shared.ts, alongside INSTALL_OPIK_SECTION_TITLE.
      Consumed from v1 dialog, v2 dialog, and ManualIntegrationDetail
      instead of duplicating literals in three files.
    • Extract the codemirror language→Extension mapping into a shared
      getLanguageExtension() helper at
      shared/CodeHighlighter/getLanguageExtension.ts. CodeHighlighter
      and both CodeExecutor copies (v1 + v2) now call the helper instead
      of maintaining their own PLUGINS_MAP + duplicate codemirror
      imports. Adding a new language is now a single-file change.
    • Drive-by: v2 CodeExecutor had its own local SUPPORTED_LANGUAGE
      enum that hadn't been updated with bash — fixed by switching it to
      the central constants/codeLanguage source.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • refactor(integrations): scope OpenClaw onboarding to v2; redirect SUPPORTED_LANGUAGE consumers

    Addresses andriidudar's review on PR #7114.

    v1 onboarding is reached only by workspaces in v1WorkspaceAllowlist
    since OPIK-6779 flipped the BE default to version_2. Rather than
    back-patch a deprecating surface, scope this PR to v2:

    • Revert v1 IntegrationDetailsDialog and v1/v2 CodeExecutor to
      their origin/main state. The v1 dialog will render OpenClaw's
      empty code block until the v1WorkspaceAllowlist is empty in prod
      and the v1 quickstart is deleted (separate cleanup).
    • Drop the export { SUPPORTED_LANGUAGE } back-compat shim from
      CodeHighlighter. Every consumer now imports the enum directly
      from @/constants/codeLanguage, eliminating the second source of
      truth. Touches 8 consumer files (3 v1, 5 v2), import-source-only.

    This addresses the 3 inline SUPPORTED_LANGUAGE re-export
    suggestions: the CodeHighlighter shim is gone, and the v1/v2
    CodeExecutor local enums are restored to their pre-PR state (no new
    duplication introduced by this PR).

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com


    Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com

    下载附件