Skip to content

feat(storybook): add DataVis NITRO WithPerspectives story - #416

Merged
garrity-miepub merged 6 commits into
mainfrom
feature/datavis-perspectives-story
Sep 3, 2026
Merged

feat(storybook): add DataVis NITRO WithPerspectives story#416
garrity-miepub merged 6 commits into
mainfrom
feature/datavis-perspectives-story

Conversation

@garrity-miepub

Copy link
Copy Markdown
Collaborator

Summary

Adds a WithPerspectives story to the DataVis NITRO Storybook page so the perspective toolbar (the "Main Perspective" dropdown with save / reset / undo-redo history) is visible and testable — matching what https://mieweb.github.io/datavis/ shows.

Details

  • New PerspectivesGrid helper reads the shared view from DataVisNitroContext, creates a datavis-ace Prefs module with a localStorage backend, binds it via view.setPrefs(prefs), and passes it to <DataVisNitroGrid prefs={…}>.
  • datavis-ace is untyped JS (Prefs is built with a runtime makeSubclass helper), so the story casts it to an explicit constructor signature returning PrefsInstance.
  • Perspectives persist to localStorage under mieweb-ui-storybook:datavis-prefs.

Verification

  • Verified in Storybook: grid renders 53 rows and the hamburger menu shows the Preferences section (Main Perspective combobox, Reset, Back, Forward, Rename, Delete).
  • pnpm typecheck, eslint, and prettier all pass.

Bind a localStorage-backed datavis-ace Prefs module to the shared view so the perspective toolbar (Main Perspective dropdown, save/reset/history) renders in Storybook.
Copilot AI lite review requested due to automatic review settings September 3, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Storybook story for DataVisNitroGrid that wires up a datavis-ace Prefs module so the Perspectives UI (toolbar / hamburger menu) is visible and testable in Storybook, aligning behavior with the external DataVis demo.

Changes:

  • Import and type-cast datavis-ace’s untyped Prefs constructor to a PrefsInstance constructor signature.
  • Add a PerspectivesGrid helper that creates a localStorage-backed prefs module, binds it to the shared view from DataVisNitroContext, and passes it into <DataVisNitroGrid prefs={...} />.
  • Add a WithPerspectives Storybook story with documentation explaining how prefs enable the perspectives toolbar and persistence.

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

Comment thread src/components/DataVisNITRO/DataVisNITRO.stories.tsx Outdated
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 3, 2026

Copy link
Copy Markdown

Deploying ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: ad4a864
Status: ✅  Deploy successful!
Preview URL: https://84a4b6ce.ui-6d0.pages.dev
Branch Preview URL: https://feature-datavis-perspectives.ui-6d0.pages.dev

View logs

Address Copilot review: bind prefs to the view and prime it in a useEffect instead of inside useMemo, which can re-run under StrictMode.
Copilot AI review requested due to automatic review settings September 3, 2026 21:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/components/DataVisNITRO/DataVisNITRO.stories.tsx
Address Copilot review: clear the story's localStorage prefs key via a loader when navigator.webdriver is set, so test runners start from a clean default state while preserving persistence for manual browsing.
Copilot AI review requested due to automatic review settings September 3, 2026 21:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/components/DataVisNITRO/DataVisNITRO.stories.tsx Outdated
Address Copilot review: wrap the loader's localStorage.removeItem in try/catch so a SecurityError in restricted/embedded contexts falls back to default perspectives instead of crashing the story.
Copilot AI review requested due to automatic review settings September 3, 2026 22:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

The npm audit endpoint (registry.npmjs.org/-/npm/v1/security/audits)
has intermittent outages that fail CI with ERR_SOCKET_TIMEOUT even
though no vulnerability exists (run #1915 failed twice on this).
Detect network errors in the audit output and emit a warning instead
of failing; genuine high-severity findings still fail the job.
Copilot AI review requested due to automatic review settings September 3, 2026 23:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@garrity-miepub
garrity-miepub merged commit 201c054 into main Sep 3, 2026
11 checks passed
@garrity-miepub
garrity-miepub deleted the feature/datavis-perspectives-story branch September 3, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants