发布

  • [OPIK-6754] [FE] polish: env pill sizing, deploy menu UX, playground hover fix (#6937)

    frostbyte_neo 发布于 2026-06-10 11:11:38 +00:00

    • [OPIK-6754] [FE] polish: env pill sizing, deploy menu UX, playground hover-strip fix

    Follow-up polish on the prompt-environment surfaces shipped in OPIK-6626:

    • Env pill spec (h-5 / text-[10px] / leading-5 / asymmetric padding) exported
      from EnvironmentBadge as ENV_BADGE_PROMPT_PILL_CLASS and reused across the
      prompt detail header, mobile version picker, version history timeline, and
      the +N overflow tooltip
    • LoadedPromptDisplay now surfaces env icons next to the version label so the
      Prompt playground chat chip matches the Agent runner
    • DropdownMenuItem size="sm" (32px / 12px) applied uniformly to
      DeployToEnvironmentMenu, EnvironmentFilterSelect, AgentRunnerPromptCard
      versions menu, and the PromptLibraryMenu version submenu
    • PromptLibraryMenu version submenu: regular label weight (matches Agent
      runner), 32px search input, 8px gap
    • AddEditEnvironmentDialog: color popover closes on preset/Enter, Cmd/Ctrl+Enter
      saves
    • EnvironmentNameCell: dropped extra px-2 + dead border-transparent wrapper so
      content aligns with the column header
    • PlaygroundPrompt: pin the hover-revealed actions strip open while the chat
      prompt library popover is up — previously it collapsed to max-w-0 the moment
      the mouse left the trigger, causing the popover to re-anchor and visibly shift

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

    • [OPIK-6754] [FE] refactor: promptPill size variant on EnvironmentBadge

    Replaces the ENV_BADGE_PROMPT_PILL_CLASS magic string with a proper size
    variant on EnvironmentBadge / EnvironmentBadgeList. Call sites now pass
    size="promptPill" and tailwind-merge no longer has to resolve conflicts
    against SIZE_CLASSES["sm"] at runtime.

    Also switches PromptLibraryMenu's SearchInput to dimension="sm" after
    SearchInput dropped its size prop on main (#6854).

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

    • [OPIK-6754] [FE] chore: rename EnvironmentBadge size variant promptPill → pill

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

    • [OPIK-6754] [FE] fix: route PromptLibraryMenu selection-close through handleOpenChange

    Calling setOpen(false) directly from handleSelect updated the internal state
    but Radix Popover doesn't re-fire onOpenChange when the controlled value
    flips externally, so the parent's onOpenChange subscriber (the playground's
    isChatLibraryOpen hover-strip pin) never saw the close and the strip
    remained pinned open after selecting a prompt.

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

    • remove comments;

    • [OPIK-6754] [FE] chore: prettier formatting

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

    • [OPIK-6754] [FE] feat: env ordering + random palette default on create
    • sortEnvironments helper applied inside useEnvironmentsList so every consumer
      (configuration table, deploy menu, traces filter) shows the same order:
      production → staging → development → rest alphabetical
    • AddEditEnvironmentDialog create-mode initial color picks a random
      PRESET_HEX_COLORS entry via a lazy useState initializer

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

    • [OPIK-6754] [FE] fix: move sortEnvironments to src/utils to satisfy layering

    The api → shared edge tripped the no-api-importing-components
    dep-cruiser rule once useEnvironmentsList pulled sortEnvironments from
    shared/EnvironmentLabel/helpers.ts. Move the pure-data helper to
    src/utils/environments.ts so the API layer can import it cleanly.

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

    • [OPIK-6754] [FE] polish: deploy menu clear-all icon + loaded-prompt chip spacing
    • DeployToEnvironmentMenu: prefix the clear-all item with an X icon and
      shorten the label to "Remove from all"
    • LoadedPromptDisplay: bump the version label to mx-1.5 so the env-icon list
      sits a touch further from v{N}

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

    • [OPIK-6754] [FE] fix: tighten PromptLibraryMenu env list maxWidth so +N appears

    The 80px cap was wide enough to fit 4 colored env squares without triggering
    the overflow chip, even though the actual flex-shrunk container had less
    room and the last square ended up touching the timestamp. Match the
    LoadedPromptDisplay chip's maxWidth=60 so +N kicks in for 4+ envs.

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

    • [OPIK-6754] [FE] review fixes: mutation guard, a11y, pill typography, dedupe defaults
    • AddEditEnvironmentDialog: gate Cmd/Ctrl+Enter + submit button on
      createMutation/updateMutation isPending so a held Enter (or rapid clicks)
      can't dispatch duplicate create/update requests
    • AddEditEnvironmentDialog: add role="alert" to the destructive name/submit
      error

      so screen readers announce validation/backend failures

    • EnvironmentBadge / EnvironmentBadgeList: prefix the pill SIZE_CLASS /
      COUNTER_CLASS with comet-body-xs so the new variant inherits the design
      system font-family/weight/tracking like every other size
    • useEnvironmentsList: guard sortEnvironments against a missing content
      field in the API response (data.content ?? [])
    • Dedupe default env names: utils/environments.ts now owns the canonical
      DEFAULT_ENVIRONMENT_NAMES tuple; shared/EnvironmentLabel/helpers.ts keys
      its icon/color map by DefaultEnvironmentName so adding a new default
      forces editing the canonical list

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


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

    下载附件