Skip to content

Commit 60e796f

Browse files
Preview and Draft support (#99)
1 parent 2a3fcbb commit 60e796f

18 files changed

+1681
-199
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ Some notes
6464

6565
## Changelog
6666

67+
*1.1.1* (2025-03-17)
68+
- Choose between live, draft, and inactive revisions of features using the GrowthBook API
69+
- Quickly apply feature overrides from feature rules
70+
- Show feature descriptions and other meta information from the API
71+
6772
*1.1.0* (2025-03-11)
6873
- Share DevTools session by link
6974
- Import/export DevTools session by JSON blob

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gb-devtools",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"private": true,
55
"scripts": {
66
"dev": "webpack --config webpack/webpack.dev.js --watch",
@@ -40,8 +40,10 @@
4040
"query-string": "^9.1.0",
4141
"react": "^18.2.0",
4242
"react-dom": "^18.2.0",
43+
"remark-gfm": "^4.0.1",
4344
"react-hook-form": "^7.52.2",
4445
"react-icons": "^5.3.0",
46+
"react-markdown": "^10.1.0",
4547
"react-select": "^5.10.0",
4648
"react-syntax-highlighter": "^15.5.0",
4749
"react-textarea-autosize": "^8.5.3",

public/manifest.chrome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"name": "GrowthBook DevTools",
55
"description": "GrowthBook DevTools helps you debug feature flags and experiments and design A/B tests visually — all from your browser.",
6-
"version": "1.1.0",
6+
"version": "1.1.1",
77

88
"content_scripts": [
99
{

public/manifest.firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"name": "GrowthBook DevTools",
55
"description": "GrowthBook DevTools helps you debug feature flags and experiments and design A/B tests visually — all from your browser.",
6-
"version": "1.1.0",
6+
"version": "1.1.1",
77

88
"browser_specific_settings": {
99
"gecko": {

src/app/components/EditableValueField.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ export default function EditableValueField({
99
value,
1010
setValue,
1111
valueType = "string",
12+
resetInputOnChange = false,
1213
}: {
1314
value: any;
1415
setValue: (v: any) => void;
1516
valueType?: ValueType;
17+
resetInputOnChange?: boolean;
1618
}) {
1719
const [forcedValueType, setForcedValueType] = useState<ValueType>(valueType);
1820
const formattedValue =
@@ -41,7 +43,17 @@ export default function EditableValueField({
4143
}, []);
4244

4345
useEffect(() => {
44-
if (!editing) {
46+
if (valueType) {
47+
setForcedValueType(valueType);
48+
if (valueType !== "json" && valueType !== "unknown") {
49+
setEditing(true);
50+
}
51+
}
52+
}, [valueType]);
53+
54+
// underlying value changes, reset the field?
55+
useEffect(() => {
56+
if (!editing || resetInputOnChange) {
4557
setEditedValue(formattedValue);
4658
}
4759
}, [value]);
@@ -124,7 +136,7 @@ export default function EditableValueField({
124136
<input
125137
className="rt-reset rt-TextFieldInput"
126138
type="number"
127-
value={editedValue}
139+
value={editedValue ?? ""}
128140
onChange={(e) => {
129141
const v = e.target.value;
130142
setEditedValue(v);
@@ -165,7 +177,7 @@ export default function EditableValueField({
165177
>
166178
<TextareaAutosize
167179
name={"__JSON_value__"}
168-
value={editedValue}
180+
value={editedValue ?? ""}
169181
onChange={(e) => {
170182
const v = e.target.value;
171183
setEditedValue(v);

src/app/components/ExperimentDetail.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import { AutoExperimentVariation, isURLTargeted } from "@growthbook/growthbook";
3636
import clsx from "clsx";
3737
import DebugLogger, { DebugLogAccordion } from "@/app/components/DebugLogger";
3838
import { TbEyeSearch } from "react-icons/tb";
39+
import useApi from "@/app/hooks/useApi";
40+
import { SDKAttribute } from "@/app/gbTypes";
3941

4042
export default function ExperimentDetail({
4143
selectedEid,
@@ -171,7 +173,7 @@ export default function ExperimentDetail({
171173
<div className="content">
172174
{selectedExperiment?.experiment?.isDraft ? (
173175
<Callout.Root
174-
color="cyan"
176+
color="indigo"
175177
size="1"
176178
className="py-1.5 px-2 mt-2 mb-4"
177179
>

src/app/components/ExperimentsTab.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export type ExperimentWithFeatures = (AutoExperiment | Experiment<any>) & {
2929
features?: string[];
3030
featureTypes?: Record<string, ValueType>;
3131
isDraft?: boolean;
32+
isInactive?: boolean;
3233
};
3334

3435
export const LEFT_PERCENT = 0.4;
@@ -286,7 +287,7 @@ export default function ExperimentsTab() {
286287
forced={isForced}
287288
type="experiment"
288289
/>
289-
{selectedExperiment?.experiment?.isDraft ? (
290+
{experiment?.isDraft ? (
290291
<TbEyeSearch
291292
className="inline-block mr-1 opacity-50"
292293
size={12}
@@ -305,28 +306,28 @@ export default function ExperimentsTab() {
305306
<div className="flex items-center gap-2 pr-0.5">
306307
{types.redirect ? (
307308
<Tooltip content="URL Redirect experiment">
308-
<button>
309+
<span>
309310
<PiLinkBold size={12} />
310-
</button>
311+
</span>
311312
</Tooltip>
312313
) : null}
313314
{types.visual ? (
314315
<Tooltip content="Visual Editor experiment">
315-
<button>
316+
<span>
316317
<PiDesktopFill size={12} />
317-
</button>
318+
</span>
318319
</Tooltip>
319320
) : null}
320321
{types.features ? (
321322
<Tooltip content="Feature flag experiment">
322-
<button>
323+
<span>
323324
<PiFlagFill className="inline-block" size={12} />
324325
{fullWidthListView ? (
325326
<span className="ml-1">
326327
{types.features.length}
327328
</span>
328329
) : null}
329-
</button>
330+
</span>
330331
</Tooltip>
331332
) : null}
332333
</div>

0 commit comments

Comments
 (0)