Repository navigation
Conversation
…rings A child dependency that asks for `hidden` depends on the hidden of each composite its children came from while the children include a string, and `getValue` strips those extra values off the end while `addedCompositeHiddenDependency` is set. The flag was set when a string appeared and never cleared, so once the replacements changed to ones with no string (a conditional content's case with a string giving way to its else), `getValue` stripped real children instead, and the paragraph's text read undefined children and threw. The flag is now decided afresh each time the downstream components are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XhPqNj8iDfTLu7sq5Pcpd2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XhPqNj8iDfTLu7sq5Pcpd2
cqnykamp
marked this pull request as draft
October 17, 2026 13:33
The paragraph's text, read through a reference, kept the case's text after the switch to the else; the test now checks that reference too, and the changeset says what a user saw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XhPqNj8iDfTLu7sq5Pcpd2
cqnykamp
marked this pull request as ready for review
October 17, 2026 13:49
Collaborator
Author
|
Test Main (24.x) failed on
The same job passed on the previous head, Generated by Claude Code |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A paragraph's
textstopped following a<conditionalContent>inside it in one case: the content switches from a case with a string between its components to a branch without one. For example:Type
1, then0, inton.showshould change from "dog mouse cat" to "birdfish", but it keeps showing "dog mouse cat".The paragraph itself renders correctly, because the viewer renders its children, not its
text. The bug only shows where something readstext, such as$p.text. The core keeps the old value because computing the new one throws inside the core (Cannot read properties of undefined (reading 'toString')fromtextFromComponent). A test that asks for all state variables (returnAllStateVariables) receives that error directly.Cause
ChildDependency(core/dependencies/childDependencies.ts) handles a request forhiddenover children that include a string specially. Strings have nohidden, so it adds thehiddenof each composite the children came from as extra downstream components, and setsaddedCompositeHiddenDependency. Later,getValuestrips one trailing value per composite range while that flag is set.The flag was set when a string appeared and never cleared. Once the replacements changed to ones with no string, no composite dependencies were added, but
getValuestill stripped the last values. Those values were the real children. The paragraph'stextthen receivedundefinedchildren.Fix
determineDownstreamComponentsnow resets the flag each time it decides the downstream components, before deciding whether to add the compositehiddendependencies.Tests
conditionalcontent.test.ts: "text of a paragraph when a case with a string gives way to an else without one". It checks both$p.text(as a document reads it) and the paragraph's owntext. On main it fails:expected 'dog mouse cat' to equal 'birdfish'. It passes with the fix.doenetml-worker-javascriptVitest suite run locally: 5,239 tests pass. One test fails:prefigure/chart-bar.test.ts› "measures a fractional label…". It fails identically on main in the same environment (Node 22), and main's CI passes it.Found through #2281, whose rewritten conditional-content test hits this case.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XhPqNj8iDfTLu7sq5Pcpd2