Skip to content

fix(frontend): show correct variant name in commit modal for new vari…#4694

Merged
bekossy merged 2 commits into
Agenta-AI:release/v0.103.5from
Sanket2329:fix/commit-modal-variant-name
Jun 15, 2026
Merged

fix(frontend): show correct variant name in commit modal for new vari…#4694
bekossy merged 2 commits into
Agenta-AI:release/v0.103.5from
Sanket2329:fix/commit-modal-variant-name

Conversation

@Sanket2329

@Sanket2329 Sanket2329 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Added commitModalOriginalEntityNameAtom in state.ts to keep track of the original name of the entity before any user edit overrides.
  • Updated EntityCommitTitle.tsx to conditionally display originalEntityName for commit actions.
  • Updated EntityCommitContent.tsx to display originalEntityName as the source, and the user-typed entityName as the target (blue text) in the version transition display.
  • This resolves issue Commit modal shows wrong variant name for new variants #4670 where the commit modal erroneously displayed the user-typed new variant name as the source name (instead of the original source variant name) when committing as a new variant.

Testing

Verified locally

  • Verified locally at http://localhost:3000 by editing a prompt template on the default variant, choosing the "As a new variant" option in the commit modal, and typing in a new variant name. The title, description text, and version transition correctly show default as the source instead of the new target variant name.
  • Ran pnpm lint-fix on the web workspace to check formatting.
  • Verified TypeScript build check passes successfully on @agenta/entity-ui and @agenta/oss.

Added or updated tests

N/A

QA follow-up

N/A

Demo

Screen.Recording.2026-06-14.at.12.11.48.PM.1.mp4

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. Frontend labels Jun 14, 2026
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

✅ Thanks @Sanket2329! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Jun 14, 2026
@github-actions github-actions Bot closed this Jun 14, 2026
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 099a65be-8530-4b1d-b439-b543e9eed491

📥 Commits

Reviewing files that changed from the base of the PR and between 399602a and 3bb6da6.

📒 Files selected for processing (6)
  • web/packages/agenta-entity-ui/src/index.ts
  • web/packages/agenta-entity-ui/src/modals/commit/components/EntityCommitContent.tsx
  • web/packages/agenta-entity-ui/src/modals/commit/components/EntityCommitTitle.tsx
  • web/packages/agenta-entity-ui/src/modals/commit/index.ts
  • web/packages/agenta-entity-ui/src/modals/commit/state.ts
  • web/packages/agenta-entity-ui/src/modals/index.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Commit modal now displays the original entity name for version transitions (including create new variants/revisions), ensuring labels and tooltips remain accurate even when names are edited.
    • Commit title and variant/revision target labeling were updated to use the original name where appropriate, improving consistency across the modal’s UI.

Walkthrough

A new derived Jotai atom commitModalOriginalEntityNameAtom is added to state.ts, resolving an entity's display name before any user edits via the entity adapter. The atom is exported through the commit module, modals, and package barrel files. EntityCommitTitle and EntityCommitContent are updated to consume this atom and display the original name in relevant UI text.

Changes

Commit Modal Original Entity Name

Layer / File(s) Summary
New atom definition and barrel exports
src/modals/commit/state.ts, src/modals/commit/index.ts, src/modals/index.ts, src/index.ts
commitModalOriginalEntityNameAtom is defined as a derived atom reading commitModalEntityAtom and resolving the entity's pre-override display name via the adapter, then re-exported through each barrel file up to the package root.
EntityCommitTitle and EntityCommitContent consume original name
src/modals/commit/components/EntityCommitTitle.tsx, src/modals/commit/components/EntityCommitContent.tsx
Both components import and read originalEntityName from the new atom. EntityCommitTitle selects between original and current name based on actionLabel. EntityCommitContent uses originalEntityName in version-transition and source-entity labels, and adds an entityName fallback for the variant target label.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing the display of the correct variant name in the commit modal for new variants, which is the primary objective of this PR.
Description check ✅ Passed The description is directly related to the changeset, providing a summary of changes, testing verification, and context for issue #4670 that motivated this work.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot removed the incomplete-pr PR is missing required template sections or a demo recording label Jun 14, 2026
@github-actions github-actions Bot reopened this Jun 14, 2026
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

@Sanket2329 is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@Sanket2329

Copy link
Copy Markdown
Contributor Author

Hi @mmabrouk!

Could you please review this PR when you have a moment? Let me know if there are any changes or improvements you'd like me to make to it!

Thank you!

@mmabrouk mmabrouk requested a review from ardaerzin June 14, 2026 20:07
@mmabrouk

Copy link
Copy Markdown
Member

Thanks for the PR @Sanket2329

I have assigned @ardaerzin for the review.

@bekossy bekossy changed the base branch from main to release/v0.103.5 June 15, 2026 11:21
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 15, 2026
@bekossy bekossy merged commit ef9efe9 into Agenta-AI:release/v0.103.5 Jun 15, 2026
17 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants