Skip to content

[Frontend / Fix]: Fix name memoization issues in entity commit modal#4412

Open
ardaerzin wants to merge 1 commit into
mainfrom
fe-fix/evaluator-name-issues
Open

[Frontend / Fix]: Fix name memoization issues in entity commit modal#4412
ardaerzin wants to merge 1 commit into
mainfrom
fe-fix/evaluator-name-issues

Conversation

@ardaerzin
Copy link
Copy Markdown
Contributor

Summary

fixes #4399

Testing

QA follow-up

check against the reproduction steps of #4399

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

Contributor Resources

Prefer externalEntity over currentEntity when computing createFieldsEntity to avoid stale atom data from previous sessions where afterClose reset never fired (e.g. parent unmounted mid-animation). This ensures Effect 2's default-name computation uses fresh data on first open.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment May 25, 2026 12:22pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

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: 466a9f51-ae44-4b8a-8fab-7913ff79f0d3

📥 Commits

Reviewing files that changed from the base of the PR and between 3c9b1db and c705b8b.

📒 Files selected for processing (1)
  • web/packages/agenta-entity-ui/src/modals/commit/components/EntityCommitModal.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Fixed the entity commit modal to correctly use current entity information during initialization, ensuring up-to-date data is displayed instead of potentially outdated cached state.

Walkthrough

The PR fixes a controlled-mode bug in EntityCommitModal where initial entity name and slug defaults were computed from stale atom state rather than fresh external props. The selector logic now prefers the provided entity prop before falling back to atom values, ensuring correct initial names are shown when the modal opens.

Changes

Entity Modal Default Name Fix

Layer / File(s) Summary
Entity prop priority in default name computation
web/packages/agenta-entity-ui/src/modals/commit/components/EntityCommitModal.tsx
createFieldsEntity selector now prefers the externally-provided entity prop over currentEntity from atoms when computing initial name and slug defaults, fixing incorrect initial values shown after creating new entities.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main fix: addressing name memoization issues in the entity commit modal, which aligns directly with the changeset's modification to prefer the entity prop over stale atom state.
Description check ✅ Passed The description is related to the changeset, explicitly referencing issue #4399 about memoized evaluator names and providing testing instructions aligned with the code changes.
Linked Issues check ✅ Passed The code change directly addresses the root cause identified in issue #4399 by preferring the externally provided entity prop over potentially stale currentEntity atom data, ensuring fresh default-name computation on modal open.
Out of Scope Changes check ✅ Passed All changes are focused and in-scope: the modification to EntityCommitModal.tsx only adjusts the createFieldsEntity derivation to use the entity prop, directly solving the stale name issue without introducing unrelated alterations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fe-fix/evaluator-name-issues

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.

@ardaerzin ardaerzin marked this pull request as ready for review May 25, 2026 13:36
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. Frontend labels May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-fdec.up.railway.app/w
Image tag pr-4412-0e1d000
Status Failed
Railway logs Open logs
Logs View workflow run
Updated at 2026-05-25T13:55:05.030Z

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

Labels

Frontend size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong initial evaluator name is shown on create

2 participants