Add Lookbook preview for lazy-loaded tab panels#66
Open
joshsadam wants to merge 3 commits into
Open
Conversation
f25e15f to
984fb1e
Compare
MSW intercepts Turbo Frame requests in the Lookbook preview without adding demo-only Rails routes.
Lookbook previews now start MSW before Turbo boots so lazy tab panels can fetch mocked frame responses without demo routes.
…r missing helpers
cbed100 to
8f4d031
Compare
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.
What does this PR do and why?
Adds a new Lookbook preview that demonstrates lazy-loaded tab panels using
Pathogen::Tabs#with_lazy_paneland Turbo Frames.The preview shows a three-tab layout where the selected panel renders immediately and the other panels fetch mocked Turbo Frame responses when their tabs become visible. To support this without adding demo-only Rails routes, the Lookbook preview layout now boots MSW (Mock Service Worker) before Turbo starts. MSW intercepts requests to
/lookbook-mocks/tabs/lazy-load/:paneland returns realistic frame HTML with a short artificial delay.Changes include:
Pathogen::Tabslookbook_mocks/tabs_lazy_load.jsMSW handlers andlookbook_preview.jsentry pointmockServiceWorker.jsindemo/public/for browser interceptionpackage.json,pnpm-lock.yaml)Screenshots or screen recordings
Requests:

How to set up and validate locally
bin/setupcd demo&bin/devPR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.