fix: Fix model feature not updating on the page after changing it in the general info dialog#815
Conversation
…the general info dialog
🦋 Changeset detectedLatest commit: 1e928a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughFixes stale model feature display in the edit page header by resolving the current model from the definition using ModelUtils instead of relying on the passed model parameter, ensuring the feature reference reflects the latest state. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/project-builder-web/src/routes/data/models/edit.$key/-components/model-header-bar.tsx (1)
86-86:⚠️ Potential issue | 🟡 MinorInconsistent usage:
model.nameshould becurrentModel.namein delete confirmation.The delete confirmation dialog still uses
model.name, which will show a stale name if the user edits the model name and then attempts to delete it. For consistency with the fix, this should usecurrentModel.name.🔧 Proposed fix
requestConfirm({ title: 'Confirm delete', - content: `Are you sure you want to delete ${model.name}?`, + content: `Are you sure you want to delete ${currentModel.name}?`, buttonConfirmText: 'Delete',🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/project-builder-web/src/routes/data/models/edit`.$key/-components/model-header-bar.tsx at line 86, The delete confirmation uses the stale variable model.name; update the confirmation to reference the live state currentModel.name instead: locate the delete dialog/content template in the model header component (where content: `Are you sure you want to delete ${model.name}?` is defined) and replace model.name with currentModel.name so the dialog shows the latest edited name; ensure currentModel is in scope for that dialog callback.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In
`@packages/project-builder-web/src/routes/data/models/edit`.$key/-components/model-header-bar.tsx:
- Line 86: The delete confirmation uses the stale variable model.name; update
the confirmation to reference the live state currentModel.name instead: locate
the delete dialog/content template in the model header component (where content:
`Are you sure you want to delete ${model.name}?` is defined) and replace
model.name with currentModel.name so the dialog shows the latest edited name;
ensure currentModel is in scope for that dialog callback.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a9511026-de78-48e3-88a8-46649268025b
📒 Files selected for processing (2)
.changeset/fix-model-feature-stale-display.mdpackages/project-builder-web/src/routes/data/models/edit.$key/-components/model-header-bar.tsx
Summary by CodeRabbit
Bug Fixes