Fix dynamic type function not receiving correct state for collection - #10398
Fix dynamic type function not receiving correct state for collection#10398robe2 wants to merge 1 commit into
Conversation
…row fields When a schema field uses a dynamic type function (type as a function) and is rendered inside a collection (e.g., chain tasks), the function always received the top-level schema data instead of the row-level data. This caused the field to fall through to its default type, ignoring the actual field values in the row. Pass the parent-path state to the dynamic type function so it receives the correct context for collection row fields.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. Walkthrough
ChangesMapped control state evaluation
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to Dynamic field types in collection rows now receive row-level context, allowing dependent controls such as Kind options to update correctly without changing top-level field behavior. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
…row fields
When a schema field uses a dynamic type function (type as a function) and is rendered inside a collection (e.g., chain tasks), the function always received the top-level schema data instead of the row-level data. This caused the field to fall through to its default type, ignoring the actual field values in the row.
Pass the parent-path state to the dynamic type function so it receives the correct context for collection row fields.
I ran into this issue when building pg_timetable UI - #10152 that when building a new Chain and Tasks in one step, the Kind toggle didn't change options based on Kind. This patch fixes it, but didn't seem appropriate to put in as part of pg_timetable since it's a global issue. I don't think any existing elements are impacted by it yet.
Summary by CodeRabbit