Skip to content

Conversation

@myieye
Copy link
Collaborator

@myieye myieye commented Sep 10, 2025

Currently pnpm storybook results in storybook opening 0.0.0.0:6006 in your browser, which doesn't work.

@coderabbitai
Copy link

coderabbitai bot commented Sep 10, 2025

📝 Walkthrough

Walkthrough

Added an async viteFinal hook to Storybook’s Vite config to set server.host to 0.0.0.0. Correspondingly, removed the --host 0.0.0.0 flag from the Storybook npm script, keeping the port unchanged. No other configuration or scripts were modified.

Changes

Cohort / File(s) Summary
Storybook config
frontend/viewer/.storybook/main.ts
Introduces async viteFinal(config) that merges existing config.server and sets server.host to 0.0.0.0, returning the modified config.
Package scripts
frontend/viewer/package.json
Updates storybook script from storybook dev -p 6006 --host 0.0.0.0 to storybook dev -p 6006.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The current title succinctly captures the primary goal of the changeset—preventing Storybook from attempting to open a browser window at 0.0.0.0—and aligns directly with the modifications to both the Storybook configuration and the npm script. It is concise, specific, and avoids unnecessary detail or vague phrasing.
Description Check ✅ Passed The description clearly explains the user-facing problem—Storybook launching at 0.0.0.0:6006, which fails in typical browser contexts—and directly relates to the changes made in the configuration and script. It succinctly outlines the motivation for the PR without veering off-topic.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I nibbled configs, hop by hop,
Moved host from script to Vite’s workshop.
Port stays put, the tales still flow,
Stories bind where breezes blow.
Ears up—0.0.0.0!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dont-open-storybook-to-0.0.0.0

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 and usage tips.

@github-actions github-actions bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Sep 10, 2025
@myieye myieye force-pushed the dont-open-storybook-to-0.0.0.0 branch from ae3bb35 to 26dbca9 Compare September 10, 2025 11:53
@github-actions
Copy link

github-actions bot commented Sep 10, 2025

UI unit Tests

  1 files  ±0   45 suites  ±0   27s ⏱️ -1s
110 tests ±0  110 ✅ ±0  0 💤 ±0  0 ❌ ±0 
158 runs  ±0  158 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f1add45. ± Comparison against base commit 87b7574.

♻️ This comment has been updated with latest results.

@argos-ci
Copy link

argos-ci bot commented Sep 10, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Sep 10, 2025, 1:41 PM

@github-actions
Copy link

github-actions bot commented Sep 10, 2025

C# Unit Tests

130 tests   130 ✅  19s ⏱️
 20 suites    0 💤
  1 files      0 ❌

Results for commit f1add45.

♻️ This comment has been updated with latest results.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
frontend/viewer/package.json (1)

31-31: Optional: add a safety fallback to prevent any unwanted auto-open.

If anyone still sees 0.0.0.0 being opened by tooling, consider adding --no-open here and letting Vite/Storybook print URLs only.

-    "storybook": "storybook dev -p 6006",
+    "storybook": "storybook dev -p 6006 --no-open",
frontend/viewer/.storybook/main.ts (2)

19-26: Reduce shadowing and improve types.

Rename the param to avoid shadowing the top-level config and add a Vite type.

-  async viteFinal(config) {
-    config.server = {
-      ...(config.server ?? {}),
+  async viteFinal(viteConfig: import('vite').InlineConfig) {
+    viteConfig.server = {
+      ...(viteConfig.server ?? {}),
       host: '0.0.0.0',
     };
-    return config;
+    return viteConfig;
   },

19-26: Consider host: true and explicitly pin what opens.

Using Vite’s idiomatic host: true binds to all interfaces without hardcoding the IP; optionally set server.open to 'http://localhost:6006' if anyone still sees 0.0.0.0 opened.

-      host: '0.0.0.0',
+      host: true,
+      // Optional: force the browser to open localhost instead of inferring from host binding
+      // open: 'http://localhost:6006',
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87b7574 and f1add45.

📒 Files selected for processing (2)
  • frontend/viewer/.storybook/main.ts (1 hunks)
  • frontend/viewer/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Build UI / publish-ui
  • GitHub Check: Build API / publish-api
  • GitHub Check: check-and-lint
  • GitHub Check: frontend-component-unit-tests
  • GitHub Check: frontend
  • GitHub Check: Build FW Lite and run tests
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (1)
frontend/viewer/package.json (1)

31-31: CLI flag removal LGTM; matches the goal.

This avoids Storybook opening 0.0.0.0 directly. Keep as-is.

@myieye myieye merged commit 3bf7e37 into develop Sep 10, 2025
27 checks passed
@myieye myieye deleted the dont-open-storybook-to-0.0.0.0 branch September 10, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants