Skip to content

Commit

Permalink
Merge pull request #334 from mellm0/add-param-key
Browse files Browse the repository at this point in the history
Add `paramKey: "chromatic"` to allow disabling the VTA panel through story parameters
  • Loading branch information
ghengeveld authored Aug 29, 2024
2 parents a6ddf15 + ca3d66e commit 97ad164
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const SELECTED_BROWSER_ID = `${ADDON_ID}/selectedBrowserId`;
export const TELEMETRY = `${ADDON_ID}/telemetry`;
export const ENABLE_FILTER = `${ADDON_ID}/enableFilter`;
export const REMOVE_ADDON = `${ADDON_ID}/removeAddon`;
export const PARAM_KEY = "chromatic";

export const CONFIG_OVERRIDES = {
// Local changes should never be auto-accepted
Expand Down
3 changes: 2 additions & 1 deletion src/manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from "react";

import { SidebarBottom } from "./components/SidebarBottom";
import { SidebarTop } from "./components/SidebarTop";
import { ADDON_ID, PANEL_ID, SIDEBAR_BOTTOM_ID, SIDEBAR_TOP_ID } from "./constants";
import { ADDON_ID, PANEL_ID, PARAM_KEY, SIDEBAR_BOTTOM_ID, SIDEBAR_TOP_ID } from "./constants";
import { Panel } from "./Panel";

let heartbeatTimeout: NodeJS.Timeout;
Expand All @@ -18,6 +18,7 @@ addons.register(ADDON_ID, (api) => {
addons.add(PANEL_ID, {
type: Addon_TypesEnum.PANEL,
title: "Visual Tests",
paramKey: PARAM_KEY,
match: ({ viewMode }) => viewMode === "story",
render: ({ active }) => <Panel active={!!active} api={api} />,
});
Expand Down

0 comments on commit 97ad164

Please sign in to comment.