Skip to content

Input List: ValueConverter support for Tuple<> types#514

Draft
leekelleher wants to merge 2 commits intocontribfrom
dev/wip/input-list-tuple-value-converter
Draft

Input List: ValueConverter support for Tuple<> types#514
leekelleher wants to merge 2 commits intocontribfrom
dev/wip/input-list-tuple-value-converter

Conversation

@leekelleher
Copy link
Copy Markdown
Owner

Description

Following @skttl's feedback for Input List to have support for Tuple objects, I have explored the possibility and prepared this pull request.

Related Issues?

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

@leekelleher leekelleher added this to the 6.1.0 milestone Jan 4, 2026
@leekelleher leekelleher added type/feature New feature (internal) area/backend labels Jan 4, 2026
@skttl
Copy link
Copy Markdown
Contributor

skttl commented Jan 4, 2026

It works - sort of... but ModelsBuilder doesn't play nice with nested generic types. I have a PR coming up :)

@leekelleher
Copy link
Copy Markdown
Owner Author

@skttl Good catch! So far I'd been testing this out without ModelsBuilder, e.g. just using regular @Model.Value<T>() with the correct type, which worked okay. (I was making sure tuple deconstruction worked as expected).

I've now tried out ModelsBuilder and it's exactly as you describe, with the nested Tuple closing > after the first parameter. Good work on the fix! 👏

Hmmm... so the current state of this PR would break people's ModelsBuilder setup... I'll have a think about how to proceed. 🤔

@skttl
Copy link
Copy Markdown
Contributor

skttl commented Jan 4, 2026

Yeah, the only way I can see is to either raise the minimum dependency (once the fix gets merged), or do some weird hacky detection of the ModelsBuilder version to make the value object in current and previous versions of ModelsBuilder.

Or ship a companion package with a current-ModelsBuilder safe valueconverter (also making the value object)

@leekelleher
Copy link
Copy Markdown
Owner Author

@skttl ...or I add a proxy class that un-nests the Tuple<> generic parameters? e.g.

public class InputListTuples<T1> : List<Tuple<T1>> { }
public class InputListTuples<T1, T2> : List<Tuple<T1, T2>> { }
public class InputListTuples<T1, T2, T3> : List<Tuple<T1, T2, T3>> { }
public class InputListTuples<T1, T2, T3, T4> : List<Tuple<T1, T2, T3, T4>> { }
public class InputListTuples<T1, T2, T3, T4, T5> : List<Tuple<T1, T2, T3, T4, T5>> { }
public class InputListTuples<T1, T2, T3, T4, T5, T6> : List<Tuple<T1, T2, T3, T4, T5, T6>> { }
public class InputListTuples<T1, T2, T3, T4, T5, T6, T7> : List<Tuple<T1, T2, T3, T4, T5, T6, T7>> { }
public class InputListTuples<T1, T2, T3, T4, T5, T6, T7, TRest> : List<Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>> where TRest : notnull { }

Although, this does tie the Input List property-editor to this particular object-type. 🤷

@skttl
Copy link
Copy Markdown
Contributor

skttl commented Jan 9, 2026

A proxy class might be the simplest option.

@leekelleher
Copy link
Copy Markdown
Owner Author

leekelleher commented Jan 20, 2026

Quick update. I've realised that I made a mistake with the Input List's value data structure in my initial feature PR #513. In the current implementation there is a tight limitation that you can only add a data-type to the tuple once, otherwise it would lead to data loss. 🤦 I have a plan to resolve this, but will take time. I am going to postpone Input List until v6.2 so to not delay v6.1.

@leekelleher leekelleher modified the milestones: 6.1.0, 6.2.0 Jan 20, 2026
@leekelleher leekelleher modified the milestones: 6.2.0, 7.0.0 Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/backend type/feature New feature (internal)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants