Skip to content

docs(storybook): fix blank content in Safari (DS-5437) - #459

Merged
KamilEmeleev merged 1 commit into
mainfrom
docs/DS-5437
Aug 14, 2026
Merged

docs(storybook): fix blank content in Safari (DS-5437)#459
KamilEmeleev merged 1 commit into
mainfrom
docs/DS-5437

Conversation

@KamilEmeleev

@KamilEmeleev KamilEmeleev commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor
    • Improved dark-mode handling in the documentation interface.
    • Removed the temporary loading state, allowing documentation content to render immediately.

@KamilEmeleev KamilEmeleev added bug Something isn't working documentation Improvements or additions to documentation labels Aug 14, 2026
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 45e850c1-8a0c-4c14-97ba-1a05f97c5024

📥 Commits

Reviewing files that changed from the base of the PR and between 3585b1f and d2941d5.

📒 Files selected for processing (1)
  • .storybook/components/DocContainer.tsx

📝 Walkthrough

Walkthrough

DocContainer now reads dark-mode state from useDarkMode(). It removes direct channel handling, related state and effects, and the initial null render guard.

Changes

Dark Mode Integration

Layer / File(s) Summary
Hook-based dark-mode state
.storybook/components/DocContainer.tsx
DocContainer uses useDarkMode() instead of subscribing to the Storybook channel. It removes the event-driven state initialization and mount guard.

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: ⚪ Minimal · up to d2941

This is a localized Storybook documentation fix, and no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Storybook Safari blank-content fix, which matches the main change in DocContainer.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/DS-5437

Warning

Tools execution failed with the following error:

Failed to run tools: 14 UNAVAILABLE: read ECONNRESET


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit d2941d5):

https://react-koobiq-next--prs-459-zbo9eydz.web.app

(expires Wed, 19 Aug 2026 11:46:43 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where documentation pages rendered blank in Safari within the Storybook docs container. Previously, DocContainer initialized its dark-mode state via useState() (undefined by default) and only populated it after receiving a DARK_MODE_EVENT_NAME channel event, returning null until then. In Safari, that event apparently did not fire reliably, so the guard if (!themeIsMounted) return null left the content blank. The change replaces the manual channel subscription with the addon's own useDarkMode() hook, which returns the current dark-mode state synchronously, so content renders immediately.

Changes:

  • Replaced manual addons.getChannel() + DARK_MODE_EVENT_NAME subscription and useState/useEffect with the useDarkMode() hook.
  • Removed the themeIsMounted gate that returned null, allowing documentation to render immediately.
  • Cleaned up now-unused imports (useEffect, useState, isNotNil, DARK_MODE_EVENT_NAME, addons).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@KamilEmeleev
KamilEmeleev merged commit 66d2da1 into main Aug 14, 2026
9 checks passed
@KamilEmeleev
KamilEmeleev deleted the docs/DS-5437 branch August 14, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants