feat: PIE-856, PIE-681, PIE-927, PIE-923 - #3105
Merged
Merged
Conversation
MUI's palette does not follow `--pie-*`, so every `theme.palette.grey[N]` read held a fixed hex under every colour scheme. Measured against each scheme's own `--pie-background`, shades 100-500 fall below the 3:1 non-text minimum in six of the ten schemes and 600-800 in three or four. The answer-choice separator George reported -- grey[300] at about 1.1:1 on black-on-rose, which sets `--pie-border` to #000000 -- is the visible end of that, not a special case: none of these reads were correct. Each site takes the accessor matching its role, since the roles differ and so do the contrast requirements: - strokes, dividers and connectors -> `color.border()`, at least 3.23:1 against every scheme's background. `--pie-border-light` was rejected: 1.53:1 in the default scheme. - fills -> `color.backgroundDark()`; pressed or selected fills -> `color.dropdownBackground()`, whose default #E0E1E6 matches what several of these sites already used. A fill belongs close to the page, so the 3:1 floor is not its job; the stroke on it carries the separation. - text -> `color.text()`. No neutral token clears 4.5:1 in every scheme (`--pie-border-gray` tops out at 3.17:1), so muted text has no scheme-following option. The likert column header was the worst of these at 1.88:1 on white, failing before any scheme was applied. - interactive icons -> `color.text()`; de-emphasised non-text glyphs -> `color.borderGray()`, where 3:1 is the bar. - disabled affordances -> `color.disabled()`, whose default is the same `grey` literal the math-inline remove button already used, so that one is unchanged at rest. - heavy card strokes that were grey[700] -> `color.borderDark()`, #646464 against the #616161 they replace. Four surfaces move alongside their strokes. `palette.common.white` is MUI's #fff regardless of scheme, so tokenising a stroke while leaving the surface fixed would put a scheme's border colour on a permanently white card -- under white-on-black, `--pie-border` is #ffffff, erasing the outline this was meant to fix. `--pie-white` inverts with the scheme, which is what `common.white` was standing in for on the two annotation popovers, the inline-dropdown menu item and the graphing tool spacer. File-local grey literals in the same styled blocks move too, because they are the same defect wearing a different spelling: graphing's `GREY_A100`/`GREY_A200`, the drag-in-the-blank choice stroke and grip glyph, match-list's arrow head -- which had to follow its own shaft or the arrow loses its point on a dark scheme -- the annotation popover's pointer triangle, and the inline-dropdown toolbar's own #E0E1E6 surface. `#C0C3CF` is `--pie-blue-grey-300`'s default, but that token is a fill measuring 1.00:1 against some backgrounds, so response-slot outlines take the stroke token. `color.buttonFocusOutline()` is deliberately not used here: it is new in pie-lib and the published `@pie-lib/render-ui` this repo resolves does not carry it yet. The two focus rings that needed it are in pie-lib, where render-ui comes from the workspace. The `row.test.jsx` render-ui mock gains `border`, the accessor answer-config-block now calls. `choice-input.test.jsx` still fails on `color.keyBoardFocusIndicator` missing from the installed render-ui; that predates this change.
…d PIE-927
pie-lib's PreviewPrompt no longer renders id="preview-prompt" on its container. Every
prompt on a page emitted that same id, so the id was invalid HTML wherever a page carried
more than one prompt -- it broke aria-labelledby / aria-describedby and label-for
wiring, and it broke the document-wide getElementById lookup PreviewPrompt itself read it
back through: on a five-item page 28 of 30 typeset requests resolved to item 1's prompt and
items 2-5 were never typeset. The component now finds its own node via a ref, and the
container carries a stable preview-prompt class in place of the id. A class is the
supported hook for "is this node inside a prompt", precisely because it stays valid when a
page renders many prompts.
The ten audio.closest('#preview-prompt') call sites move to .preview-prompt:
multiple-choice, categorize, drag-in-the-blank, hotspot and
image-cloze-association, two eachimage-cloze-association, two eachimage-cloze-association, two eachimage-cloze-association, two eachimage-cloze-
mage-cloze-association, two eachimage-cloze-association, two eachimage-cloecked rathermage-cloze-association, two eachimage-cloze-association, two eachimage-cloecked rathermar pmage-cloze-association, two eachimage-cloze-association, two eachimage-cloeckidePrompt return
skips the autoplay toast wiring entirely, so prompt audio never plays in Safarskips the autoplay toast wiring entirely, so prompt audio never plays in Safarskips to sitting outside a
prompt, and behave as intended in all five packages.
No test mock needed the class: none of the existing tests reach closest().
multiple-choice calls isComplete with one argument, so the audio gate is never entered;
hotspot and image-cloze-association replace the element with a stub via
jest.mock('../index'); categorize and drag-in-the-blank have no audio coverage at all.
The data-testid=preview-prompt mocks are a different attribute and are left alone.
.preview-prompt only exists in the new @pie-lib/render-ui, so this cannot land on its own
-- flipping the selectors against 6.1.3 breaks prompt-audio detection exactly as leaving
them breaks it against the new version.
EOF
)
…tokens fix(theming): move the grey palette reads onto --pie-* tokens PIE-856
fix: read the prompt container by class, not by the id pie-lib removed PIE-927
fix: pin dll module deps to exact versions, not carets PIE-923
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.
No description provided.