Skip to content

[ui] Update Create Optimized Prompt screen UI feedback#1043

Closed
sfierro wants to merge 4 commits into
sfierro/optimize-featurefrom
sfierro/KIL-416-optimize-ui-feedback
Closed

[ui] Update Create Optimized Prompt screen UI feedback#1043
sfierro wants to merge 4 commits into
sfierro/optimize-featurefrom
sfierro/KIL-416-optimize-ui-feedback

Conversation

@sfierro

@sfierro sfierro commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Closes KIL-416

Description

This PR updates the "Create Optimized Prompt" screen UI based on feedback:

Changes:

  1. Subtitle: Fixed grammar and updated text from "Create a prompt optimized for your evals using training data." to "Automatically optimize your prompt, maximizing its quality using evals."

  2. Step 1 - Select Run Configuration:

    • Changed title to "Step 1: Select Target Run Configuration"
    • Updated subtitle to explain model-specific optimization
    • Added comprehensive info tooltip about target model and starting prompt
  3. Prompt Section:

    • Changed headers from "Run Configuration Prompt" to "Prompt" and "Run Configuration Details" to "Details"
    • Updated description text to "Will be used as the starting point for optimization."
    • Fixed font weight to match subtitle (font-medium)
  4. Step 2 - Select Optimization Evals:

    • Changed title to "Step 2: Select Optimization Evals"
    • Updated subtitle to "Your prompt will be optimized to maximize performance across these evals."
    • Added info tooltip about optimizer, evals, training data with docs link
  5. Removed Warning: Removed "Some evaluators are not selected. Your prompt will not be optimized for these evaluators." warning

  6. No Evaluators Selected: Changed from red text to nicer Warning UI (red icon, grey text)

  7. Eval Row Behavior:

    • Added "View Eval" button in rightmost column
    • Removed row click behavior that opened eval URL (now only checkbox toggles)

Summary by CodeRabbit

  • New Features

    • Added wrapper mode for tooltip component enabling flexible placement.
    • Added per-row dropdown actions for evaluator rows (View Eval).
    • Enhanced evaluator status badges with detailed readiness tooltips.
  • Improvements

    • Refined UI labels, subtitles and helper text across the optimization workflow.
    • Improved table selection, row/checkbox interaction and dataset link handling.
    • Updated prompt/run-configuration wording, output sizing, and clearer missing-evaluators error messaging.

@coderabbitai

coderabbitai Bot commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a filesystem entry file and enhances two UI components: InfoTooltip gains a wrapper rendering mode and improved newline/spacing handling; the prompt optimization job creation page receives numerous UI and interaction refinements for run configurations and evaluator selection.

Changes

Cohort / File(s) Summary
Config / Misc
/.claude
Adds a single-line filesystem entry referencing a local path.
UI Component
app/web_ui/src/lib/ui/info_tooltip.svelte
Introduces wrapper export to enable wrapper-mode rendering (accepts button or div), reworks render path to support wrapped content, and improves newline splitting and empty-line spacing in tooltip content.
Prompt Optimization Page
app/web_ui/src/routes/(app)/prompt_optimization/[project_id]/[task_id]/create_prompt_optimization_job/+page.svelte
Multiple UX updates: renamed labels/sections, expanded InfoTooltip copy, changed step headings, added max_height to Output, added per-eval action dropdown (TableButton), converted row click to toggle evaluator selection, adjusted checkbox propagation, replaced static "Not Ready" with dynamic readiness badge + tooltip, and improved dataset link handling and error messaging.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Fix our tooltip! #630: Modifies app/web_ui/src/lib/ui/info_tooltip.svelte with related tooltip rendering and newline handling adjustments.

Suggested reviewers

  • scosman
  • leonardmq

Poem

🐇 I stitched a tooltip, soft and neat,

wrapping words where users meet.
Optimizer fields now hum and play,
evaluators chosen, clear as day.
Hop, click, refine — let's ship away! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: UI updates to the Create Optimized Prompt screen based on feedback, which aligns with the substantial UI modifications across multiple components.
Description check ✅ Passed The description provides a comprehensive breakdown of all major changes with clear sections and links the issue (Closes KIL-416), but is missing the required CLA confirmation and test checklists from the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sfierro/KIL-416-optimize-ui-feedback

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@sfierro sfierro changed the base branch from main to sfierro/optimize-feature February 17, 2026 21:45
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @sfierro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a significant new 'Prompt Optimization' capability, enabling automated prompt refinement through a dedicated workflow. It consolidates related AI-driven features under a new 'Optimize' navigation entry, enhancing user experience by providing clearer guidance and streamlined access to advanced functionalities. The changes span across backend API definitions, datamodels, and extensive frontend UI updates to support the new feature and improve existing components like model browsing and run configuration management.

Highlights

  • Prompt Optimization Feature: Introduced a new 'Prompt Optimization' feature, allowing users to automatically optimize prompts based on training data and evaluations. This includes new API endpoints for managing optimization jobs, checking model support, and handling job results.
  • UI/UX Enhancements for Prompt Optimization: Revamped the 'Create Optimized Prompt' screen UI based on feedback, including updated titles, subtitles, info tooltips, and improved warning displays. A new top-level 'Optimize' navigation section has been added to consolidate related features.
  • API Client and Datamodel Refactoring: Renamed all 'GEPA job' related API clients and datamodels to 'Prompt Optimization job' for clarity and consistency. New datamodels for PromptOptimizationJob and related API response/request bodies were added.
  • Entitlement and Copilot Integration: Implemented API endpoints and UI components to check user entitlements and Kiln Copilot availability for accessing advanced features like Prompt Optimization.
  • Run Configuration and Eval Updates: Added new API endpoints for updating run configuration metadata (name, starred status, prompt name) and eval details (name, description, train set filter ID). Run configurations now support a 'starred' status.
  • Deprecated Task Requirements: Task requirements have been deprecated in the UI and moved to a collapsible 'Advanced Options' section, with a recommendation to migrate to Specs & Evals and Prompts.
  • Improved Model Browsing: The models page was enhanced with pricing information, a 'Try' button for quick testing, and improved filtering capabilities including a 'Featured' section.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • app/desktop/desktop_server.py
    • Integrated the prompt optimization job API into the desktop server.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/api/auth/check_entitlements_v1_check_entitlements_get.py
    • Added a new API client for checking user entitlements.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/api/jobs/check_prompt_optimization_model_supported_v1_jobs_prompt_optimization_job_check_model_supported_get.py
    • Renamed GEPA job model support check API client to prompt optimization model support check.
    • Updated API endpoint URL and docstrings to reflect the renaming.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/api/jobs/get_prompt_optimization_job_result_v1_jobs_prompt_optimization_job_job_id_result_get.py
    • Renamed GEPA job result API client to prompt optimization job result.
    • Updated model imports and docstrings to reflect the renaming.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/api/jobs/start_prompt_optimization_job_v1_jobs_prompt_optimization_job_start_post.py
    • Renamed GEPA job start API client to prompt optimization job start.
    • Updated model imports, removed the 'token_budget' field, and added 'eval_ids' to the request body.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/models/init.py
    • Updated model imports to reflect API client renames and the new entitlement model.
    • Removed old GEPA-related models (BodyStartGepaJobV1JobsGepaJobStartPostTokenBudget, GEPAJobOutput, GEPAJobResultResponse).
    • Added new prompt optimization related models (PromptOptimizationJobOutput, PromptOptimizationJobResultResponse).
  • app/desktop/studio_server/api_client/kiln_ai_server_client/models/body_start_gepa_job_v1_jobs_gepa_job_start_post_token_budget.py
    • Removed the token budget enum for GEPA jobs.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/models/body_start_prompt_optimization_job_v1_jobs_prompt_optimization_job_start_post.py
    • Renamed the request body model for starting prompt optimization jobs.
    • Removed the 'token_budget' field and added 'eval_ids'.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/models/check_entitlements_v1_check_entitlements_get_response_check_entitlements_v1_check_entitlements_get.py
    • Added a new response model for checking entitlements.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/models/prompt_optimization_job_output.py
    • Renamed GEPA job output model to prompt optimization job output.
    • Updated the model's docstring.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/models/prompt_optimization_job_result_response.py
    • Renamed GEPA job result response model to prompt optimization job result response.
    • Updated the model's docstring and internal model references.
  • app/desktop/studio_server/copilot_api.py
    • Refactored API response error handling to use a new unwrap_response utility.
    • Removed direct HTTPValidationError checks and check_response_error usage.
  • app/desktop/studio_server/eval_api.py
    • Introduced UpdateRunConfigRequest and UpdateEvalRequest models for partial updates.
    • Added train_dataset_size to the EvalProgress model.
    • Implemented new PATCH API endpoints for updating evals and run configurations.
    • Updated get_eval_progress to calculate and include train_dataset_size.
  • app/desktop/studio_server/prompt_optimization_job_api.py
    • Implemented a comprehensive API for managing prompt optimization jobs.
    • Added endpoints for checking run config and eval validity, starting new jobs, listing jobs, and retrieving job status and results.
    • Included logic for creating prompt and run config artifacts upon successful job completion.
  • app/desktop/studio_server/settings_api.py
    • Added a new API endpoint GET /api/check_entitlements for verifying user entitlements.
  • app/desktop/studio_server/test_eval_api.py
    • Added extensive unit tests for the new run configuration update endpoints, covering starred status and prompt name changes.
    • Added comprehensive unit tests for the new eval update endpoints, including name, description, and train set filter ID modifications.
  • app/desktop/studio_server/test_settings_api.py
    • Added unit tests for the new check_entitlements API endpoint, covering various feature code checks and error scenarios.
  • app/desktop/studio_server/utils/copilot_utils.py
    • Refactored Copilot utility functions to use the new unwrap_response for standardized error handling.
  • app/desktop/studio_server/utils/response_utils.py
    • Introduced a new utility module for consistent API response error checking and unwrapping.
  • app/desktop/studio_server/utils/test_response_utils.py
    • Added unit tests for the new API response utility functions (check_response_error, unwrap_response_allow_none, unwrap_response).
  • app/web_ui/src/lib/api_schema.d.ts
    • Updated the API schema to include new paths and components for entitlements, prompt optimization jobs, and updates to evals and run configurations.
    • Added generator_id to PromptCreateRequest and starred to TaskRunConfig.
    • Included train_dataset_size in EvalProgress and marked Task requirements as deprecated.
  • app/web_ui/src/lib/stores/run_configs_store.ts
    • Updated save_new_task_run_config to accept a name parameter.
  • app/web_ui/src/lib/types.ts
    • Added new TypeScript types for PublicPromptOptimizationJobStatusResponse, PromptOptimizationJob, and JobStatus.
  • app/web_ui/src/lib/ui/banner.svelte
    • Created a new reusable Svelte component for displaying banners.
  • app/web_ui/src/lib/ui/carousel_section.svelte
    • Enhanced the carousel section component with min_width, min_height props, logic for disabled items (with dialog and docs link), and a 'recommended' badge.
  • app/web_ui/src/lib/ui/completed.svelte
    • Refactored the Completed component to utilize the Intro component for improved consistency.
  • app/web_ui/src/lib/ui/edit_dialog.svelte
    • Added a close function to the edit dialog component.
  • app/web_ui/src/lib/ui/feature_carousel.svelte
    • Improved the feature carousel with responsive grid layout logic and the ability to display metrics for each feature.
  • app/web_ui/src/lib/ui/feature_carousel_types.ts
    • Updated feature carousel types to support optional subtitles and a metrics property.
  • app/web_ui/src/lib/ui/icons/optimize_icon.svelte
    • Added a new Svelte icon component for optimization.
  • app/web_ui/src/lib/ui/icons/star_icon.svelte
    • Added a new Svelte icon component for starring items.
  • app/web_ui/src/lib/ui/kiln_copilot/copilot_auth_page.svelte
    • Created a new reusable Svelte component for Kiln Copilot authentication.
  • app/web_ui/src/lib/ui/kiln_copilot/copilot_required_card.svelte
    • Created a new Svelte component for displaying a 'Kiln Copilot Required' message.
  • app/web_ui/src/lib/ui/kiln_copilot/entitlement_required_card.svelte
    • Created a new Svelte component for displaying an 'Entitlement Required' message.
  • app/web_ui/src/lib/ui/kiln_section_types.ts
    • Extended kiln section types to include PromptGeneratorItem and updated CarouselSectionItem to support it.
  • app/web_ui/src/lib/ui/run_config_component/create_new_run_config_dialog.svelte
    • Enhanced the run config creation dialog with hide_tools_selector and model props, and implemented 'create' and 'clone' modes.
  • app/web_ui/src/lib/ui/run_config_component/run_config_component.svelte
    • Updated the run config component to include run_config_name and show_name_field props, and to pass the name during creation.
  • app/web_ui/src/lib/ui/run_config_component/run_config_details_dialog.svelte
    • Removed the dedicated run config details dialog.
  • app/web_ui/src/lib/ui/run_config_component/run_config_summary.svelte
    • Refactored the run config summary component to be a clickable navigation item that opens a dedicated run config page, replacing the old details dialog.
  • app/web_ui/src/lib/ui/settings_header.svelte
    • Added an optional subtitle prop to the settings header component.
  • app/web_ui/src/lib/ui/warning.svelte
    • Modified the warning component to allow custom content via slots.
  • app/web_ui/src/lib/utils/copilot_utils.ts
    • Created a new utility function checkKilnCopilotAvailable to check if Kiln Copilot is connected.
  • app/web_ui/src/lib/utils/entitlement_utils.ts
    • Created new utility functions checkEntitlements and checkPromptOptimizationAccess for verifying user entitlements.
  • app/web_ui/src/lib/utils/form_list.svelte
    • Added a hide_add_button prop to the form list component.
  • app/web_ui/src/lib/utils/link_builder.test.ts
    • Updated link builder tests to reflect changes in prompt ID handling, removing tests for non-ID style generator prompts.
  • app/web_ui/src/lib/utils/link_builder.ts
    • Simplified the link builder by removing logic for non-ID style generator prompts.
  • app/web_ui/src/lib/utils/name_generator.ts
    • Created a new utility function generate_memorable_name for generating random, memorable names.
  • app/web_ui/src/routes/(app)/+layout.svelte
    • Introduced a new 'Optimize' section in the main navigation sidebar.
    • Added nested links under 'Optimize' for Prompts, Models, Fine Tune, and Docs & Search.
    • Adjusted nested menu styling for better presentation.
  • app/web_ui/src/routes/(app)/docs/[project_id]/+page.svelte
    • Updated the docs page to include task_id and breadcrumbs for the new 'Optimize' section.
  • app/web_ui/src/routes/(app)/fine_tune/[project_id]/[task_id]/+page.svelte
    • Updated the fine-tune page with breadcrumbs for the new 'Optimize' section.
  • app/web_ui/src/routes/(app)/models/+page.svelte
    • Overhauled the models page to include model pricing information, a 'Try' button for quick testing, and enhanced filtering (including a 'Featured' category).
    • Integrated run config creation and provider connection dialogs for a more seamless workflow.
    • Added breadcrumbs for the new 'Optimize' section.
  • app/web_ui/src/routes/(app)/models/price.ts
    • Created a new module for fetching and managing model pricing data.
  • app/web_ui/src/routes/(app)/optimize/[project_id]/[task_id]/+page.svelte
    • Implemented the main 'Optimize' dashboard page, featuring a carousel of optimization strategies and a sortable table for managing run configurations.
    • Added functionality to select multiple run configurations for comparison.
  • app/web_ui/src/routes/(app)/optimize/[project_id]/[task_id]/+page.ts
    • Added prerender setting for the optimize page.
  • app/web_ui/src/routes/(app)/optimize/[project_id]/[task_id]/optimizers.ts
    • Defined various optimization strategies with their titles, descriptions, metrics, and associated actions.
  • app/web_ui/src/routes/(app)/optimize/[project_id]/[task_id]/run_config/[run_config_id]/+page.svelte
    • Created a dedicated page for viewing and editing the details of a specific run configuration.
  • app/web_ui/src/routes/(app)/optimize/[project_id]/[task_id]/run_config/[run_config_id]/+page.ts
    • Added prerender setting for the run config details page.
  • app/web_ui/src/routes/(app)/optimize/[project_id]/[task_id]/run_config/create/+page.svelte
    • Implemented a page for creating new run configurations, supporting pre-population of model or prompt information from URL parameters.
  • app/web_ui/src/routes/(app)/optimize/[project_id]/[task_id]/run_config/create/+page.ts
    • Added prerender setting for the create run config page.
  • app/web_ui/src/routes/(app)/prompt_optimization/[project_id]/[task_id]/+page.svelte
    • Created a new page to list and manage prompt optimization jobs.
    • Integrated Kiln Copilot and entitlement checks to gate access to the feature.
    • Includes UI for starting new optimization jobs and displaying job status.
  • app/web_ui/src/routes/(app)/prompt_optimization/[project_id]/[task_id]/+page.ts
    • Added prerender setting for the prompt optimization jobs list page.
  • app/web_ui/src/routes/(app)/prompt_optimization/[project_id]/[task_id]/create_prompt_optimization_job/+page.svelte
    • Implemented a wizard-like page for creating new prompt optimization jobs.
    • Guides the user through selecting a target run configuration and optimization evals, with real-time validation and error feedback.
  • app/web_ui/src/routes/(app)/prompt_optimization/[project_id]/[task_id]/create_prompt_optimization_job/+page.ts
    • Added prerender setting for the create prompt optimization job page.
  • app/web_ui/src/routes/(app)/prompt_optimization/[project_id]/[task_id]/prompt_optimization_job/[job_id]/+page.svelte
    • Created a detailed view page for individual prompt optimization jobs.
    • Displays the optimized prompt, job properties, and includes polling for status updates.
  • app/web_ui/src/routes/(app)/prompt_optimization/[project_id]/[task_id]/prompt_optimization_job/[job_id]/+page.ts
    • Added prerender setting for the prompt optimization job details page.
  • app/web_ui/src/routes/(app)/prompt_optimization/copilot_auth/+page.svelte
    • Created a Copilot authentication page tailored for the prompt optimization workflow.
  • app/web_ui/src/routes/(app)/prompt_optimization/copilot_auth/+page.ts
    • Added SSR setting for the Copilot authentication page.
  • app/web_ui/src/routes/(app)/prompts/[project_id]/[task_id]/+page.svelte
    • Revamped the prompts listing page to integrate with the new 'Optimize' workflow.
    • Introduced a banner for automatic prompt optimization and a clickable section for the 'Base Task Prompt'.
    • Enhanced the prompt table with sorting, a 'Type' column, and new dropdown actions (Create Run Configuration, Set as Base Prompt).
  • app/web_ui/src/routes/(app)/prompts/[project_id]/[task_id]/create/+page.svelte
    • Adapted the create prompt page to support prompt generators, including pre-filling content and handling redirects for optimization workflows.
    • Updated prompt name field to use generate_memorable_name and increased max length.
  • app/web_ui/src/routes/(app)/prompts/[project_id]/[task_id]/edit_base_prompt/+page.svelte
    • Created a dedicated page for editing the task's base prompt and thinking instructions.
  • app/web_ui/src/routes/(app)/prompts/[project_id]/[task_id]/edit_base_prompt/+page.ts
    • Added prerender setting for the edit base prompt page.
  • app/web_ui/src/routes/(app)/prompts/[project_id]/[task_id]/generator_details/[generator_id]/+page.svelte
    • Removed the dedicated generator details page.
  • app/web_ui/src/routes/(app)/prompts/[project_id]/[task_id]/prompt_generators/+page.svelte
    • Implemented a new page for selecting prompt generator templates, with dynamic disabling based on data availability (rated data, repairs).
  • app/web_ui/src/routes/(app)/prompts/[project_id]/[task_id]/prompt_generators/+page.ts
    • Added prerender setting for the prompt generators page.
  • app/web_ui/src/routes/(app)/prompts/[project_id]/[task_id]/prompt_generators/prompt_generators.ts
    • Defined prompt generator categories and templates, including a new 'Automatic Optimization' category.
    • Added a getPromptType utility function.
  • app/web_ui/src/routes/(app)/prompts/[project_id]/[task_id]/saved/[prompt_id]/+page.svelte
    • Adjusted the saved prompt details page to align with the new 'Optimize' navigation.
    • Updated prompt properties to include 'Type' and removed 'Chain of Thought' and 'Source Generator' fields.
    • Updated edit dialog fields for consistency.
  • app/web_ui/src/routes/(app)/run/+page.svelte
    • Updated the run page to support pre-filling the model from URL query parameters.
    • Added functionality to hide the run config name field when appropriate.
  • app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/+page.svelte
    • Refactored the specs page to use the new Banner component for the 'Compare Run Configurations' link.
  • app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/[spec_id]/+page.svelte
    • Added a max_length constraint to the spec name field in the edit dialog.
  • app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/[spec_id]/[eval_id]/+page.svelte
    • Updated the eval details page to display train_dataset_size in the properties list.
    • Added a max_length constraint to the eval name field in the edit dialog.
  • app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/compare/+page.svelte
    • Updated the compare page to dynamically adjust breadcrumbs based on the 'from' query parameter, supporting navigation from the new 'Optimize' section.
  • app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/spec_builder/+page.svelte
    • Removed checkKilnCopilotAvailable import from spec builder, now using a centralized utility.
  • app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/spec_utils.ts
    • Removed the checkKilnCopilotAvailable function, as it has been moved to a new utility module.
  • app/web_ui/src/routes/(app)/specs/copilot_auth/+page.svelte
    • Refactored the Copilot authentication page for specs to use a generic CopilotAuthPage component.
  • app/web_ui/src/routes/(fullscreen)/setup/(setup)/create_task/edit_task.svelte
    • Deprecated task requirements by wrapping them in a collapsible 'Advanced Options' section with a warning badge.
    • Updated the prompt description for requirements and added a hide_add_button prop to the FormList for requirements.
  • libs/core/kiln_ai/adapters/prompt_builders.py
    • Removed the ShortPromptBuilder class and its associated logic.
    • Adjusted formatting to add an extra newline before '# Thinking Instructions' in generated prompts.
  • libs/core/kiln_ai/adapters/test_prompt_builders.py
    • Removed tests related to the ShortPromptBuilder.
  • libs/core/kiln_ai/cli/commands/package_project.py
    • Introduced new functions validate_tasks_noncli and validate_and_build_prompts_noncli for non-CLI validation scenarios.
    • Added a PackageForTrainingConfig dataclass and helper functions (_ignore_eval_config_runs, export_evals, export_documents, export_task_runs, _get_run_config_by_id) to support a new package_project_for_training function.
    • The package_project_for_training function provides granular control over included project components for training purposes.
  • libs/core/kiln_ai/cli/commands/test_package_project.py
    • Added extensive unit tests for the new non-CLI validation functions (TestValidateTasksNoncli, TestValidateAndBuildPromptsNoncli).
    • Introduced a temp_project_with_evals fixture and new test classes (TestExportEvals, TestExportDocuments, TestPackageProjectForTraining, TestPackageProjectForTrainingNoncli, TestExportTaskRuns) to cover the new project packaging and export functionalities.
  • libs/core/kiln_ai/datamodel/init.py
    • Exposed the new PromptOptimizationJob datamodel in the kiln_ai.datamodel package.
  • libs/core/kiln_ai/datamodel/datamodel_enums.py
    • Clarified the docstring for the Priority enum.
  • libs/core/kiln_ai/datamodel/eval.py
    • Implemented a migrate_train_set_filter_id model validator to automatically create a train_set_filter_id for legacy evals upon loading.
  • libs/core/kiln_ai/datamodel/prompt_id.py
    • Removed the SHORT prompt generator from the PromptGenerators enum.
  • libs/core/kiln_ai/datamodel/prompt_optimization_job.py
    • Created a new datamodel PromptOptimizationJob to represent prompt optimization jobs, including fields for job ID, target run config, status, optimized prompt, and created artifacts.
  • libs/core/kiln_ai/datamodel/task.py
    • Added a starred boolean field to TaskRunConfig to indicate user favoriting.
    • Integrated PromptOptimizationJob as a child model of Task and added a corresponding prompt_optimization_jobs method.
    • Updated the requirements field description to mark it as deprecated.
  • libs/core/kiln_ai/datamodel/test_eval_model.py
    • Added new test cases for the train_set_filter_id migration logic in eval models, covering automatic creation, preservation of existing IDs, and slugification.
  • libs/core/kiln_ai/datamodel/test_prompt_optimization_job.py
    • Implemented comprehensive unit tests for the PromptOptimizationJob datamodel, covering creation, parent task relationship, result handling, eval ID tracking, and save/load functionality.
  • libs/core/kiln_ai/datamodel/test_task.py
    • Added new test cases for the prompt_optimization_jobs relationship within Task models, verifying creation and readonly access.
  • libs/server/kiln_server/prompt_api.py
    • Enhanced prompt creation by adding a generator_id field to PromptCreateRequest and updating the create_prompt endpoint to utilize it.
    • Improved prompt listing by including created_at for ApiPrompt.
    • Refined the update_prompt logic to return ApiPrompt and correctly handle id:: prefixes.
    • Removed the short_prompt_builder from available prompt generators and updated descriptions for other chain-of-thought generators.
  • libs/server/kiln_server/test_prompt_api.py
    • Updated the test case for unsupported prompt types in the prompt update API to reflect changes in prompt ID handling.
