Skip to content

Evals: Added prompt iteration & Real-time config display#241

Merged
Ayush8923 merged 6 commits into
mainfrom
feat/evals-prompt-iteration
Jul 2, 2026
Merged

Evals: Added prompt iteration & Real-time config display#241
Ayush8923 merged 6 commits into
mainfrom
feat/evals-prompt-iteration

Conversation

@Ayush8923

@Ayush8923 Ayush8923 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #233 #232

Summary

  • Prompt iteration: one click sends finished eval's prompt back to editor. No manual re-type. Quick refine.
  • Version history upgrade: AI-generated commit messages show with better formatting + metadata highlight.
  • Editor refresh fix: version history list updates reliably after saving existing config.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran npm run dev and npm run build in the repository root and test.
  • If you've fixed a bug or added code that is tested

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ready-for-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ad24d809-48a9-4047-ade8-bbd1c8a32c69

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds an “Iterate on Prompt” action on evaluation results, a backend proxy for prompt improvement, prompt-editor version refresh after save, and a reusable CommitMessage renderer for AI-generated commit metadata in history rows.

Changes

Prompt iteration and prompt-editor refresh

Layer / File(s) Summary
Prompt iteration flow
app/api/evaluations/[id]/improve-prompt/route.ts, app/(main)/evaluations/[id]/page.tsx, app/components/icons/prompt-editor/SpinnerIcon.tsx
Adds the improve-prompt POST proxy route, evaluation-page request handling and navigation, loading state, and the spinner-enabled toolbar button.
Prompt editor version refresh
app/(main)/configurations/prompt-editor/page.tsx, app/components/prompt-editor/ConfigEditorPane.tsx
Adds config-version refetching and cache updates after saving, and removes a stale inline comment.

CommitMessage component

Layer / File(s) Summary
CommitMessage component
app/lib/types/commit.ts, app/components/CommitMessage.tsx, app/components/index.ts, app/components/prompt-editor/HistorySidebar.tsx
Adds parsed commit types, AI-message parsing and rendering, a barrel export, and compact history-sidebar integration.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: nishika26, vprashrex, AkhileshNegi

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main changes: prompt iteration and live config display improvements.
Linked Issues check ✅ Passed The PR adds the Iterate on Prompt action, limits it to completed runs, calls the backend flow, and refreshes the config display without reload.
Out of Scope Changes check ✅ Passed The added commit-message rendering and spinner updates support the stated prompt-iteration UX and do not appear unrelated.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/evals-prompt-iteration

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.

@Ayush8923 Ayush8923 self-assigned this Jul 1, 2026
@Ayush8923 Ayush8923 linked an issue Jul 1, 2026 that may be closed by this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
app/(main)/configurations/prompt-editor/page.tsx (2)

260-280: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Update the selected version after saving an existing config.
saveConfig only returns boolean, so handleSave never advances selectedConfigId/currentConfigVersion to the newly created version. That leaves the header on the old version and can make the unsaved-changes diff compare against the pre-save revision again.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`(main)/configurations/prompt-editor/page.tsx around lines 260 - 280,
Update handleSave in prompt-editor/page.tsx so that when saveConfig succeeds for
an existing config, it advances the editor state to the newly saved version
instead of only refreshing versions; use currentConfigParentId plus the
refreshed version list to set selectedConfigId and currentConfigVersion, and
keep resetEditor() only for new configs. This should be applied alongside the
existing saveConfig flow so the header and unsaved-changes diff reflect the
just-saved revision rather than the pre-save one.

84-88: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Surface refresh failures. refreshVersionsForConfig only logs the error, so a failed post-save refresh leaves the version list stale with no user-visible signal.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`(main)/configurations/prompt-editor/page.tsx around lines 84 - 88, The
post-save refresh path in refreshVersionsForConfig only logs failures, so the
prompt editor can end up with a stale version list and no visible feedback.
Update the refresh flow around refreshVersionsForConfig and the related
useEffect in prompt-editor/page.tsx to surface the failure to the user state/UI
instead of only calling the logger, while keeping the successful
hookVersionItemsMap merge behavior unchanged.
🧹 Nitpick comments (1)
app/(main)/configurations/prompt-editor/page.tsx (1)

146-148: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Failed refresh is silent to the user.

On error, only console.error runs; the user gets no indication that the version list failed to refresh after save.

