发布

  • [OPIK-6626] [FE] feat: surface prompt environments across prompt UIs (#6892)

    frostbyte_neo 发布于 2026-05-28 15:39:32 +00:00

    • [OPIK-6626] [FE] feat: surface prompt environments across prompt UIs

    Bring multi-environment support to the prompt-facing surfaces of the
    frontend: render assigned environments next to every prompt-version
    reference, with a single-line overflow ("+N") pattern that scales from
    the prompt page toolbar down to compact dropdown rows.

    • Add EnvironmentBadgeList with three render modes (default flex-wrap,
      withOverflow + maxWidth, and compact squares with name tooltips) and
      consolidate the env-by-name lookup into a shared useEnvironmentByName
      hook
    • Wire env badges into the prompt page toolbar/mobile dropdown, version
      history timeline, prompt library menu (rows + version submenu),
      compare-against popup, diff view headers, agent runner prompt card,
      and the trace view prompt card
    • Plumb versionId through compact PromptsSelectBox into
      LLMPromptMessageActions so the playground text-prompt loader honors
      the picked version instead of always loading latest
    • Fix off-by-one gap miscount in useVisibleItemsByWidth so a perfectly
      fitting container correctly reports all items as visible
    • Make agent runner version dropdown scrollable and drop the purple
      selected-row background on the Deploy-to-environment menu

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

    • [OPIK-6626] [FE] fix: match compact +N counter visual size to env square

    Use 18px outer with 1px border so the inner content area is exactly 16x16,
    matching the EnvironmentSquare's filled 16x16. Stays out of the way of the
    flex shrink algorithm so single-digit counts render at a stable size.

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

    • [OPIK-6626] [FE] chore: appease prettier on PromptTab Separator

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

    • [OPIK-6626] [FE] fix: address baz review comments
    • EnvironmentBadgeList: track hasMeasured so the overflow render no
      longer conflates "not yet measured" with "measured and zero fit";
      once measurement completes we render exactly the items the hook
      reports, instead of falling back to the full list + chip
    • EnvironmentSquare: drop hard-coded text-white on the inner icon and
      derive the foreground via getContrastingTextColor(resolvedColor),
      fixing poor contrast on light env swatches (e.g. staging)

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


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

    下载附件