Activity
  • The pull request description outlines 7 specific UI feedback changes that have been addressed in the UI components, such as updated text, titles, tooltips, and warning displays on the 'Create Optimized Prompt' screen.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively updates the UI for the "Create Optimized Prompt" screen based on user feedback, improving clarity and usability. The changes to subtitles, tooltips, and warning messages are well-implemented. I've provided a few suggestions to enhance security and maintainability by addressing a missing rel attribute on a link, replacing an inline style with a Tailwind class, and recommending a file be added to .gitignore.

- Add wrapper mode to InfoTooltip for custom content
- Remove gray styling from unselected rows
- Enable row selection by clicking anywhere in the row
- Replace "View Eval" button with TableButton dropdown
- Replace inline error displays with tooltip on "Not Ready" badge
- Fix eval_configs link to include spec_id and eval_id
- Add proper error messages with links to relevant pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Feb 17, 2026

Copy link
Copy Markdown

📊 Coverage Report

Overall Coverage: 91%

Diff: origin/sfierro/optimize-feature...HEAD

No lines with coverage information in this diff.


@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
app/web_ui/src/routes/(app)/prompt_optimization/[project_id]/[task_id]/create_prompt_optimization_job/+page.svelte (2)

997-1032: Row on:click and checkbox on:change both fire on checkbox click — two redundant reactive updates.

When a checkbox is clicked, the <tr>'s on:click fires (using is_selected to toggle) and then the checkbox's on:change fires (using e.currentTarget.checked to set). The final state is correct in all cases, but selected_eval_ids is reassigned twice per checkbox click. Adding on:click|stopPropagation to the checkbox <td> eliminates the redundant update and makes the intent clearer.

♻️ Proposed refactor
- <td>
+ <td on:click|stopPropagation>
    <input
      type="checkbox"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/web_ui/src/routes/`(app)/prompt_optimization/[project_id]/[task_id]/create_prompt_optimization_job/+page.svelte
around lines 997 - 1032, The table row and the checkbox both update
selected_eval_ids when the checkbox is clicked, causing two reactive updates;
stop the row's on:click from firing when interacting with the checkbox by adding
Svelte event modifier stopPropagation to the checkbox container (e.g., add
on:click|stopPropagation on the <td> that wraps the <input> or directly on the
<input>), so clicks on the checkbox only trigger the checkbox's on:change
handler and not the <tr> on:click; keep existing logic that checks evalItem.id
and validation_status and only modify event propagation.

1139-1156: {#if eval_url} guard is always true; consider guarding on evalItem.id instead.

eval_url is constructed as a template literal with spec_id = "legacy" (always set), so it's always a non-empty truthy string even when evalItem.id is undefined (it would produce .../legacy/undefined). The meaningful guard is evalItem.id:

♻️ Proposed fix
- {`#if` eval_url}
+ {`#if` evalItem.id}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/web_ui/src/routes/`(app)/prompt_optimization/[project_id]/[task_id]/create_prompt_optimization_job/+page.svelte
around lines 1139 - 1156, The current {`#if` eval_url} check is always truthy
because eval_url is built with a static spec_id and can contain "undefined";
change the conditional to check the real identifier (e.g., {`#if` evalItem?.id} or
{`#if` evalItem && evalItem.id}) so the dropdown (around TableButton and the <ul>
anchor) only renders when evalItem.id exists, and ensure any construction of
eval_url happens only when evalItem.id is present (compute eval_url lazily or
inside that guarded block).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude:
- Line 1: Remove the accidentally committed local Claude config file named
".claude" from the repo and prevent it from being re-added: delete the file from
the repository history/working tree (e.g., git rm or remove and commit) and add
an entry for ".claude" to .gitignore so the local path /Users/samfierro/.claude
is not tracked in future commits; include a short commit message like "Remove
local Claude config and add to .gitignore" and ensure the removal is pushed.

In `@app/web_ui/src/lib/ui/info_tooltip.svelte`:
- Around line 118-131: The wrapper-mode trigger div incorrectly has
role="tooltip" and is not keyboard-focusable; remove the role attribute from the
trigger (leave role="tooltip" on the floating popup element), make the trigger
focusable by adding tabindex="0" to the div bound to triggerElement, and wire an
accessible relationship by adding aria-describedby referencing the tooltip
element's id (assign an id to the popup div and set aria-describedby on the
trigger once IDs are available); keep existing handlers showTooltip/hideTooltip
and focus/blur logic.

In
`@app/web_ui/src/routes/`(app)/prompt_optimization/[project_id]/[task_id]/create_prompt_optimization_job/+page.svelte:
- Around line 1089-1121: The tooltip can render "undefined" because
tagFromFilterId("") returns undefined so train_tag is falsy and dataset_add_link
becomes undefined; update the logic around tagFromFilterId, train_tag,
dataset_add_link, tooltip_parts and combined_tooltip so the training-set message
is only added when train_tag is truthy: compute train_tag =
tagFromFilterId(evalItem.train_set_filter_id || "") and dataset_add_link only if
train_tag; in tooltip_parts push the training message only when train_error
indicates missing training data AND train_tag is defined (use a conditional that
references train_tag), and when inserting the tag or link interpolate only the
confirmed train_tag/dataset_add_link values to avoid rendering 'undefined'.

---

Nitpick comments:
In
`@app/web_ui/src/routes/`(app)/prompt_optimization/[project_id]/[task_id]/create_prompt_optimization_job/+page.svelte:
- Around line 997-1032: The table row and the checkbox both update
selected_eval_ids when the checkbox is clicked, causing two reactive updates;
stop the row's on:click from firing when interacting with the checkbox by adding
Svelte event modifier stopPropagation to the checkbox container (e.g., add
on:click|stopPropagation on the <td> that wraps the <input> or directly on the
<input>), so clicks on the checkbox only trigger the checkbox's on:change
handler and not the <tr> on:click; keep existing logic that checks evalItem.id
and validation_status and only modify event propagation.
- Around line 1139-1156: The current {`#if` eval_url} check is always truthy
because eval_url is built with a static spec_id and can contain "undefined";
change the conditional to check the real identifier (e.g., {`#if` evalItem?.id} or
{`#if` evalItem && evalItem.id}) so the dropdown (around TableButton and the <ul>
anchor) only renders when evalItem.id exists, and ensure any construction of
eval_url happens only when evalItem.id is present (compute eval_url lazily or
inside that guarded block).

Comment thread .claude
@@ -0,0 +1 @@
/Users/samfierro/.claude No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Remove accidentally committed local Claude config file.

