When Ref/RefList column shows a Choice column, render it as a choice#2277
When Ref/RefList column shows a Choice column, render it as a choice#2277dsagal wants to merge 1 commit into
Conversation
|
Deployed commit |
|
If anyone is wondering about this diff, I'm holding off on it because I think it's a wrong approach. It does allow references that are colored, but that's about it. The way to achieve it is very awkward. And once you think about the actual goal and mechanism, it seems just wrong: the goal is to associate a color with every row of a table. The way you'd have to do it in this approach is to turn an identifier column into a Choice column, and use the Choice configuration to associate a color with every value. That means manual sync of values in the column with the Choice's configuration. A better mechanism would be if a color could be associated with a record, and then shown in the style of a reference value pill. This may be bets done as part of another concept: a "record identity". Today there is just "Show column", and it's a setting on each reference, not on the referenced table. Instead, imagine that a table could say: this record is identified by this field and color. Every reference column would then show a colored pill. (You could further allow the record identity to include multiple fields, and an icon. This would make for more recognizable reference values.) |
Context
A Reference or Reference List column may show a column from the referenced table of type Choice, but it's always rendered without color. It would be nicer to keep the styling in such cases.
Proposed solution
If the "Show Column" is of type Choice, use that Choice's styling for rendering a Reference or Reference List column.
Related issues
#1222
Has this been tested?
TBD: Tests to be created. Also, when entering a reference data, we could be showing colored choices, but the PR doesn't have this yet.
Screenshots / Screencasts
Preview with an example here: https://grist-gristlabs-grist-core-ref-to-choice.fly.dev/sbufBSzwPXTz/Restaurant-Inventory/p/8
Screenshot showing what it looks like: