Skip to content

Commit c640920

Browse files
authored
feat: Autocorrelation public preview (#947)
1 parent ff8fa3f commit c640920

File tree

6 files changed

+46
-55
lines changed

6 files changed

+46
-55
lines changed

src/components/Settings/AiSettings.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function DisclaimerTerms() {
148148
Disclaimer: Use of your own OpenAI API Key
149149
</Text>
150150
<Box>
151-
<Text>
151+
<Text size="1">
152152
By adding your OpenAI key, you acknowledge and agree to the
153153
following:
154154
</Text>
@@ -157,6 +157,7 @@ function DisclaimerTerms() {
157157
paddingLeft: 'var(--space-5)',
158158
marginBottom: 0,
159159
marginTop: 'var(--space-2)',
160+
fontSize: 'var(--font-size-1)',
160161
li: { marginBottom: 'var(--space-1)' },
161162
}}
162163
>

src/components/Settings/useEnabledTabs.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,19 @@ const TABS: Array<{
3333
label: 'AI',
3434
value: 'ai',
3535
component: AiSettings,
36-
featureToggle: 'auto-correlation',
3736
},
3837
{
3938
label: 'Logs',
4039
value: 'logs',
4140
component: LogsSettings,
4241
},
42+
// Example of a feature-toggle controlled tab
43+
// {
44+
// label: 'Dummy Feature',
45+
// value: 'dummyFeature',
46+
// component: DummyFeature,
47+
// featureToggle: 'dummy-feature',
48+
// }
4349
]
4450

4551
export function useEnabledTabs() {

src/store/features/useFeaturesStore.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ interface FeaturesStore {
1111
export const defaultFeatures: Record<Feature, boolean> = {
1212
'dummy-feature': false,
1313
'typeahead-json': false,
14-
'auto-correlation': false,
1514
}
1615

1716
export const useFeaturesStore = create<FeaturesStore>()(

src/types/features.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type Feature = 'dummy-feature' | 'typeahead-json' | 'auto-correlation'
1+
export type Feature = 'dummy-feature' | 'typeahead-json'

src/views/Generator/AutoCorrelation/ErrorMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function ErrorMessage({ error, onRetry }: AutoCorrelationErrorProps) {
7575
return (
7676
<MessageContent
7777
title="Something went wrong"
78-
message="An unexpected error occurred during auto-correlation. Click retry to try again or report an issue if problem persists."
78+
message="An unexpected error occurred during autocorrelation. Click retry to try again or report an issue if problem persists."
7979
>
8080
{retryButton}
8181
{reportIssueButton}

src/views/Generator/TestRuleContainer/TestRuleContainer.tsx

Lines changed: 35 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { WandSparkles } from 'lucide-react'
33
import { useState } from 'react'
44

55
import { EmptyMessage } from '@/components/EmptyMessage'
6-
import { Feature, FeatureDisabled } from '@/components/Feature'
76
import {
87
selectFilteredRequests,
98
selectSelectedRule,
@@ -48,64 +47,50 @@ export function TestRuleContainer() {
4847
Test rules ({rules.length})
4948
</Heading>
5049
<NewRuleMenu />
51-
<Feature feature="auto-correlation">
52-
<Button
53-
variant="ghost"
54-
size="1"
55-
color="gray"
56-
onClick={() => setIsAutoCorrelationDialogOpen(true)}
57-
disabled={isAutocorrelationButtonDisabled}
58-
>
59-
<WandSparkles />
60-
Autocorrelate
61-
</Button>
62-
</Feature>
50+
<Button
51+
variant="ghost"
52+
size="1"
53+
color="gray"
54+
onClick={() => setIsAutoCorrelationDialogOpen(true)}
55+
disabled={isAutocorrelationButtonDisabled}
56+
>
57+
<WandSparkles />
58+
Autocorrelate
59+
</Button>
6360
</Flex>
6461
</StickyPanelHeader>
6562
<SortableRuleList rules={rules} onSwapRules={swapRules} />
6663
{shouldShowHelpMessage && (
6764
<>
68-
<FeatureDisabled feature="auto-correlation">
69-
<EmptyMessage
70-
message="Configure your test logic by adding a new rule"
71-
pb="2"
72-
action={<NewRuleMenu variant="solid" size="2" color="orange" />}
73-
/>
74-
</FeatureDisabled>
75-
76-
<Feature feature="auto-correlation">
77-
<EmptyMessage
78-
message="Configure your test logic by adding a new rule"
79-
pb="2"
80-
action={
81-
<Flex gap="2" align="center">
82-
<Button
83-
onClick={() => setIsAutoCorrelationDialogOpen(true)}
84-
disabled={isAutocorrelationButtonDisabled}
85-
>
86-
<WandSparkles />
87-
Autocorrelate
88-
</Button>{' '}
89-
<NewRuleMenu
90-
variant="solid"
91-
size="2"
92-
color="orange"
93-
text="Add rule manually"
94-
/>
95-
</Flex>
96-
}
97-
/>
98-
</Feature>
65+
<EmptyMessage
66+
message="Configure your test logic by adding a new rule"
67+
pb="2"
68+
action={
69+
<Flex gap="2" align="center">
70+
<Button
71+
onClick={() => setIsAutoCorrelationDialogOpen(true)}
72+
disabled={isAutocorrelationButtonDisabled}
73+
>
74+
<WandSparkles />
75+
Autocorrelate
76+
</Button>{' '}
77+
<NewRuleMenu
78+
variant="solid"
79+
size="2"
80+
color="orange"
81+
text="Add rule manually"
82+
/>
83+
</Flex>
84+
}
85+
/>
9986
</>
10087
)}
10188
</ScrollArea>
10289

103-
<Feature feature="auto-correlation">
104-
<AutoCorrelationDialog
105-
open={isAutoCorrelationDialogOpen}
106-
onOpenChange={setIsAutoCorrelationDialogOpen}
107-
/>
108-
</Feature>
90+
<AutoCorrelationDialog
91+
open={isAutoCorrelationDialogOpen}
92+
onOpenChange={setIsAutoCorrelationDialogOpen}
93+
/>
10994
</>
11095
)
11196
}

0 commit comments

Comments
 (0)