💡 Suggested fix
       } catch (err) {
         console.error("Failed to refresh version list:", err);
+        // surface via toast if a toast hook is available in this component
       }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`(main)/configurations/prompt-editor/page.tsx around lines 146 - 148, The
refresh failure handling in prompt-editor is only logging to console and does
not inform the user when the version list refresh fails after save. Update the
error path in the version refresh logic (the catch block around the refresh call
in the prompt-editor page, near the refresh/save flow) to surface a user-visible
error state or notification in addition to console.error, using the existing
page state/notification pattern if available so the failure is clearly shown to
the user.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/`(main)/evaluations/[id]/page.tsx:
- Around line 203-221: The success state in the prompt iteration flow is being
reported before confirming there is a navigable config result. In the handler
that uses data.success, move invalidateConfigCache() and toast.success("Prompt
iteration created") so they only run after newConfigId is resolved and
router.push can happen, or otherwise handle the missing config case with an
error/neutral message. Update the logic around newConfigId, newVersion, and
router.push so the success toast only fires when the new configuration can
actually be opened.

In `@app/components/CommitMessage.tsx`:
- Around line 3-19: The AI-generated commit parser in parseCommitMessage uses
AI_GENERATED_PATTERN with a body capture that stops at newlines, so multi-line
messages fail detection and lose metadata. Update the regex handling so the
trailing body can span multiple lines in CommitMessage.tsx, and keep the
existing extraction logic for fromVersionRaw, evalName, and body intact so
parseCommitMessage still returns the correct ParsedCommit fields.

---

Outside diff comments:
In `@app/`(main)/configurations/prompt-editor/page.tsx:
- Around line 260-280: Update handleSave in prompt-editor/page.tsx so that when
saveConfig succeeds for an existing config, it advances the editor state to the
newly saved version instead of only refreshing versions; use
currentConfigParentId plus the refreshed version list to set selectedConfigId
and currentConfigVersion, and keep resetEditor() only for new configs. This
should be applied alongside the existing saveConfig flow so the header and
unsaved-changes diff reflect the just-saved revision rather than the pre-save
one.
- Around line 84-88: The post-save refresh path in refreshVersionsForConfig only
logs failures, so the prompt editor can end up with a stale version list and no
visible feedback. Update the refresh flow around refreshVersionsForConfig and
the related useEffect in prompt-editor/page.tsx to surface the failure to the
user state/UI instead of only calling the logger, while keeping the successful
hookVersionItemsMap merge behavior unchanged.

---

Nitpick comments:
In `@app/`(main)/configurations/prompt-editor/page.tsx:
- Around line 146-148: The refresh failure handling in prompt-editor is only
logging to console and does not inform the user when the version list refresh
fails after save. Update the error path in the version refresh logic (the catch
block around the refresh call in the prompt-editor page, near the refresh/save
flow) to surface a user-visible error state or notification in addition to
console.error, using the existing page state/notification pattern if available
so the failure is clearly shown to the user.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1769bd1a-518b-46f6-b7dc-dfe74a4c0fe0

📥 Commits

Reviewing files that changed from the base of the PR and between 7b313f3 and 13c3a3f.

📒 Files selected for processing (9)
  • app/(main)/configurations/prompt-editor/page.tsx
  • app/(main)/evaluations/[id]/page.tsx
  • app/api/evaluations/[id]/improve-prompt/route.ts
  • app/components/CommitMessage.tsx
  • app/components/icons/prompt-editor/SpinnerIcon.tsx
  • app/components/index.ts
  • app/components/prompt-editor/ConfigEditorPane.tsx
  • app/components/prompt-editor/HistorySidebar.tsx
  • app/lib/types/commit.ts
💤 Files with no reviewable changes (1)
  • app/components/prompt-editor/ConfigEditorPane.tsx

Comment thread app/(main)/evaluations/[id]/page.tsx
Comment thread app/components/CommitMessage.tsx
@Ayush8923 Ayush8923 requested a review from vprashrex July 1, 2026 08:50
@Ayush8923 Ayush8923 merged commit 78e695f into main Jul 2, 2026
2 checks passed
@Ayush8923 Ayush8923 deleted the feat/evals-prompt-iteration branch July 2, 2026 06:19
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.3.0-main.7 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluation: Add prompt iteration button UI Update: Real-time config display

2 participants