Skip to content

DOP-5920: allow None values in defaults, and allow non selected content in composables#670

Merged
seungpark merged 6 commits into
mainfrom
DOP-5920
Aug 8, 2025
Merged

DOP-5920: allow None values in defaults, and allow non selected content in composables#670
seungpark merged 6 commits into
mainfrom
DOP-5920

Conversation

@seungpark

@seungpark seungpark commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

Ticket

DOP-5920
DOP-6050

Notes

  • PR skips id validation if a default id specified is "None" while having dependencies for that composable option - this means dependency can be unfulfilled and No Selection is allowed. See added test

  • Also removes the check for all children to be .. selected-content directives. This allows writers to have repeatable content under the select options in the UI. (front end PR will be linked here)

  • NOTE: Above two requirements left me to move the handling of .. selected-content into the post process, as we are allowing any other node within the structure, and this is where we handle nodes regardless of position, whereas parser expects certain positional nodes.

  • NOTE: subsequent frontend PR is here (see staging links)

README updates

    • This PR introduces changes that should be reflected in the README.md and/or HACKING.md, and I have made those updates.
    • This PR does not introduce changes that should be reflected in the README.md and/or HACKING.md

@seungpark
seungpark marked this pull request as ready for review August 6, 2025 19:05
@seungpark
seungpark requested review from caesarbell and mmeigs August 6, 2025 19:23

@mmeigs mmeigs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mainly just questions and cleanup!

Comment thread snooty/test_postprocess.py
Comment thread snooty/postprocess.py Outdated
Comment thread snooty/postprocess.py
for idx in range(len(selection_ids)):
selection_id = selection_ids[idx]
try:
composable_option = self.composable_tutorial.composable_options[idx]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I bet this is right, but just checking that we shouldn't be using selection_id rather than idx here on line 2233?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

But this does leave another point. Could you add more commenting about the structure of this logic? You've named variables well but it's still pretty complicated for a first-time viewer.

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.

left a comment!

Comment thread snooty/postprocess.py
@seungpark
seungpark requested a review from mmeigs August 7, 2025 17:51

@mmeigs mmeigs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the comment!!

@seungpark
seungpark merged commit 09badfa into main Aug 8, 2025
6 checks passed
@seungpark
seungpark deleted the DOP-5920 branch August 8, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants