@terreno/ui 57.7.0 → 57.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.d.ts +1 -1
- package/dist/AreaChart.d.ts.map +1 -1
- package/dist/AreaChart.js +70 -22
- package/dist/AreaChart.js.map +1 -1
- package/dist/Avatar.js +2 -2
- package/dist/Avatar.js.map +1 -1
- package/dist/BarChart.d.ts.map +1 -1
- package/dist/BarChart.js +55 -13
- package/dist/BarChart.js.map +1 -1
- package/dist/Button.js +2 -2
- package/dist/Button.js.map +1 -1
- package/dist/ChartCard.d.ts +5 -0
- package/dist/ChartCard.d.ts.map +1 -0
- package/dist/ChartCard.js +18 -0
- package/dist/ChartCard.js.map +1 -0
- package/dist/Common.d.ts +128 -5
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js.map +1 -1
- package/dist/DashboardGrid.d.ts +6 -2
- package/dist/DashboardGrid.d.ts.map +1 -1
- package/dist/DashboardGrid.js +43 -10
- package/dist/DashboardGrid.js.map +1 -1
- package/dist/DateTimeActionSheet.js +2 -2
- package/dist/DateTimeActionSheet.js.map +1 -1
- package/dist/DateTimeField.js +3 -3
- package/dist/DateTimeField.js.map +1 -1
- package/dist/DonutChart.d.ts.map +1 -1
- package/dist/DonutChart.js +20 -10
- package/dist/DonutChart.js.map +1 -1
- package/dist/DropdownMenuItem.d.ts +16 -0
- package/dist/DropdownMenuItem.d.ts.map +1 -0
- package/dist/DropdownMenuItem.js +11 -0
- package/dist/DropdownMenuItem.js.map +1 -0
- package/dist/DropdownPanel.d.ts.map +1 -1
- package/dist/DropdownPanel.js +1 -1
- package/dist/DropdownPanel.js.map +1 -1
- package/dist/FilePickerButton.d.ts.map +1 -1
- package/dist/FilePickerButton.js +70 -10
- package/dist/FilePickerButton.js.map +1 -1
- package/dist/GPTChat.d.ts.map +1 -1
- package/dist/GPTChat.js +103 -14
- package/dist/GPTChat.js.map +1 -1
- package/dist/HeightField.js +2 -2
- package/dist/HeightField.js.map +1 -1
- package/dist/IconButton.d.ts.map +1 -1
- package/dist/IconButton.js +9 -6
- package/dist/IconButton.js.map +1 -1
- package/dist/LineChart.d.ts +1 -1
- package/dist/LineChart.d.ts.map +1 -1
- package/dist/LineChart.js +62 -21
- package/dist/LineChart.js.map +1 -1
- package/dist/MediaQuery.d.ts +10 -0
- package/dist/MediaQuery.d.ts.map +1 -1
- package/dist/MediaQuery.js +13 -1
- package/dist/MediaQuery.js.map +1 -1
- package/dist/MultiselectField.js +2 -2
- package/dist/MultiselectField.js.map +1 -1
- package/dist/RadioField.js +2 -2
- package/dist/RadioField.js.map +1 -1
- package/dist/Scorecard.d.ts +5 -0
- package/dist/Scorecard.d.ts.map +1 -0
- package/dist/Scorecard.js +11 -0
- package/dist/Scorecard.js.map +1 -0
- package/dist/SparklineChart.d.ts +5 -0
- package/dist/SparklineChart.d.ts.map +1 -0
- package/dist/SparklineChart.js +35 -0
- package/dist/SparklineChart.js.map +1 -0
- package/dist/SplitPage.d.ts +1 -1
- package/dist/SplitPage.d.ts.map +1 -1
- package/dist/SplitPage.js +126 -21
- package/dist/SplitPage.js.map +1 -1
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +12 -4
- package/dist/TextField.js.map +1 -1
- package/dist/ToastNotifications.d.ts.map +1 -1
- package/dist/ToastNotifications.js +29 -6
- package/dist/ToastNotifications.js.map +1 -1
- package/dist/UnifiedAddressAutoComplete.js +2 -2
- package/dist/UnifiedAddressAutoComplete.js.map +1 -1
- package/dist/WebDropdownMenu.d.ts +2 -1
- package/dist/WebDropdownMenu.d.ts.map +1 -1
- package/dist/WebDropdownMenu.js +2 -6
- package/dist/WebDropdownMenu.js.map +1 -1
- package/dist/charts/ChartFacadeContainer.d.ts +10 -0
- package/dist/charts/ChartFacadeContainer.d.ts.map +1 -0
- package/dist/charts/ChartFacadeContainer.js +10 -0
- package/dist/charts/ChartFacadeContainer.js.map +1 -0
- package/dist/charts/ChartFrame.d.ts +4 -0
- package/dist/charts/ChartFrame.d.ts.map +1 -1
- package/dist/charts/ChartFrame.js +4 -2
- package/dist/charts/ChartFrame.js.map +1 -1
- package/dist/charts/layout.d.ts +9 -2
- package/dist/charts/layout.d.ts.map +1 -1
- package/dist/charts/layout.js +28 -6
- package/dist/charts/layout.js.map +1 -1
- package/dist/charts/scales.d.ts +3 -1
- package/dist/charts/scales.d.ts.map +1 -1
- package/dist/charts/scales.js +7 -7
- package/dist/charts/scales.js.map +1 -1
- package/dist/charts/series.d.ts +15 -0
- package/dist/charts/series.d.ts.map +1 -0
- package/dist/charts/series.js +19 -0
- package/dist/charts/series.js.map +1 -0
- package/dist/charts/types/chartTypes.d.ts +7 -0
- package/dist/charts/types/chartTypes.d.ts.map +1 -1
- package/dist/dashboardGridLayout.d.ts +6 -0
- package/dist/dashboardGridLayout.d.ts.map +1 -1
- package/dist/dashboardGridLayout.js +19 -3
- package/dist/dashboardGridLayout.js.map +1 -1
- package/dist/fieldElements/FieldTitle.js +2 -2
- package/dist/fieldElements/FieldTitle.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lazyBoundaries/heavyOptionalExports.d.ts +9 -0
- package/dist/lazyBoundaries/heavyOptionalExports.d.ts.map +1 -1
- package/dist/lazyBoundaries/heavyOptionalExports.js +6 -0
- package/dist/lazyBoundaries/heavyOptionalExports.js.map +1 -1
- package/dist/resolveDocumentBodyPortalTarget.d.ts +7 -0
- package/dist/resolveDocumentBodyPortalTarget.d.ts.map +1 -0
- package/dist/resolveDocumentBodyPortalTarget.js +12 -0
- package/dist/resolveDocumentBodyPortalTarget.js.map +1 -0
- package/package.json +1 -1
- package/src/AIRequestExplorer.test.tsx +2 -2
- package/src/AreaChart.test.tsx +81 -0
- package/src/AreaChart.tsx +171 -62
- package/src/Avatar.tsx +2 -2
- package/src/BarChart.test.tsx +119 -0
- package/src/BarChart.tsx +94 -20
- package/src/Button.test.tsx +7 -7
- package/src/Button.tsx +2 -2
- package/src/ChartCard.test.tsx +79 -0
- package/src/ChartCard.tsx +80 -0
- package/src/Common.ts +119 -2
- package/src/DashboardGrid.test.tsx +98 -1
- package/src/DashboardGrid.tsx +71 -20
- package/src/DateTimeActionSheet.tsx +4 -4
- package/src/DateTimeField.test.tsx +5 -4
- package/src/DateTimeField.tsx +3 -3
- package/src/DonutChart.test.tsx +73 -0
- package/src/DonutChart.tsx +87 -14
- package/src/DropdownMenuItem.tsx +48 -0
- package/src/DropdownPanel.test.tsx +12 -0
- package/src/DropdownPanel.tsx +8 -1
- package/src/FilePickerButton.test.tsx +60 -6
- package/src/FilePickerButton.tsx +116 -28
- package/src/GPTChat.test.tsx +133 -6
- package/src/GPTChat.tsx +196 -38
- package/src/HeightField.tsx +2 -2
- package/src/IconButton.test.tsx +63 -0
- package/src/IconButton.tsx +10 -5
- package/src/LineChart.test.tsx +104 -0
- package/src/LineChart.tsx +154 -58
- package/src/MediaQuery.ts +14 -1
- package/src/MultiselectField.tsx +2 -2
- package/src/RadioField.tsx +2 -2
- package/src/Scorecard.test.tsx +65 -0
- package/src/Scorecard.tsx +45 -0
- package/src/SparklineChart.test.tsx +69 -0
- package/src/SparklineChart.tsx +85 -0
- package/src/SplitPage.test.tsx +449 -11
- package/src/SplitPage.tsx +255 -21
- package/src/TextField.test.tsx +16 -0
- package/src/TextField.tsx +13 -3
- package/src/ToastNotifications.tsx +33 -6
- package/src/ToastNotifications.webModal.test.tsx +285 -0
- package/src/UnifiedAddressAutoComplete.test.tsx +4 -4
- package/src/UnifiedAddressAutoComplete.tsx +2 -2
- package/src/WebDropdownMenu.tsx +3 -7
- package/src/__snapshots__/DropdownPanel.test.tsx.snap +3 -1
- package/src/bunSetup.ts +3 -1
- package/src/charts/ChartFacadeContainer.tsx +35 -0
- package/src/charts/ChartFrame.tsx +39 -1
- package/src/charts/layout.test.ts +22 -1
- package/src/charts/layout.ts +37 -4
- package/src/charts/scales.test.ts +33 -0
- package/src/charts/scales.ts +10 -6
- package/src/charts/series.ts +43 -0
- package/src/charts/types/chartTypes.ts +8 -0
- package/src/dashboardGridLayout.test.ts +59 -1
- package/src/dashboardGridLayout.ts +30 -3
- package/src/fieldElements/FieldTitle.tsx +2 -2
- package/src/index.tsx +6 -0
- package/src/lazyBoundaries/heavyOptionalExports.tsx +21 -0
- package/src/resolveDocumentBodyPortalTarget.ts +11 -0
package/src/GPTChat.test.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {afterAll, afterEach, describe, it, mock} from "bun:test";
|
|
2
2
|
import {act, fireEvent, render, waitFor} from "@testing-library/react-native";
|
|
3
3
|
import {assert} from "chai";
|
|
4
|
+
import {setImageAsync, setStringAsync} from "expo-clipboard";
|
|
4
5
|
import React from "react";
|
|
5
6
|
import {Platform, Pressable, ScrollView} from "react-native";
|
|
6
7
|
|
|
@@ -11,8 +12,8 @@ import {Text} from "./Text";
|
|
|
11
12
|
import {ThemeProvider} from "./Theme";
|
|
12
13
|
import {renderWithTheme} from "./test-utils";
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
-
|
|
15
|
+
const mockedSetImageAsync = setImageAsync as unknown as ReturnType<typeof mock>;
|
|
16
|
+
const mockedSetStringAsync = setStringAsync as unknown as ReturnType<typeof mock>;
|
|
16
17
|
|
|
17
18
|
const pickedDocument = {mimeType: "text/plain", name: "notes.txt", uri: "file:///notes.txt"};
|
|
18
19
|
mock.module("expo-document-picker", () => ({
|
|
@@ -91,6 +92,7 @@ describe("GPTChat", () => {
|
|
|
91
92
|
|
|
92
93
|
await press(getByLabelText("Select chat: First chat"));
|
|
93
94
|
await press(getByTestId("gpt-new-chat-button"));
|
|
95
|
+
await press(getByTestId("gpt-history-menu-h2"));
|
|
94
96
|
await press(getByTestId("gpt-delete-history-h2"));
|
|
95
97
|
|
|
96
98
|
assert.deepEqual(onSelectHistory.mock.calls, [["h1"]]);
|
|
@@ -102,6 +104,7 @@ describe("GPTChat", () => {
|
|
|
102
104
|
const onUpdateTitle = mock((_id: string, _title: string) => {});
|
|
103
105
|
const {getByTestId} = renderChat({onUpdateTitle});
|
|
104
106
|
|
|
107
|
+
await press(getByTestId("gpt-history-menu-h1"));
|
|
105
108
|
await press(getByTestId("gpt-rename-history-h1"));
|
|
106
109
|
fireEvent.changeText(getByTestId("gpt-rename-input-h1"), "Renamed");
|
|
107
110
|
await press(getByTestId("gpt-rename-save-h1"));
|
|
@@ -113,6 +116,7 @@ describe("GPTChat", () => {
|
|
|
113
116
|
const onUpdateTitle = mock((_id: string, _title: string) => {});
|
|
114
117
|
const {getByTestId} = renderChat({onUpdateTitle});
|
|
115
118
|
|
|
119
|
+
await press(getByTestId("gpt-history-menu-h2"));
|
|
116
120
|
await press(getByTestId("gpt-rename-history-h2"));
|
|
117
121
|
fireEvent.changeText(getByTestId("gpt-rename-input-h2"), " ");
|
|
118
122
|
fireEvent(getByTestId("gpt-rename-input-h2"), "blur");
|
|
@@ -120,10 +124,31 @@ describe("GPTChat", () => {
|
|
|
120
124
|
assert.equal(onUpdateTitle.mock.calls.length, 0);
|
|
121
125
|
});
|
|
122
126
|
|
|
123
|
-
it("hides the rename
|
|
124
|
-
const {queryByTestId} = renderChat();
|
|
127
|
+
it("hides the rename action when renaming is not supported", async () => {
|
|
128
|
+
const {getByTestId, queryByTestId} = renderChat();
|
|
129
|
+
|
|
130
|
+
await press(getByTestId("gpt-history-menu-h1"));
|
|
125
131
|
|
|
126
132
|
assert.isNull(queryByTestId("gpt-rename-history-h1"));
|
|
133
|
+
assert.isOk(getByTestId("gpt-delete-history-h1"));
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it("keeps rename and delete inside a per-row overflow menu", async () => {
|
|
137
|
+
const {getByTestId, queryByTestId} = renderChat({onUpdateTitle: () => {}});
|
|
138
|
+
|
|
139
|
+
assert.isOk(getByTestId("gpt-history-menu-h1"));
|
|
140
|
+
assert.isNull(queryByTestId("gpt-rename-history-h1"));
|
|
141
|
+
assert.isNull(queryByTestId("gpt-delete-history-h1"));
|
|
142
|
+
|
|
143
|
+
await press(getByTestId("gpt-history-menu-h1"));
|
|
144
|
+
|
|
145
|
+
assert.isOk(getByTestId("gpt-rename-history-h1"));
|
|
146
|
+
assert.isOk(getByTestId("gpt-delete-history-h1"));
|
|
147
|
+
|
|
148
|
+
await press(getByTestId("gpt-rename-history-h1"));
|
|
149
|
+
|
|
150
|
+
assert.isNull(queryByTestId("gpt-delete-history-h1"));
|
|
151
|
+
assert.isOk(getByTestId("gpt-rename-input-h1"));
|
|
127
152
|
});
|
|
128
153
|
|
|
129
154
|
it("renders a model selector only when models and a change handler are given", () => {
|
|
@@ -562,7 +587,7 @@ describe("GPTChat", () => {
|
|
|
562
587
|
});
|
|
563
588
|
|
|
564
589
|
it("copies an assistant message to the clipboard", async () => {
|
|
565
|
-
|
|
590
|
+
mockedSetStringAsync.mockClear();
|
|
566
591
|
const {getByTestId} = renderChat({
|
|
567
592
|
currentMessages: [{content: "Copy me", role: "assistant"}],
|
|
568
593
|
});
|
|
@@ -571,7 +596,63 @@ describe("GPTChat", () => {
|
|
|
571
596
|
fireEvent.press(getByTestId("gpt-copy-msg-0"));
|
|
572
597
|
});
|
|
573
598
|
|
|
574
|
-
assert.deepEqual(
|
|
599
|
+
assert.deepEqual(mockedSetStringAsync.mock.calls, [["Copy me"]]);
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
it("copies the image, not placeholder text, for an image-only reply", async () => {
|
|
603
|
+
mockedSetStringAsync.mockClear();
|
|
604
|
+
mockedSetImageAsync.mockClear();
|
|
605
|
+
const {getByTestId} = renderChat({
|
|
606
|
+
currentMessages: [
|
|
607
|
+
{
|
|
608
|
+
content: "",
|
|
609
|
+
contentParts: [{mimeType: "image/png", type: "image", url: "data:image/png;base64,AAAA"}],
|
|
610
|
+
role: "assistant",
|
|
611
|
+
},
|
|
612
|
+
],
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
await press(getByTestId("gpt-copy-msg-0"));
|
|
616
|
+
|
|
617
|
+
assert.deepEqual(mockedSetImageAsync.mock.calls, [["AAAA"]]);
|
|
618
|
+
assert.equal(mockedSetStringAsync.mock.calls.length, 0);
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
it("offers a copy-image action on generated images", async () => {
|
|
622
|
+
mockedSetImageAsync.mockClear();
|
|
623
|
+
const {getByTestId} = renderChat({
|
|
624
|
+
currentMessages: [
|
|
625
|
+
{
|
|
626
|
+
content: "Here you go",
|
|
627
|
+
contentParts: [{mimeType: "image/png", type: "image", url: "data:image/png;base64,BBBB"}],
|
|
628
|
+
role: "assistant",
|
|
629
|
+
},
|
|
630
|
+
],
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
await press(getByTestId("gpt-copy-image"));
|
|
634
|
+
|
|
635
|
+
assert.deepEqual(mockedSetImageAsync.mock.calls, [["BBBB"]]);
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
it("grows the composer up to a maximum height and resets after sending", async () => {
|
|
639
|
+
const {getByTestId} = renderChat();
|
|
640
|
+
const input = getByTestId("gpt-input");
|
|
641
|
+
fireEvent.changeText(input, "Long pasted notes");
|
|
642
|
+
|
|
643
|
+
fireEvent(input, "contentSizeChange", {nativeEvent: {contentSize: {height: 120, width: 100}}});
|
|
644
|
+
const grownStyle = [getByTestId("gpt-input").props.style].flat(Infinity);
|
|
645
|
+
assert.isTrue(grownStyle.some((style) => style?.height === 120));
|
|
646
|
+
|
|
647
|
+
fireEvent(getByTestId("gpt-input"), "contentSizeChange", {
|
|
648
|
+
nativeEvent: {contentSize: {height: 900, width: 100}},
|
|
649
|
+
});
|
|
650
|
+
const cappedStyle = [getByTestId("gpt-input").props.style].flat(Infinity);
|
|
651
|
+
assert.isTrue(cappedStyle.some((style) => style?.height === 200));
|
|
652
|
+
|
|
653
|
+
await press(getByTestId("gpt-submit"));
|
|
654
|
+
const resetStyle = [getByTestId("gpt-input").props.style].flat(Infinity);
|
|
655
|
+
assert.isTrue(resetStyle.some((style) => style?.height === 40));
|
|
575
656
|
});
|
|
576
657
|
|
|
577
658
|
it("disables input and the attachment picker while streaming", () => {
|
|
@@ -619,6 +700,51 @@ describe("GPTChat", () => {
|
|
|
619
700
|
assert.isNull(queryByText("Scroll to bottom"));
|
|
620
701
|
});
|
|
621
702
|
|
|
703
|
+
it("never shows scroll to bottom in an empty chat", async () => {
|
|
704
|
+
const {getByTestId, queryByText, UNSAFE_getByType} = renderChat({currentMessages: []});
|
|
705
|
+
|
|
706
|
+
fireEvent(getByTestId("gpt-viewport"), "layout", {
|
|
707
|
+
nativeEvent: {layout: {height: 200, width: 100, x: 0, y: 0}},
|
|
708
|
+
});
|
|
709
|
+
fireEvent(getByTestId("gpt-messages"), "layout", {
|
|
710
|
+
nativeEvent: {layout: {height: 600, width: 100, x: 0, y: 0}},
|
|
711
|
+
});
|
|
712
|
+
await act(async () => {
|
|
713
|
+
fireEvent.scroll(UNSAFE_getByType(ScrollView), {
|
|
714
|
+
nativeEvent: {contentOffset: {x: 0, y: 0}},
|
|
715
|
+
});
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
assert.isNull(queryByText("Scroll to bottom"));
|
|
719
|
+
});
|
|
720
|
+
|
|
721
|
+
it("hides scroll to bottom once the content fits the viewport", async () => {
|
|
722
|
+
const {getByTestId, getByText, queryByText, UNSAFE_getByType} = renderChat({
|
|
723
|
+
currentMessages: [{content: "Hello!", role: "assistant"}],
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
fireEvent(getByTestId("gpt-viewport"), "layout", {
|
|
727
|
+
nativeEvent: {layout: {height: 200, width: 100, x: 0, y: 0}},
|
|
728
|
+
});
|
|
729
|
+
fireEvent(getByTestId("gpt-messages"), "layout", {
|
|
730
|
+
nativeEvent: {layout: {height: 600, width: 100, x: 0, y: 0}},
|
|
731
|
+
});
|
|
732
|
+
await act(async () => {
|
|
733
|
+
fireEvent.scroll(UNSAFE_getByType(ScrollView), {
|
|
734
|
+
nativeEvent: {contentOffset: {x: 0, y: 0}},
|
|
735
|
+
});
|
|
736
|
+
});
|
|
737
|
+
assert.isOk(getByText("Scroll to bottom"));
|
|
738
|
+
|
|
739
|
+
await act(async () => {
|
|
740
|
+
fireEvent(getByTestId("gpt-messages"), "layout", {
|
|
741
|
+
nativeEvent: {layout: {height: 150, width: 100, x: 0, y: 0}},
|
|
742
|
+
});
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
assert.isNull(queryByText("Scroll to bottom"));
|
|
746
|
+
});
|
|
747
|
+
|
|
622
748
|
it("renders attachments and the attach button", () => {
|
|
623
749
|
const onAttachFiles = mock(() => {});
|
|
624
750
|
const onRemoveAttachment = mock((_index: number) => {});
|
|
@@ -668,6 +794,7 @@ describe("GPTChat", () => {
|
|
|
668
794
|
const onUpdateTitle = mock((_id: string, _title: string) => {});
|
|
669
795
|
const {getByTestId} = renderChat({onUpdateTitle});
|
|
670
796
|
|
|
797
|
+
await press(getByTestId("gpt-history-menu-h1"));
|
|
671
798
|
await press(getByTestId("gpt-rename-history-h1"));
|
|
672
799
|
fireEvent.changeText(getByTestId("gpt-rename-input-h1"), "Renamed");
|
|
673
800
|
const input = getByTestId("gpt-rename-input-h1");
|
package/src/GPTChat.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {DateTime} from "luxon";
|
|
1
2
|
import React, {useCallback, useEffect, useRef, useState} from "react";
|
|
2
3
|
import {
|
|
3
4
|
Platform,
|
|
@@ -9,6 +10,8 @@ import {
|
|
|
9
10
|
import {AttachmentPreview} from "./AttachmentPreview";
|
|
10
11
|
import {Box} from "./Box";
|
|
11
12
|
import {Button} from "./Button";
|
|
13
|
+
import {DropdownMenuItem} from "./DropdownMenuItem";
|
|
14
|
+
import {DropdownPanel} from "./DropdownPanel";
|
|
12
15
|
import type {SelectedFile} from "./FilePickerButton";
|
|
13
16
|
import {FilePickerButton} from "./FilePickerButton";
|
|
14
17
|
import {Heading} from "./Heading";
|
|
@@ -228,18 +231,103 @@ const handleDownloadFile = (url: string, filename: string): void => {
|
|
|
228
231
|
document.body.removeChild(link);
|
|
229
232
|
};
|
|
230
233
|
|
|
234
|
+
const IMAGE_EXTENSIONS: Record<string, string> = {
|
|
235
|
+
"image/gif": "gif",
|
|
236
|
+
"image/jpeg": "jpg",
|
|
237
|
+
"image/png": "png",
|
|
238
|
+
"image/webp": "webp",
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const getImageFilename = (part: ImageContentPart): string => {
|
|
242
|
+
const extension = IMAGE_EXTENSIONS[part.mimeType ?? ""] ?? "png";
|
|
243
|
+
return `image-${DateTime.now().toMillis()}.${extension}`;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
// Browsers reliably accept only PNG on the clipboard, so other formats are redrawn as PNG.
|
|
247
|
+
const convertBlobToPng = async (blob: Blob): Promise<Blob> => {
|
|
248
|
+
if (blob.type === "image/png") {
|
|
249
|
+
return blob;
|
|
250
|
+
}
|
|
251
|
+
const bitmap = await createImageBitmap(blob);
|
|
252
|
+
const canvas = document.createElement("canvas");
|
|
253
|
+
canvas.width = bitmap.width;
|
|
254
|
+
canvas.height = bitmap.height;
|
|
255
|
+
canvas.getContext("2d")?.drawImage(bitmap, 0, 0);
|
|
256
|
+
return new Promise((resolve, reject) => {
|
|
257
|
+
canvas.toBlob((png) => (png ? resolve(png) : reject(new Error("PNG conversion failed"))));
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
/** Copies the image itself (not a text placeholder) to the clipboard. */
|
|
262
|
+
const copyImageToClipboard = async (part: ImageContentPart): Promise<void> => {
|
|
263
|
+
if (Platform.OS === "web") {
|
|
264
|
+
if (typeof ClipboardItem === "undefined" || !navigator.clipboard?.write) {
|
|
265
|
+
console.warn("Copying images is not supported in this browser");
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const response = await fetch(part.url);
|
|
269
|
+
const png = await convertBlobToPng(await response.blob());
|
|
270
|
+
await navigator.clipboard.write([new ClipboardItem({"image/png": png})]);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const Clipboard = await import("expo-clipboard");
|
|
274
|
+
const base64 = part.url.startsWith("data:") ? part.url.split(",")[1] : undefined;
|
|
275
|
+
if (base64) {
|
|
276
|
+
await Clipboard.setImageAsync(base64);
|
|
277
|
+
} else {
|
|
278
|
+
await Clipboard.setStringAsync(part.url);
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
const ImageActions = ({part}: {part: ImageContentPart}): React.ReactElement => {
|
|
283
|
+
const handleCopy = useCallback(async (): Promise<void> => {
|
|
284
|
+
try {
|
|
285
|
+
await copyImageToClipboard(part);
|
|
286
|
+
} catch (error) {
|
|
287
|
+
console.warn("Failed to copy image", error);
|
|
288
|
+
}
|
|
289
|
+
}, [part]);
|
|
290
|
+
|
|
291
|
+
const handleDownload = useCallback((): void => {
|
|
292
|
+
handleDownloadFile(part.url, getImageFilename(part));
|
|
293
|
+
}, [part]);
|
|
294
|
+
|
|
295
|
+
return (
|
|
296
|
+
<Box direction="row" gap={1} testID="gpt-image-actions">
|
|
297
|
+
<IconButton
|
|
298
|
+
accessibilityLabel="Copy image"
|
|
299
|
+
iconName="copy"
|
|
300
|
+
onClick={handleCopy}
|
|
301
|
+
testID="gpt-copy-image"
|
|
302
|
+
variant="ghost"
|
|
303
|
+
/>
|
|
304
|
+
{Platform.OS === "web" ? (
|
|
305
|
+
<IconButton
|
|
306
|
+
accessibilityLabel="Download image"
|
|
307
|
+
iconName="download"
|
|
308
|
+
onClick={handleDownload}
|
|
309
|
+
testID="gpt-download-image"
|
|
310
|
+
variant="ghost"
|
|
311
|
+
/>
|
|
312
|
+
) : null}
|
|
313
|
+
</Box>
|
|
314
|
+
);
|
|
315
|
+
};
|
|
316
|
+
|
|
231
317
|
const MessageContentParts = ({parts}: {parts: MessageContentPart[]}): React.ReactElement => {
|
|
232
318
|
return (
|
|
233
319
|
<Box gap={2}>
|
|
234
320
|
{parts.map((part, index) => {
|
|
235
321
|
if (part.type === "image") {
|
|
236
322
|
return (
|
|
237
|
-
<
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
323
|
+
<Box gap={1} key={`content-${index}`}>
|
|
324
|
+
<RNImage
|
|
325
|
+
resizeMode="contain"
|
|
326
|
+
source={{uri: part.url}}
|
|
327
|
+
style={{borderRadius: 8, height: 400, maxWidth: 800, minWidth: 400, width: "100%"}}
|
|
328
|
+
/>
|
|
329
|
+
<ImageActions part={part} />
|
|
330
|
+
</Box>
|
|
243
331
|
);
|
|
244
332
|
}
|
|
245
333
|
if (part.type === "file") {
|
|
@@ -464,25 +552,44 @@ const HistoryItemTitle = ({
|
|
|
464
552
|
);
|
|
465
553
|
}
|
|
466
554
|
return (
|
|
467
|
-
<
|
|
468
|
-
{history.
|
|
469
|
-
|
|
555
|
+
<Box flex="grow" minWidth={0}>
|
|
556
|
+
<Text color={history.id === currentHistoryId ? "inverted" : "primary"} size="sm" truncate>
|
|
557
|
+
{history.title ?? "New Chat"}
|
|
558
|
+
</Text>
|
|
559
|
+
</Box>
|
|
470
560
|
);
|
|
471
561
|
};
|
|
472
562
|
|
|
473
|
-
const
|
|
563
|
+
const HistoryItemActions = ({
|
|
474
564
|
editingHistoryId,
|
|
475
565
|
handleFinishRename,
|
|
476
566
|
handleStartRename,
|
|
477
567
|
history,
|
|
568
|
+
isSelected,
|
|
569
|
+
onDeleteHistory,
|
|
478
570
|
onUpdateTitle,
|
|
479
571
|
}: {
|
|
480
572
|
editingHistoryId: string | null;
|
|
481
573
|
handleFinishRename: () => void;
|
|
482
574
|
handleStartRename: (id: string, title: string) => void;
|
|
483
575
|
history: GPTChatHistory;
|
|
576
|
+
isSelected: boolean;
|
|
577
|
+
onDeleteHistory: (id: string) => void;
|
|
484
578
|
onUpdateTitle?: (id: string, title: string) => void;
|
|
485
|
-
}): React.ReactElement
|
|
579
|
+
}): React.ReactElement => {
|
|
580
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
581
|
+
const title = history.title ?? "New Chat";
|
|
582
|
+
|
|
583
|
+
const handleRename = useCallback((): void => {
|
|
584
|
+
setIsMenuOpen(false);
|
|
585
|
+
handleStartRename(history.id, history.title ?? "");
|
|
586
|
+
}, [handleStartRename, history.id, history.title]);
|
|
587
|
+
|
|
588
|
+
const handleDelete = useCallback((): void => {
|
|
589
|
+
setIsMenuOpen(false);
|
|
590
|
+
onDeleteHistory(history.id);
|
|
591
|
+
}, [history.id, onDeleteHistory]);
|
|
592
|
+
|
|
486
593
|
if (editingHistoryId === history.id) {
|
|
487
594
|
return (
|
|
488
595
|
<IconButton
|
|
@@ -493,16 +600,45 @@ const HistoryItemActionButton = ({
|
|
|
493
600
|
/>
|
|
494
601
|
);
|
|
495
602
|
}
|
|
496
|
-
|
|
497
|
-
return null;
|
|
498
|
-
}
|
|
603
|
+
|
|
499
604
|
return (
|
|
500
|
-
<
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
605
|
+
<DropdownPanel
|
|
606
|
+
align="auto"
|
|
607
|
+
isOpen={isMenuOpen}
|
|
608
|
+
onOpenChange={setIsMenuOpen}
|
|
609
|
+
renderTrigger={({toggle}) => (
|
|
610
|
+
<IconButton
|
|
611
|
+
accessibilityLabel={`Chat actions: ${title}`}
|
|
612
|
+
iconName="ellipsis-vertical"
|
|
613
|
+
onClick={toggle}
|
|
614
|
+
testID={`gpt-history-menu-${history.id}`}
|
|
615
|
+
variant={isSelected ? "primary" : "ghost"}
|
|
616
|
+
/>
|
|
617
|
+
)}
|
|
618
|
+
showActionButtons={false}
|
|
619
|
+
testID={`gpt-history-menu-panel-${history.id}`}
|
|
620
|
+
width={180}
|
|
621
|
+
>
|
|
622
|
+
<Box gap={1}>
|
|
623
|
+
{onUpdateTitle ? (
|
|
624
|
+
<DropdownMenuItem
|
|
625
|
+
accessibilityLabel={`Rename chat: ${title}`}
|
|
626
|
+
iconName="pen-to-square"
|
|
627
|
+
label="Rename"
|
|
628
|
+
onClick={handleRename}
|
|
629
|
+
testID={`gpt-rename-history-${history.id}`}
|
|
630
|
+
/>
|
|
631
|
+
) : null}
|
|
632
|
+
<DropdownMenuItem
|
|
633
|
+
accessibilityLabel={`Delete chat: ${title}`}
|
|
634
|
+
color="error"
|
|
635
|
+
iconName="trash-can"
|
|
636
|
+
label="Delete"
|
|
637
|
+
onClick={handleDelete}
|
|
638
|
+
testID={`gpt-delete-history-${history.id}`}
|
|
639
|
+
/>
|
|
640
|
+
</Box>
|
|
641
|
+
</DropdownPanel>
|
|
506
642
|
);
|
|
507
643
|
};
|
|
508
644
|
|
|
@@ -569,7 +705,7 @@ const AssistantActions = ({
|
|
|
569
705
|
message,
|
|
570
706
|
onRateFeedback,
|
|
571
707
|
}: {
|
|
572
|
-
handleCopyMessage: (
|
|
708
|
+
handleCopyMessage: (message: GPTChatMessage) => void;
|
|
573
709
|
index: number;
|
|
574
710
|
message: GPTChatMessage;
|
|
575
711
|
onRateFeedback?: (promptIndex: number, rating: "up" | "down" | null) => void;
|
|
@@ -583,7 +719,7 @@ const AssistantActions = ({
|
|
|
583
719
|
<IconButton
|
|
584
720
|
accessibilityLabel="Copy message"
|
|
585
721
|
iconName="copy"
|
|
586
|
-
onClick={() => handleCopyMessage(message
|
|
722
|
+
onClick={() => handleCopyMessage(message)}
|
|
587
723
|
testID={`gpt-copy-msg-${index}`}
|
|
588
724
|
/>
|
|
589
725
|
</Box>
|
|
@@ -657,7 +793,7 @@ const MessageList = ({
|
|
|
657
793
|
onRateFeedback,
|
|
658
794
|
}: {
|
|
659
795
|
currentMessages: GPTChatMessage[];
|
|
660
|
-
handleCopyMessage: (
|
|
796
|
+
handleCopyMessage: (message: GPTChatMessage) => void;
|
|
661
797
|
onRateFeedback?: (promptIndex: number, rating: "up" | "down" | null) => void;
|
|
662
798
|
}): React.ReactElement => {
|
|
663
799
|
return (
|
|
@@ -858,6 +994,11 @@ const ApiKeyModal = ({
|
|
|
858
994
|
// Main Component
|
|
859
995
|
// ============================================================
|
|
860
996
|
|
|
997
|
+
/** Pixels of content below the viewport before "Scroll to bottom" appears. */
|
|
998
|
+
const SCROLL_TO_BOTTOM_THRESHOLD = 100;
|
|
999
|
+
/** Height the composer grows to before its text scrolls. */
|
|
1000
|
+
const COMPOSER_MAX_HEIGHT = 200;
|
|
1001
|
+
|
|
861
1002
|
export const GPTChat = ({
|
|
862
1003
|
attachments = [],
|
|
863
1004
|
availableModels,
|
|
@@ -943,9 +1084,21 @@ export const GPTChat = ({
|
|
|
943
1084
|
return () => el.removeEventListener("keydown", handler);
|
|
944
1085
|
}, [inputElement]);
|
|
945
1086
|
|
|
946
|
-
|
|
1087
|
+
// Image-only replies have no meaningful text, so copy the image instead of a placeholder.
|
|
1088
|
+
const handleCopyMessage = useCallback(async (message: GPTChatMessage) => {
|
|
1089
|
+
const firstImage = message.contentParts?.find(
|
|
1090
|
+
(part): part is ImageContentPart => part.type === "image"
|
|
1091
|
+
);
|
|
1092
|
+
if (firstImage && !message.content.trim()) {
|
|
1093
|
+
try {
|
|
1094
|
+
await copyImageToClipboard(firstImage);
|
|
1095
|
+
} catch (error) {
|
|
1096
|
+
console.warn("Failed to copy image", error);
|
|
1097
|
+
}
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
947
1100
|
const Clipboard = await import("expo-clipboard");
|
|
948
|
-
await Clipboard.setStringAsync(
|
|
1101
|
+
await Clipboard.setStringAsync(message.content);
|
|
949
1102
|
}, []);
|
|
950
1103
|
|
|
951
1104
|
const scrollToBottom = useCallback(() => {
|
|
@@ -963,12 +1116,17 @@ export const GPTChat = ({
|
|
|
963
1116
|
const handleScroll = useCallback((offsetY: number) => {
|
|
964
1117
|
scrollOffsetRef.current = offsetY;
|
|
965
1118
|
const distanceFromBottom = contentHeightRef.current - offsetY - viewportHeightRef.current;
|
|
966
|
-
setIsScrolledUp(distanceFromBottom >
|
|
1119
|
+
setIsScrolledUp(distanceFromBottom > SCROLL_TO_BOTTOM_THRESHOLD);
|
|
967
1120
|
}, []);
|
|
968
1121
|
|
|
1122
|
+
// Growing content (a streaming reply) must not count as the user scrolling up, but content
|
|
1123
|
+
// that shrinks to fit the viewport (switching to a short or empty chat) clears the flag.
|
|
969
1124
|
const handleContentLayout = useCallback(
|
|
970
|
-
(
|
|
971
|
-
contentHeightRef.current =
|
|
1125
|
+
(event: {nativeEvent: {layout: {height: number; width: number; x: number; y: number}}}) => {
|
|
1126
|
+
contentHeightRef.current = event.nativeEvent.layout.height;
|
|
1127
|
+
if (contentHeightRef.current <= viewportHeightRef.current + SCROLL_TO_BOTTOM_THRESHOLD) {
|
|
1128
|
+
setIsScrolledUp(false);
|
|
1129
|
+
}
|
|
972
1130
|
},
|
|
973
1131
|
[]
|
|
974
1132
|
);
|
|
@@ -1095,21 +1253,16 @@ export const GPTChat = ({
|
|
|
1095
1253
|
history={history}
|
|
1096
1254
|
setEditingTitle={setEditingTitle}
|
|
1097
1255
|
/>
|
|
1098
|
-
<Box
|
|
1099
|
-
<
|
|
1256
|
+
<Box marginLeft={1}>
|
|
1257
|
+
<HistoryItemActions
|
|
1100
1258
|
editingHistoryId={editingHistoryId}
|
|
1101
1259
|
handleFinishRename={handleFinishRename}
|
|
1102
1260
|
handleStartRename={handleStartRename}
|
|
1103
1261
|
history={history}
|
|
1262
|
+
isSelected={history.id === currentHistoryId}
|
|
1263
|
+
onDeleteHistory={onDeleteHistory}
|
|
1104
1264
|
onUpdateTitle={onUpdateTitle}
|
|
1105
1265
|
/>
|
|
1106
|
-
<IconButton
|
|
1107
|
-
accessibilityLabel={`Delete chat: ${history.title ?? "New Chat"}`}
|
|
1108
|
-
iconName="trash"
|
|
1109
|
-
onClick={() => onDeleteHistory(history.id)}
|
|
1110
|
-
testID={`gpt-delete-history-${history.id}`}
|
|
1111
|
-
variant="destructive"
|
|
1112
|
-
/>
|
|
1113
1266
|
</Box>
|
|
1114
1267
|
</Box>
|
|
1115
1268
|
))}
|
|
@@ -1143,7 +1296,10 @@ export const GPTChat = ({
|
|
|
1143
1296
|
</Box>
|
|
1144
1297
|
</Box>
|
|
1145
1298
|
|
|
1146
|
-
<ScrollToBottomButton
|
|
1299
|
+
<ScrollToBottomButton
|
|
1300
|
+
isScrolledUp={isScrolledUp && !isEmptyChat}
|
|
1301
|
+
scrollToBottom={scrollToBottom}
|
|
1302
|
+
/>
|
|
1147
1303
|
<AttachmentSection attachments={attachments} onRemoveAttachment={onRemoveAttachment} />
|
|
1148
1304
|
|
|
1149
1305
|
{/* Input */}
|
|
@@ -1171,7 +1327,9 @@ export const GPTChat = ({
|
|
|
1171
1327
|
<TextArea
|
|
1172
1328
|
blurOnSubmit={false}
|
|
1173
1329
|
disabled={isStreaming}
|
|
1330
|
+
grow
|
|
1174
1331
|
inputRef={handleInputRef}
|
|
1332
|
+
maxHeight={COMPOSER_MAX_HEIGHT}
|
|
1175
1333
|
onChange={setInputValue}
|
|
1176
1334
|
placeholder="Type a message..."
|
|
1177
1335
|
testID="gpt-input"
|
package/src/HeightField.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import {FieldError} from "./fieldElements/FieldError";
|
|
|
8
8
|
import {FieldHelperText} from "./fieldElements/FieldHelperText";
|
|
9
9
|
import {FieldTitle} from "./fieldElements/FieldTitle";
|
|
10
10
|
import {HeightActionSheet} from "./HeightActionSheet";
|
|
11
|
-
import {
|
|
11
|
+
import {isNarrowViewport} from "./MediaQuery";
|
|
12
12
|
import {SelectField} from "./SelectField";
|
|
13
13
|
import {Text} from "./Text";
|
|
14
14
|
import {useTheme} from "./Theme";
|
|
@@ -158,7 +158,7 @@ export const HeightField: FC<HeightFieldProps> = ({
|
|
|
158
158
|
}) => {
|
|
159
159
|
const {theme} = useTheme();
|
|
160
160
|
const actionSheetRef = useRef<ActionSheet | null>(null);
|
|
161
|
-
const isMobileOrNative =
|
|
161
|
+
const isMobileOrNative = isNarrowViewport() || isNative();
|
|
162
162
|
|
|
163
163
|
const minInches = min ?? DEFAULT_MIN_INCHES;
|
|
164
164
|
const maxInches = max ?? DEFAULT_MAX_INCHES;
|
package/src/IconButton.test.tsx
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import {describe, expect, it, mock} from "bun:test";
|
|
2
|
+
import type {ReactTestInstance} from "react-test-renderer";
|
|
2
3
|
|
|
3
4
|
import {IconButton} from "./IconButton";
|
|
5
|
+
import {useTheme} from "./Theme";
|
|
4
6
|
import {renderWithIcons, renderWithTheme} from "./test-utils";
|
|
7
|
+
import {applyColorOpacity} from "./Utilities";
|
|
5
8
|
|
|
6
9
|
describe("IconButton", () => {
|
|
7
10
|
it("renders correctly with default props", () => {
|
|
@@ -129,6 +132,24 @@ describe("IconButton", () => {
|
|
|
129
132
|
expect(toJSON()).toMatchSnapshot();
|
|
130
133
|
});
|
|
131
134
|
|
|
135
|
+
it("uses the supplied accessibility hint without announcing a confirmation dialog", async () => {
|
|
136
|
+
// bunSetup replaces ./IconButton with a null mock; the query suffix loads the real module.
|
|
137
|
+
const actualIconButtonPath = "./IconButton.tsx?accessibility";
|
|
138
|
+
const {IconButton: ActualIconButton} = (await import(
|
|
139
|
+
actualIconButtonPath
|
|
140
|
+
)) as typeof import("./IconButton");
|
|
141
|
+
const {getByLabelText} = renderWithTheme(
|
|
142
|
+
<ActualIconButton
|
|
143
|
+
accessibilityHint="Back to list"
|
|
144
|
+
accessibilityLabel="Back to list"
|
|
145
|
+
iconName="arrow-left"
|
|
146
|
+
onClick={() => {}}
|
|
147
|
+
/>
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
expect(getByLabelText("Back to list").props.accessibilityHint).toBe("Back to list");
|
|
151
|
+
});
|
|
152
|
+
|
|
132
153
|
it("renders with confirmation props", () => {
|
|
133
154
|
const {toJSON} = renderWithTheme(
|
|
134
155
|
<IconButton
|
|
@@ -183,6 +204,48 @@ describe("IconButton", () => {
|
|
|
183
204
|
expect(toJSON()).toMatchSnapshot();
|
|
184
205
|
});
|
|
185
206
|
|
|
207
|
+
it("keeps a translucent muted background and an opaque icon", async () => {
|
|
208
|
+
// bunSetup replaces ./IconButton with a null mock; the query suffix loads the real module.
|
|
209
|
+
const actualIconButtonPath = "./IconButton.tsx?actual";
|
|
210
|
+
const {IconButton: ActualIconButton} = (await import(
|
|
211
|
+
actualIconButtonPath
|
|
212
|
+
)) as typeof import("./IconButton");
|
|
213
|
+
let inverted = "";
|
|
214
|
+
const CaptureTheme = (): null => {
|
|
215
|
+
const {theme} = useTheme();
|
|
216
|
+
inverted = theme.text.inverted;
|
|
217
|
+
return null;
|
|
218
|
+
};
|
|
219
|
+
const {getByLabelText, UNSAFE_root} = renderWithTheme(
|
|
220
|
+
<>
|
|
221
|
+
<CaptureTheme />
|
|
222
|
+
<ActualIconButton
|
|
223
|
+
accessibilityLabel="muted background solid"
|
|
224
|
+
iconName="check"
|
|
225
|
+
onClick={() => {}}
|
|
226
|
+
variant="muted"
|
|
227
|
+
/>
|
|
228
|
+
<ActualIconButton
|
|
229
|
+
accessibilityLabel="muted background translucent"
|
|
230
|
+
backgroundOpacity={0.88}
|
|
231
|
+
iconName="check"
|
|
232
|
+
onClick={() => {}}
|
|
233
|
+
variant="muted"
|
|
234
|
+
/>
|
|
235
|
+
</>
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
expect(getByLabelText("muted background solid")).toHaveStyle({backgroundColor: inverted});
|
|
239
|
+
expect(getByLabelText("muted background translucent")).toHaveStyle({
|
|
240
|
+
backgroundColor: applyColorOpacity({color: inverted, opacity: 0.88}),
|
|
241
|
+
});
|
|
242
|
+
const icons = UNSAFE_root.findAll(
|
|
243
|
+
(node: ReactTestInstance) => node.props?.name === "check" && Boolean(node.props?.color)
|
|
244
|
+
);
|
|
245
|
+
expect(icons).toHaveLength(2);
|
|
246
|
+
expect(icons[0].props.color).toBe(icons[1].props.color);
|
|
247
|
+
});
|
|
248
|
+
|
|
186
249
|
describe("custom icons", () => {
|
|
187
250
|
// IconButton renders `null` under the bun/react-test-renderer harness (all of
|
|
188
251
|
// its snapshots are null), so we verify the custom-icon code path renders
|