Skip to content

Define CustomDataDefinition for interactive atoms - #177

Open
Fweddi wants to merge 3 commits into
mainfrom
fp/define-custom-fields
Open

Fweddi wants to merge 3 commits into
mainfrom
fp/define-custom-fields

Conversation

@Fweddi

@Fweddi Fweddi commented Dec 16, 2024

Copy link
Copy Markdown
Contributor

This updates the interactive atom thrift model to add an optional list of CustomDataDefintion options, opening the door to parameterised interactive atoms.

A CustomDataDefinition itself comprises of four fields:

struct CustomDataDefinition {
  1: required string fieldName
  2: required string fieldType
  3: required string fieldDescription
  4: required string defaultValue
}

While the atom itself has an optional list of these:

8: optional list<CustomDataDefinition> customDataDefinitions = []

These will allow for a structured interface in Composer, with the description providing some context about the nature/use of the custom data and the default value ensuring a default/fallback behaviour.

@Fweddi
Fweddi force-pushed the fp/define-custom-fields branch 3 times, most recently from aee622d to 9082e3a Compare December 16, 2024 15:26
@guardian guardian deleted a comment from gu-scala-library-release Bot Dec 16, 2024
@guardian guardian deleted a comment from gu-scala-library-release Bot Dec 16, 2024
struct CustomField {
1: required string fieldName
2: required string fieldType
3: required string defaultValue

@Fweddi Fweddi Dec 16, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string is the best we can do for defaultValue as Thrift doesn't support polymorphism.

I assume we will fill defaultValue with stringified JSON.

@gu-scala-library-release

Copy link
Copy Markdown
Contributor

@Fweddi has published a preview version of this PR with release workflow run #23, based on commit 9082e3a:

7.0.0-PREVIEW.fpdefine-custom-fields.2024-12-16T1530.9082e3ad

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the fp/define-custom-fields branch, or use the GitHub CLI command:

gh workflow run release.yml --ref fp/define-custom-fields

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml

@frederickobrien frederickobrien added this to the Visuals milestone Mar 6, 2025
@groakland groakland added the feature Departmental tracking: work on a new feature label Nov 2, 2025
@frederickobrien
frederickobrien force-pushed the fp/define-custom-fields branch from 9082e3a to 9769f40 Compare July 29, 2026 09:26
@frederickobrien frederickobrien modified the milestones: Visuals, Interactives Jul 29, 2026
@frederickobrien frederickobrien self-assigned this Jul 29, 2026
@frederickobrien frederickobrien changed the title Define CustomField Define CustomField for interactive atoms Aug 19, 2026
@frederickobrien
frederickobrien marked this pull request as ready for review August 19, 2026 12:19
@frederickobrien
frederickobrien requested review from a team as code owners August 19, 2026 12:19
@frederickobrien frederickobrien changed the title Define CustomField for interactive atoms Define CustomDataDefinition for interactive atoms Aug 19, 2026
@frederickobrien
frederickobrien requested a review from a team August 19, 2026 13:28
gu-scala-library-release Bot added a commit that referenced this pull request Aug 19, 2026
…shed by frederickobrien

frederickobrien published release version 14.0.0-PREVIEW.fpdefine-custom-fields.2026-08-19T1448.912a1f79
using gha-scala-library-release-workflow: https://github.com/guardian/gha-scala-library-release-workflow

Release-Version: 14.0.0-PREVIEW.fpdefine-custom-fields.2026-08-19T1448.912a1f79
Release-Initiated-By: https://github.com/frederickobrien
Release-Workflow-Run: https://github.com/guardian/content-atom/actions/runs/32266157001
Release-Notes: #177
@gu-scala-library-release

Copy link
Copy Markdown
Contributor

@frederickobrien has published a preview version of this PR with release workflow run #75, based on commit 912a1f7:

14.0.0-PREVIEW.fpdefine-custom-fields.2026-08-19T1448.912a1f79

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the fp/define-custom-fields branch, or use the GitHub CLI command:

gh workflow run release.yml --ref fp/define-custom-fields

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml


struct CustomDataDefinition {
1: required string fieldName
2: required string fieldType

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any suggestions of what this fieldType will contain?
Are you planning for just string versions of JSON types? (object, array, number, string, boolean) ?

Perhaps add a comment to this thrift explaining what values you think could go into this field?


struct CustomDataDefinition {
1: required string fieldName
2: required string fieldType

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could go really crazy with fieldTypes if you wanted to do advanced things later in editorial tooling like

  • date
  • array
  • int (not fractional numbers)
  • int-range
  • number-range
  • dropdown of strings
  • coordinates

These are future concepts deffo not for this first PR, but will having this field type as a string be good enough to enable that sort of stuff later or is it worth setting it up as an enum or something else now?

@jonathonherbert

Copy link
Copy Markdown
Contributor

NB @michaelclapham that a broader discussion is ongoing @ https://github.com/guardian/flexible-model/discussions/103.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants