Skip to content

UI cleanup #416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2025
Merged

UI cleanup #416

merged 1 commit into from
Jul 10, 2025

Conversation

scosman
Copy link
Collaborator

@scosman scosman commented Jul 10, 2025

better strings and use fancy select for recommended tags and allow empty option group titles in fancy select

Summary by CodeRabbit

  • New Features

    • Upgraded dataset selection fields to use an enhanced dropdown component with improved labeling and badge indicators for recommendations or warnings.
    • Added clearer descriptions to form fields, including a note clarifying the purpose of the evaluator description.
  • Style

    • Improved vertical alignment and spacing in dropdown menus for a more polished appearance.
  • Bug Fixes

    • Dropdown group labels now display only when present, preventing empty label rows.

Copy link
Contributor

coderabbitai bot commented Jul 10, 2025

Walkthrough

The changes update the fancy_select dropdown component's UI logic, making group labels and padding conditional based on group data. The OptionGroup type now has an optional label. The dataset selection UI in the evaluator creation page is refactored to use the enhanced fancy_select with richer option objects and improved descriptions.

Changes

File(s) Change Summary
app/web_ui/src/lib/ui/fancy_select.svelte Dropdown group labels and padding are now conditionally rendered; option label/badge container uses flex centering.
app/web_ui/src/lib/ui/fancy_select_types.ts OptionGroup type's label property made optional.
app/web_ui/src/routes/(app)/evals/[project_id]/[task_id]/create_evaluator/+page.svelte Dataset selection UI switched to fancy_select; options now objects with labels/values/badges; descriptions updated.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EvaluatorPage
    participant FancySelect

    User->>EvaluatorPage: Opens evaluator creation page
    EvaluatorPage->>FancySelect: Renders dataset select with option objects
    User->>FancySelect: Interacts with dropdown
    FancySelect->>FancySelect: Conditionally renders group labels and padding
    User->>EvaluatorPage: Selects dataset
    EvaluatorPage->>EvaluatorPage: Updates dataset variables reactively
Loading

Possibly related PRs

  • Kiln-AI/Kiln#408: Adds badge support and flex structure to fancy_select options, which this PR builds upon by further refining label and layout rendering.

Poem

In dropdown fields where options grow,
A rabbit tweaks the space below.
Labels now appear with care,
Only when they're truly there.
With badges bright and flex aligned,
The fanciest selects you'll find!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0279f7c and fec280d.

📒 Files selected for processing (3)
  • app/web_ui/src/lib/ui/fancy_select.svelte (3 hunks)
  • app/web_ui/src/lib/ui/fancy_select_types.ts (1 hunks)
  • app/web_ui/src/routes/(app)/evals/[project_id]/[task_id]/create_evaluator/+page.svelte (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Web UI Code Format, Lint, Typecheck, Test, and Build
  • GitHub Check: Build Desktop Apps (macos-latest)
  • GitHub Check: Build Desktop Apps (ubuntu-22.04)
  • GitHub Check: Build Desktop Apps (windows-latest)
  • GitHub Check: Build Desktop Apps (macos-13)
  • GitHub Check: Build Desktop Apps (ubuntu-22.04-arm)
  • GitHub Check: Build, Typecheck, and Test Python (3.13)
  • GitHub Check: Build, Typecheck, and Test Python (3.10)
  • GitHub Check: Build, Typecheck, and Test Python (3.11)
  • GitHub Check: Build, Typecheck, and Test Python (3.12)
  • GitHub Check: Web UI Code Format, Lint, Typecheck, Test, and Build
🔇 Additional comments (10)
app/web_ui/src/lib/ui/fancy_select_types.ts (1)

2-2: LGTM! Clean type definition update.

Making the label property optional provides good flexibility for option groups without labels, which aligns well with the conditional rendering logic implemented in the component.

app/web_ui/src/lib/ui/fancy_select.svelte (4)

426-426: Good use of optional chaining for label detection.

The computed value properly handles cases where there are no groups or the first group has no label.


429-431: Clean conditional padding logic.

The padding is appropriately applied only when the first group has a label, improving the visual spacing of the dropdown.


500-504: Proper conditional label rendering.

The {#if option.label} check prevents rendering empty label elements when groups don't have labels, which keeps the DOM clean.


527-527: Good addition for visual alignment.

Adding items-center class properly centers the label and badge elements vertically within their container.

app/web_ui/src/routes/(app)/evals/[project_id]/[task_id]/create_evaluator/+page.svelte (5)

53-59: Clean reactive statements for auto-updating datasets.

The reactive logic properly updates the dataset variables when default tags change, with appropriate "tag::" prefixing. This provides a good user experience by automatically setting recommended values.


174-174: Improved field description clarity.

The simplified description is more concise and clear.


181-182: Good clarification about evaluator description usage.

The added info_description helpfully clarifies that this field is for reference only and not used as a prompt, preventing user confusion.


263-263: Excellent upgrade to fancy_select component.

The structured option objects with badges and proper labeling provide a much better user experience. The "Recommended" and "Not Recommended" badges help guide users toward best practices.

Also applies to: 266-289


315-315: Consistent fancy_select implementation.

The evaluation method dataset selection follows the same pattern as the evaluation dataset, providing consistency in the UI and similar helpful guidance through badges.

Also applies to: 317-340


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@scosman scosman merged commit 390d859 into main Jul 10, 2025
14 checks passed
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