This file contains /Users/samfierro/.claude — a local developer machine path that appears to be Claude AI's local settings/memory file. It has no place in the repository and leaks filesystem layout.

Add it to .gitignore and remove it from the tree.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude at line 1, Remove the accidentally committed local Claude config
file named ".claude" from the repo and prevent it from being re-added: delete
the file from the repository history/working tree (e.g., git rm or remove and
commit) and add an entry for ".claude" to .gitignore so the local path
/Users/samfierro/.claude is not tracked in future commits; include a short
commit message like "Remove local Claude config and add to .gitignore" and
ensure the removal is pushed.

Comment on lines +118 to +131
{#if wrapper}
<!-- Wrapper mode: wraps custom content -->
<div
bind:this={triggerElement}
on:mouseenter={showTooltip}
on:mouseleave={hideTooltip}
on:focus={showTooltip}
on:blur={hideTooltip}
class="inline-block"
aria-label="Tooltip"
role="tooltip"
>
<slot />
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Incorrect role="tooltip" on the wrapper trigger div; keyboard focus inaccessible.

Two issues with the wrapper-mode <div>:

  1. Wrong ARIA rolerole="tooltip" is reserved for the popup element (the floating <div> at line 165 already has it). The trigger wrapper must not carry this role; it typically uses aria-describedby pointing to the tooltip element's id.

  2. Not keyboard-focusableon:focus / on:blur are wired up, but a <div> without tabindex="0" is never focused via keyboard, so the tooltip is unreachable for keyboard-only users.

♿ Suggested fix
 <div
   bind:this={triggerElement}
   on:mouseenter={showTooltip}
   on:mouseleave={hideTooltip}
   on:focus={showTooltip}
   on:blur={hideTooltip}
   class="inline-block"
-  aria-label="Tooltip"
-  role="tooltip"
+  tabindex="0"
 >

Give the tooltip <div> an id and add aria-describedby on the trigger as a follow-up when IDs are wired in.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{#if wrapper}
<!-- Wrapper mode: wraps custom content -->
<div
bind:this={triggerElement}
on:mouseenter={showTooltip}
on:mouseleave={hideTooltip}
on:focus={showTooltip}
on:blur={hideTooltip}
class="inline-block"
aria-label="Tooltip"
role="tooltip"
>
<slot />
</div>
{`#if` wrapper}
<!-- Wrapper mode: wraps custom content -->
<div
bind:this={triggerElement}
on:mouseenter={showTooltip}
on:mouseleave={hideTooltip}
on:focus={showTooltip}
on:blur={hideTooltip}
class="inline-block"
tabindex="0"
>
<slot />
</div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/web_ui/src/lib/ui/info_tooltip.svelte` around lines 118 - 131, The
wrapper-mode trigger div incorrectly has role="tooltip" and is not
keyboard-focusable; remove the role attribute from the trigger (leave
role="tooltip" on the floating popup element), make the trigger focusable by
adding tabindex="0" to the div bound to triggerElement, and wire an accessible
relationship by adding aria-describedby referencing the tooltip element's id
(assign an id to the popup div and set aria-describedby on the trigger once IDs
are available); keep existing handlers showTooltip/hideTooltip and focus/blur
logic.

Comment on lines +1089 to +1121
{@const eval_configs_link = `/specs/${project_id}/${task_id}/${spec_id}/${evalItem.id}/eval_configs`}
{@const train_tag = tagFromFilterId(
evalItem.train_set_filter_id || "",
)}
{@const dataset_add_link =
train_tag &&
`/dataset/${project_id}/${task_id}/add_data?tags=${train_tag}`}
{@const tooltip_parts = [
"**Eval Not Ready**\n\nFix the following issues and click Refresh to update this eval's status.",
judge_error === "No judge configured"
? "**No judge configured** — This eval doesn't have a default judge. To fix, [set default judge](" +
eval_configs_link +
") for this eval."
: null,
judge_error === "Model not supported"
? "**Model not supported** — This eval's default judge model is not supported. Kiln Prompt Optimization only supports OpenRouter, OpenAI, Gemini, and Anthropic providers. To fix, [change your default judge](" +
eval_configs_link +
") for this eval."
: null,
train_error === "Training set required" ||
train_error === "Training set is empty"
? "**Training set is empty** — This eval doesn't have any training data. To fix, [add samples to your dataset](" +
dataset_add_link +
") with the tag " +
`'${train_tag}'` +
"."
: null,
other_error
? "**Error**\n\n" + other_error
: null,
].filter((x) => x !== null)}
{@const combined_tooltip =
tooltip_parts.join("\n\n")}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

undefined rendered in tooltip text when eval has no train_set_filter_id.

When train_error === "Training set required", the eval has no train_set_filter_id, so:

  • tagFromFilterId("")undefined
  • dataset_add_link = undefined && ...undefined

The tooltip string then becomes:

...To fix, [add samples to your dataset](undefined) with the tag 'undefined'.

This produces a broken link and nonsensical tag name in the tooltip. Fix by guarding the link/tag on train_tag being defined:

🐛 Proposed fix
- train_error === "Training set required" || train_error === "Training set is empty"
-   ? "**Training set is empty** — This eval doesn't have any training data. To fix, [add samples to your dataset](" +
-     dataset_add_link +
-     ") with the tag " +
-     `'${train_tag}'` +
-     "."
-   : null,
+ train_error === "Training set required"
+   ? "**No training set configured** — This eval doesn't have a training set. Please configure one in the eval settings."
+   : train_error === "Training set is empty" && train_tag && dataset_add_link
+   ? "**Training set is empty** — This eval doesn't have any training data. To fix, [add samples to your dataset](" +
+     dataset_add_link +
+     ") with the tag " +
+     `'${train_tag}'` +
+     "."
+   : train_error
+   ? "**Training set issue** — " + train_error
+   : null,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/web_ui/src/routes/`(app)/prompt_optimization/[project_id]/[task_id]/create_prompt_optimization_job/+page.svelte
around lines 1089 - 1121, The tooltip can render "undefined" because
tagFromFilterId("") returns undefined so train_tag is falsy and dataset_add_link
becomes undefined; update the logic around tagFromFilterId, train_tag,
dataset_add_link, tooltip_parts and combined_tooltip so the training-set message
is only added when train_tag is truthy: compute train_tag =
tagFromFilterId(evalItem.train_set_filter_id || "") and dataset_add_link only if
train_tag; in tooltip_parts push the training message only when train_error
indicates missing training data AND train_tag is defined (use a conditional that
references train_tag), and when inserting the tag or link interpolate only the
confirmed train_tag/dataset_add_link values to avoid rendering 'undefined'.

@sfierro sfierro closed this Feb 17, 2026
@sfierro sfierro deleted the sfierro/KIL-416-optimize-ui-feedback branch February 17, 2026 23:33
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