feat(ui): model relationship management #7963
Open
+1,285
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds full support for managing model-to-model relationships in the UI and backend.
Introduces RelatedModels subpanel for linking and unlinking models in model management.
Summary
Introduces a full system for managing model-to-model relationships.
New database migration: model_relationships table (bidirectional, FK constrained, cascade deletes, sorted input).
New service layer: model_relationships for API interaction.
New UI subpanel (RelatedModels) for linking/unlinking models in the Model Manager.
UI on frontend linked to relationships, pulling either to the top, or allowing filters.
Rebased due to snazzy new model selector that happened this week.
Notes
base_model
types (or any model with the base typeany
) in the UI.related_model_ids
) on models for optimized frontend access (instead of extra API calls).First PR, Please be gentle.
Related Issues / Discussions
Part of 7894 used_with tag support.
QA Instructions
Ran Lint, Prettier, pnpm test, Made sure UI and API routes functioned with DB open to watch.
Merge Plan
Unless a migration happens between now and PR, Rebase if needed and repush? Honestly not completely sure what's needed here, but more than willing to work for whatever is needed.
Checklist
What's New
copy (if doing a release after this PR)