Uh oh!
There was an error while loading. Please reload this page.
fix: preserve PreviewGroup imageRender contract - #529
Conversation
@Cherry7593 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What changed
Make
GroupPreviewConfigomit the baseimageRendermember before redeclaring the grouped callback, and add a runtime regression test for its numericcurrentvalue.Root cause
GroupPreviewConfigextendsInternalPreviewConfig, but narrowsimageRenderfrom an optionalinfo.currentto a required one. Strict TypeScript consumers therefore report TS2430 for the published declaration.The runtime contracts are genuinely different: single-image rendering may omit
current, while PreviewGroup always supplies its active numeric index.Why this shape
Omit<InternalPreviewConfig, 'imageRender'>preserves all other base members and allows the grouped callback to retain its stronger contract without invalid interface inheritance. Runtime JavaScript is unchanged.Validation
skipLibCheck: falsepassedThe added test verifies
imageRenderreceivescurrent0 initially and 1 after navigation.