fix(design-system): correct figma node ids and docs snippet race [AR-83527] - #697
Open
mmurawski-dn wants to merge 3 commits into
Open
fix(design-system): correct figma node ids and docs snippet race [AR-83527]#697mmurawski-dn wants to merge 3 commits into
mmurawski-dn wants to merge 3 commits into
Conversation
✅ Deploy Preview for drivenets-design-system ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Fixes two unrelated CI failures.
1. Figma Code Connect validation
figma:publishfailed validation on two nodes:DsModal.Footerpointed at32014-16402, which isuse-case=small-modals— a variant inside the component setPart_modal-footer_V2(43101:8753). Code Connect must target the set. The other three modal files already do.DsMainMenupointed at42100-7474, which isMain Menu Navigation_v2— a plain frame, not a component, so there was nothing to attach to. Repointed at the publishedMain Menu Navigation_v01(20895:43484), which has the same children.Verified with
figma connect publish --dry-run: All Code Connect files are valid.Note
Main Menu Navigation_v2looks like it was linked before it was componentized. If v2 is meant to supersede v01, design should convert that frame to a published component and we swap the id again.2. Storybook docs snippet race
Storybook Docs Testswas failing intermittently onchangeset-release/main— a bot PR touching only changesets, CHANGELOGs and version fields, so it could not have changed a snippet. A different component failed each run (ds-date-range-picker, thends-comments-drawer), and other runs on the same commit passed.Both failures had the same signature — expected JSX, received the raw story object:
Cause
Autodocs fills a story's "Show code" panel in two passes:
jsxDecorator→emitTransformCode, which isasyncand emitsSNIPPET_RENDEREDat least a microtask after the story's DOM is committed.readShowCodeSnippetonly waited for the panel to be visible and non-empty — both already true in pass 1 — so under CI load it captured the story object. Waiting on the canvas render does not help: the canvas is committed before the snippet exists.Fix
Wait for the state transition itself:
SNIPPET_RENDERED.skipJsxRender. Stories withsource: { type: 'code' }or a barerenderthat ignores args never emit — for them the static source is the final value.Verification
Reproduced the race by delaying the snippet event, then compared old vs new logic:
Custom Labels(dynamic){← the CI failureCustom Labels(dynamic)<DsDateRangePickerControlled(type: 'code'){Controlled(type: 'code'){Full suite run twice locally: 56/56 passed both times, no snapshot drift. Runtime dropped from ~214s to ~128s, because stories that never emit no longer wait.