Summary
packages/docs-nextra/pages/reference/cascadeMessage.mdx explains a <cascadeMessage> nested inside a section with a rule that only governs messages written as direct children of the <cascade>:
A <cascadeMessage> placed inside a still-hidden section serves as the prompt shown in place of that section's body. The cascade chooses the first <cascadeMessage> that follows the last completed child, so authoring one per section lets each section carry its own prompt.
The first sentence is right. The second describes the selection the cascade performs among its own message children (Cascade.js, the search for the next <cascadeMessage> after the last shown child). A message inside a section is not selected that way at all: the section hides its own children, and a <cascadeMessage> is the one child whose rule is inverted, so it shows exactly while its section is held back — independently of every other section.
The difference is visible in the page's own Example 2, which has three boxed sections each carrying a message. As written, the text implies only "Finish Part 1 to unlock Part 2." is shown until Part 1 is done. In fact both "Finish Part 1…" and "Finish Part 2…" are shown from the start, each inside its own box.
That is asserted today by cascade.test.ts's "continuation messages inside sections", which holds a three-section cascade and checks each section's message against numCompleted:
expect(stateVariables[section2cmIdx].stateValues.hidden).eq(numCompleted >= 1);
expect(stateVariables[section3cmIdx].stateValues.hidden).eq(numCompleted >= 2);
At numCompleted === 0 both are false — both messages are on screen. Confirmed on screen as well as in the state.
Suggested change
Keep the first sentence and replace the mechanism in the second: a nested message is shown by its own section for as long as that section is held back, so every held-back section shows its message at once, and each reads as the prompt for its own box. The "first message after the last completed child" rule belongs with the cascade-level messages the page documents elsewhere, where it is correct.
The conclusion the page draws — "authoring one per section lets each section carry its own prompt" — is true and worth keeping; only the reason given for it is wrong.
Notes
Pre-existing and documentation-only. Found while reviewing #1681, which fixes where a held-back step's message is drawn (#1680); deliberately left out of that PR, since it is a docs change unrelated to the two-line layout fix.
🤖 Generated with Claude Code
Summary
packages/docs-nextra/pages/reference/cascadeMessage.mdxexplains a<cascadeMessage>nested inside a section with a rule that only governs messages written as direct children of the<cascade>:The first sentence is right. The second describes the selection the cascade performs among its own message children (
Cascade.js, the search for the next<cascadeMessage>after the last shown child). A message inside a section is not selected that way at all: the section hides its own children, and a<cascadeMessage>is the one child whose rule is inverted, so it shows exactly while its section is held back — independently of every other section.The difference is visible in the page's own Example 2, which has three boxed sections each carrying a message. As written, the text implies only "Finish Part 1 to unlock Part 2." is shown until Part 1 is done. In fact both "Finish Part 1…" and "Finish Part 2…" are shown from the start, each inside its own box.
That is asserted today by
cascade.test.ts's "continuation messages inside sections", which holds a three-section cascade and checks each section's message againstnumCompleted:At
numCompleted === 0both arefalse— both messages are on screen. Confirmed on screen as well as in the state.Suggested change
Keep the first sentence and replace the mechanism in the second: a nested message is shown by its own section for as long as that section is held back, so every held-back section shows its message at once, and each reads as the prompt for its own box. The "first message after the last completed child" rule belongs with the cascade-level messages the page documents elsewhere, where it is correct.
The conclusion the page draws — "authoring one per section lets each section carry its own prompt" — is true and worth keeping; only the reason given for it is wrong.
Notes
Pre-existing and documentation-only. Found while reviewing #1681, which fixes where a held-back step's message is drawn (#1680); deliberately left out of that PR, since it is a docs change unrelated to the two-line layout fix.
🤖 Generated with Claude Code