feat(evaluators): gallery card tweaks - #15691
Conversation
6dbd129 to
d2dd99c
Compare
ba4179e to
3aeb66e
Compare
…ibility in AddProjectEvaluatorMenu Lets the gallery page reuse the same menu with a wider, differently labeled button and without the redundant "Browse the whole library" item when it's already on the gallery.
…om Evaluator menu in gallery Drop the gallery's dedicated "start from scratch" LLM/code routes and their inline quiet-button actions in favor of a single AddProjectEvaluatorMenu button, keeping one entry point for authoring an evaluator from scratch. Extract the template card markup into its own EvaluatorTemplateCard component and widen the card grid to make room for the new footer, adding scrollable regions so the category list and template grid scroll independently of the fixed add-menu button above them.
Use EvaluatorKindToken instead of a plain Badge in the evaluator template details panel so it matches the gallery card footer's pill shape and rounding. Also fix Token's line-height, which was hardcoded to the "S" scale for every size and only coincidentally matched the "M" box height — at "S" and "L" it overflowed the token's own height.
Double-clicking (or activating via keyboard) a selected template card now navigates to the customize flow, same as the "Customize this evaluator" button.
…odal The gallery's Add Custom Evaluator menu sent scratch LLM/code creation to routes nested under the plain evaluators list, so opening the modal swapped the underlying page and closing it dropped the user on the (possibly empty) table instead of back on the gallery. Nest scratch creation under the gallery route too, mirroring the existing template-based creation flow.
Rename "Browse the (whole) library" to "Browse eval gallery", "Copy existing" to "Duplicate existing", "Attach existing" to "Use existing", and rename the gallery detail fields "Scope"/"Output choices" to "Target"/"Annotation values".
Show the LLM evaluator template's prompt messages in the gallery details panel, truncated in a small well with the existing expand/collapse affordance. Pin the "Customize this evaluator" button to the bottom of the details column once its content scrolls.
Drop the redundant "Evaluators" title/PageHeader from the empty state header since the project tab already reads "Evaluators", replacing it with a compact toolbar-style treatment. Also keep the gallery promo visible beneath the table when a project has fewer than 15 evaluators, and add breathing room above the promo content.
Previously the prev/next arrows slid the visible window one card at a time. Step by CATEGORY_CARDS_PER_VIEW instead so the carousel cycles in whole groups.
…tack Drop the Recommended/All-evaluators quick-start filter and the category filtering it drove. Every use case now renders as its own titled, anchorable section in one scrollable stack, and the use-cases sidebar tracks scroll position via IntersectionObserver instead of filtering the visible cards.
c0c5c9c to
f4309fd
Compare
| page.getByRole("heading", { name: "Evaluators", exact: true }) | ||
| ).toBeVisible(); |
There was a problem hiding this comment.
This assertion is now unsatisfiable, so can create, edit, and delete a span LLM evaluator will fail here.
Decluttering the empty state removed the <PageHeader /> from the empty-state branch of ProjectEvaluatorsPage.tsx, replacing it with a plain <Text> blurb + AddProjectEvaluatorMenu:
phoenix/js/app/src/pages/project/evaluators/ProjectEvaluatorsPage.tsx
Lines 101 to 107 in f4309fd
PageHeader was the only thing rendering a role=heading node named exactly "Evaluators" on this route — it wraps a string title in <Heading level={1}>. Everything else named "Evaluators" here is a tab or a link, and ProjectEvaluatorsEmptyState renders no heading. The test creates a fresh project (asserted below to have 0 evaluators), so it hits exactly the branch whose header was removed.
The two sibling assertions in this block were updated for the "Browse eval gallery" rename — this one looks overlooked. Retargeting it at the new description text works (that string is unique in js/app/src):
| page.getByRole("heading", { name: "Evaluators", exact: true }) | |
| ).toBeVisible(); | |
| page.getByText("Evaluators read span inputs") | |
| ).toBeVisible(); |
* fix(evaluators): show only detailed gallery description * feat(evaluators): add metadata badges to gallery cards * feat(evaluators): support custom label, variant, and gallery-item visibility in AddProjectEvaluatorMenu Lets the gallery page reuse the same menu with a wider, differently labeled button and without the redundant "Browse the whole library" item when it's already on the gallery. * feat(evaluators): replace scratch-start actions with unified Add Custom Evaluator menu in gallery Drop the gallery's dedicated "start from scratch" LLM/code routes and their inline quiet-button actions in favor of a single AddProjectEvaluatorMenu button, keeping one entry point for authoring an evaluator from scratch. Extract the template card markup into its own EvaluatorTemplateCard component and widen the card grid to make room for the new footer, adding scrollable regions so the category list and template grid scroll independently of the fixed add-menu button above them. * feat(evaluators): add tooltip to gallery card evaluation-target badges * fix(ui): unify evaluator kind badge and fix Token line-height scaling Use EvaluatorKindToken instead of a plain Badge in the evaluator template details panel so it matches the gallery card footer's pill shape and rounding. Also fix Token's line-height, which was hardcoded to the "S" scale for every size and only coincidentally matched the "M" box height — at "S" and "L" it overflowed the token's own height. * feat(evaluators): double-click gallery template card to customize Double-clicking (or activating via keyboard) a selected template card now navigates to the customize flow, same as the "Customize this evaluator" button. * fix(ui): return to evaluator gallery after closing scratch-creation modal The gallery's Add Custom Evaluator menu sent scratch LLM/code creation to routes nested under the plain evaluators list, so opening the modal swapped the underlying page and closing it dropped the user on the (possibly empty) table instead of back on the gallery. Nest scratch creation under the gallery route too, mirroring the existing template-based creation flow. * fix(ui): clarify evaluator gallery and menu wording Rename "Browse the (whole) library" to "Browse eval gallery", "Copy existing" to "Duplicate existing", "Attach existing" to "Use existing", and rename the gallery detail fields "Scope"/"Output choices" to "Target"/"Annotation values". * feat(evaluators): add expandable prompt preview to gallery card details Show the LLM evaluator template's prompt messages in the gallery details panel, truncated in a small well with the existing expand/collapse affordance. Pin the "Customize this evaluator" button to the bottom of the details column once its content scrolls. * fix(ui): declutter evaluator empty state and surface gallery promo Drop the redundant "Evaluators" title/PageHeader from the empty state header since the project tab already reads "Evaluators", replacing it with a compact toolbar-style treatment. Also keep the gallery promo visible beneath the table when a project has fewer than 15 evaluators, and add breathing room above the promo content. * fix(ui): page evaluator gallery carousel by full groups Previously the prev/next arrows slid the visible window one card at a time. Step by CATEGORY_CARDS_PER_VIEW instead so the carousel cycles in whole groups. * fix(ui): flatten evaluator gallery into a single scrolling use-case stack Drop the Recommended/All-evaluators quick-start filter and the category filtering it drove. Every use case now renders as its own titled, anchorable section in one scrollable stack, and the use-cases sidebar tracks scroll position via IntersectionObserver instead of filtering the visible cards. * fix: preserve evaluator creation origin on cancel * fix: synchronize evaluator gallery deep links * fix: isolate evaluator carousel scrolling * fix(evaluators): improve gallery collection behavior --------- Co-authored-by: Yasmine Frigui <yfrigui@arize.com>
👾 AUTOMATED REPORT:
Stacked on #15686. Tweaks to the project evaluator gallery cards:
EvaluatorKindToken, and fixToken's line-height, which only coincidentally matched at the "M" size.AddProjectEvaluatorMenu— supporting a custom label, variant, and gallery-item visibility so the same menu works on both the plain table and the gallery — and nest scratch creation under the gallery route so closing the modal returns to the gallery instead of the plain table.