Skip to content

fix: Fix model feature not updating on the page after changing it in the general info dialog#815

Merged
kingston merged 1 commit into
mainfrom
kingston/eng-1079-model-feature-change-doesnt-reflect-on-page-after-saving
Mar 12, 2026
Merged

fix: Fix model feature not updating on the page after changing it in the general info dialog#815
kingston merged 1 commit into
mainfrom
kingston/eng-1079-model-feature-change-doesnt-reflect-on-page-after-saving

Conversation

@kingston

@kingston kingston commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Bug Fixes

  • Fixed an issue where model feature information was not updating on the page after being changed in the general info dialog.

@changeset-bot

changeset-bot Bot commented Mar 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1e928a8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 21 packages
Name Type
@baseplate-dev/project-builder-web Patch
@baseplate-dev/project-builder-cli Patch
@baseplate-dev/project-builder-dev Patch
@baseplate-dev/create-project Patch
@baseplate-dev/project-builder-test Patch
@baseplate-dev/code-morph Patch
@baseplate-dev/core-generators Patch
@baseplate-dev/fastify-generators Patch
@baseplate-dev/project-builder-common Patch
@baseplate-dev/project-builder-lib Patch
@baseplate-dev/project-builder-server Patch
@baseplate-dev/react-generators Patch
@baseplate-dev/sync Patch
@baseplate-dev/tools Patch
@baseplate-dev/ui-components Patch
@baseplate-dev/utils Patch
@baseplate-dev/plugin-auth Patch
@baseplate-dev/plugin-email Patch
@baseplate-dev/plugin-queue Patch
@baseplate-dev/plugin-rate-limit Patch
@baseplate-dev/plugin-storage Patch

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

@coderabbitai

coderabbitai Bot commented Mar 12, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Fixes 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

Cohort / File(s) Summary
Changeset
.changeset/fix-model-feature-stale-display.md
Added patch changeset entry documenting the fix for model feature not updating in the general info dialog.
Model Header Component
packages/project-builder-web/src/routes/data/models/edit.$key/-components/model-header-bar.tsx
Updated component to resolve current model via ModelUtils.byId(definition, model.id) and use the resolved model's featureRef instead of the passed parameter, ensuring display reflects latest state.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • halfdomelabs/baseplate#656 — Also resolves models via ModelUtils.byId instead of relying on directly passed model references, addressing similar stale data issues.
🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main bug fix: ensuring the model feature updates on the page after changes in the general info dialog, which matches the changeset entry and code modifications.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kingston/eng-1079-model-feature-change-doesnt-reflect-on-page-after-saving

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.

@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.

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 | 🟡 Minor

Inconsistent usage: model.name should be currentModel.name in 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 use currentModel.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

📥 Commits

Reviewing files that changed from the base of the PR and between 168793d and 1e928a8.

📒 Files selected for processing (2)
  • .changeset/fix-model-feature-stale-display.md
  • packages/project-builder-web/src/routes/data/models/edit.$key/-components/model-header-bar.tsx

@kingston kingston merged commit f94d174 into main Mar 12, 2026
11 checks passed
@kingston kingston deleted the kingston/eng-1079-model-feature-change-doesnt-reflect-on-page-after-saving branch March 12, 2026 09:14
@github-actions github-actions Bot mentioned this pull request Mar 12, 2026
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