Skip to content

Props UI#338

Merged
scosman merged 4 commits into
mainfrom
props_ui
Jun 2, 2025
Merged

Props UI#338
scosman merged 4 commits into
mainfrom
props_ui

Conversation

@scosman
Copy link
Copy Markdown
Collaborator

@scosman scosman commented Jun 2, 2025

New properties UI, and more links

Summary by CodeRabbit

  • New Features

    • Introduced a Property List component for displaying titled lists of properties with optional tooltips and links.
    • Enhanced dataset run and evaluation pages to use the new Property List component for clearer, more consistent property presentation.
  • Bug Fixes

    • Updated the display of repair status for runs with output but no rating to show "NA" instead of "Rating needed".
  • Tests

    • Adjusted tests to expect "NA" for repair status when appropriate.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2025

Walkthrough

A new PropertyList Svelte component is introduced to standardize the display of property lists with optional tooltips and links. Dataset run and evaluation pages are refactored to use this component for property rendering. Additionally, the server-side logic and tests for displaying repair status names are updated to return "NA" instead of "Rating needed" in specific cases.

Changes

File(s) Change Summary
app/web_ui/src/lib/ui/property_list.svelte Added new Svelte component for displaying titled property lists with tooltips and links.
app/web_ui/src/routes/(app)/dataset/[project_id]/[task_id]/[run_id]/run/+page.svelte Refactored to use PropertyList, modularized property extraction, and loaded model info.
app/web_ui/src/routes/(app)/evals/[project_id]/[task_id]/[eval_id]/+page.svelte Updated to use PropertyList for evaluator properties and adjusted function signature.
libs/server/kiln_server/run_api.py Changed repair status display logic to return "NA" instead of "Rating needed" in some cases.
libs/server/kiln_server/test_run_api.py Updated test to expect "NA" instead of "Rating needed" for repair status display.

Sequence Diagram(s)

sequenceDiagram
    participant Page as Dataset/Eval Page
    participant PropertyList as PropertyList Component
    participant InfoTooltip as InfoTooltip Component

    Page->>PropertyList: Passes title and properties array
    loop For each property
        PropertyList->>InfoTooltip: (Optional) Show tooltip for property name
        PropertyList-->>Page: Renders name and value (with link if provided)
    end
Loading

Poem

In the warren of code, a new list appears,
With tooltips and links, it now perseveres.
"NA" is the word for repairs not yet due,
While properties sparkle in columns of two.
A hop, a refactor—so tidy and neat,
This bunny declares: the update’s complete!
🐇✨


📜 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 990454f and 8e9ec31.

📒 Files selected for processing (5)
  • app/web_ui/src/lib/ui/property_list.svelte (1 hunks)
  • app/web_ui/src/routes/(app)/dataset/[project_id]/[task_id]/[run_id]/run/+page.svelte (5 hunks)
  • app/web_ui/src/routes/(app)/evals/[project_id]/[task_id]/[eval_id]/+page.svelte (3 hunks)
  • libs/server/kiln_server/run_api.py (1 hunks)
  • libs/server/kiln_server/test_run_api.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
libs/server/kiln_server/test_run_api.py (1)
libs/server/kiln_server/run_api.py (2)
  • RunSummary (66-130)
  • repair_status_display_name (86-107)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build Desktop Apps (macos-13)
🔇 Additional comments (16)
libs/server/kiln_server/run_api.py (1)

89-91: Good improvement to business logic clarity.

The change from "Rating needed" to "NA" with the explanatory comment makes the repair workflow clearer. It's more accurate to indicate "NA" when no rating exists yet, since repair is only requested when a rating exists and is below 5 stars.

libs/server/kiln_server/test_run_api.py (1)

710-710: Correct test update to match API changes.

The test assertion correctly reflects the updated business logic from the corresponding change in libs/server/kiln_server/run_api.py.

app/web_ui/src/lib/ui/property_list.svelte (2)

4-9: Well-defined TypeScript interface.

The UiProperty type definition clearly specifies the expected structure with appropriate optional fields for tooltip and link functionality.


15-32: Excellent reusable component design.

The component demonstrates several good practices:

  • Clean grid layout with responsive text sizing
  • Safe iteration with properties || [] null handling
  • Conditional rendering for optional tooltip and link features
  • Proper semantic HTML structure
  • Consistent styling with Tailwind CSS classes

This modular approach will improve maintainability across the application.

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

111-111: Good improvement to null safety.

The function signature change to accept Eval | null and the early return when evaluator is null improves type safety and prevents potential runtime errors.

Also applies to: 116-118


558-566: Excellent refactoring to use the reusable component.

The replacement of manual property rendering with the PropertyList component improves:

  • Code consistency across the application
  • Maintainability by centralizing property display logic
  • DRY principle adherence

The direct function call in the component props is clean and efficient.

app/web_ui/src/routes/(app)/dataset/[project_id]/[task_id]/[run_id]/run/+page.svelte (10)

10-10: LGTM: Clean import additions for the refactor.

The new imports properly support the refactoring from reactive properties to a function-based approach with the reusable PropertyList component.

Also applies to: 22-24


37-49: LGTM: Good defensive programming with optional chaining.

The function signature is well-typed and the ID property extraction properly handles potential null values.


51-58: LGTM: Proper string capitalization logic.

The input source type formatting correctly capitalizes the first letter while preserving the rest of the string.


60-66: LGTM: Clean model information extraction.

The code properly extracts the model ID and uses the utility function to get the display name.


93-105: LGTM: Proper numeric formatting for cost and tokens.

The cost is formatted to 6 decimal places which is appropriate for financial precision, and tokens are displayed as-is.


107-119: LGTM: Standard property extraction with date formatting.

The creator and creation date extraction follows the same pattern as other properties with proper date formatting.


131-138: LGTM: Clean topic path formatting and function return.

The topic path processing maintains consistency with the existing logic and the function properly returns the built properties array.


143-143: LGTM: Proper model info loading.

Adding the load_model_info() call ensures model information is available for the property display.


264-269: LGTM: Clean component integration with proper data binding.

The PropertyList component is properly integrated with reactive data binding, passing the computed properties and a clear title.


75-91:

Details

✅ Verification successful

Verify the prompt link generation handles edge cases.

The prompt extraction logic looks correct, but ensure the prompt_link utility properly handles the case where parameters might be undefined.


🏁 Script executed:

#!/bin/bash
# Description: Verify the prompt_link utility function handles edge cases properly
# Expected: Function should handle undefined/null parameters gracefully

# Search for the prompt_link implementation
ast-grep --pattern 'export function prompt_link($$$) {
  $$$
}'

# Also search for any parameter validation in the function
rg -A 10 "function prompt_link|const prompt_link"

Length of output: 934


No changes needed for prompt_link edge‐case handling

The prompt_link function in app/web_ui/src/lib/utils/link_builder.ts already checks for missing or empty project_id, task_id, or prompt_id and returns undefined when any are falsy:

  • It guards with
    if (!project_id || !task_id || !prompt_id) return undefined;

This satisfies the requirement to handle undefined/null parameters gracefully.


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 01fc831 into main Jun 2, 2025
14 checks passed
@scosman scosman deleted the props_ui branch June 2, 2025 03:12
@coderabbitai coderabbitai Bot mentioned this pull request Nov 13, 2025
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