Skip to content

Commit 97d1435

Browse files
Show submissions tab in main navigation (#476)
* Show submissions tab in main navigation * Remove submissions feature gate relock control
1 parent 1392807 commit 97d1435

4 files changed

Lines changed: 15 additions & 25 deletions

File tree

packages/app/cypress/component/tab-nav.cy.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ describe('TabNav — unofficialrun URL preservation (issue #319)', () => {
6565
'href',
6666
'/inference?unofficialruns=12345',
6767
);
68+
cy.get('[data-testid="tab-trigger-submissions"]').should(
69+
'have.attr',
70+
'href',
71+
'/submissions?unofficialruns=12345',
72+
);
6873
cy.get('[data-testid="tab-trigger-historical"]').should(
6974
'have.attr',
7075
'href',
@@ -104,22 +109,26 @@ describe('TabNav — Hidden popover for gated tabs', () => {
104109
mountTabNav({});
105110
cy.get('[data-testid="tab-trigger-inference"]').should('exist');
106111
cy.get('[data-testid="tab-trigger-gpu-specs"]').should('exist');
112+
cy.get('[data-testid="tab-trigger-submissions"]').should('exist');
107113
cy.get('[data-testid="tab-trigger-hidden"]').should('not.exist');
108114
cy.get('[data-testid="tab-trigger-feedback"]').should('not.exist');
109115
cy.get('[data-testid="tab-trigger-ai-chart"]').should('not.exist');
110116
});
111117

112-
it('renders the Hidden trigger when unlocked; popover reveals all 4 gated links', () => {
118+
it('renders the Hidden trigger when unlocked; popover reveals gated links', () => {
113119
cy.window().then((win) => win.localStorage.setItem('inferencex-feature-gate', '1'));
114120
mountTabNav({});
115121
cy.get('[data-testid="tab-trigger-hidden"]').should('be.visible').and('contain.text', 'Hidden');
116122
// Gated links are inside the closed popover, so they're not yet in the DOM.
117123
cy.get('[data-testid="tab-trigger-ai-chart"]').should('not.exist');
124+
cy.get('[data-testid="tab-trigger-submissions"]').should('have.attr', 'href', '/submissions');
118125
cy.get('[data-testid="tab-trigger-hidden"]').click();
119126
cy.get('[data-testid="tab-hidden-popover"]').should('be.visible');
120127
cy.get('[data-testid="tab-trigger-ai-chart"]').should('have.attr', 'href', '/ai-chart');
121128
cy.get('[data-testid="tab-trigger-gpu-metrics"]').should('have.attr', 'href', '/gpu-metrics');
122-
cy.get('[data-testid="tab-trigger-submissions"]').should('have.attr', 'href', '/submissions');
129+
cy.get('[data-testid="tab-hidden-popover"]')
130+
.find('[data-testid="tab-trigger-submissions"]')
131+
.should('not.exist');
123132
cy.get('[data-testid="tab-trigger-feedback"]').should('have.attr', 'href', '/feedback');
124133
});
125134

packages/app/src/components/submissions/SubmissionsDisplay.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
'use client';
22

3-
import { Lock } from 'lucide-react';
4-
import { useRouter } from 'next/navigation';
53
import { useCallback, useEffect, useMemo, useState } from 'react';
64

75
import { track } from '@/lib/analytics';
8-
import { Button } from '@/components/ui/button';
96
import { Card } from '@/components/ui/card';
107
import { ChartButtons } from '@/components/ui/chart-buttons';
118
import { ChartShareActions } from '@/components/ui/chart-display-helpers';
129
import { SegmentedToggle, type SegmentedToggleOption } from '@/components/ui/segmented-toggle';
1310
import { exportToCsv } from '@/lib/csv-export';
1411
import { submissionsVolumeToCsv } from '@/lib/csv-export-helpers';
1512
import { useSubmissions } from '@/hooks/api/use-submissions';
16-
import { relockFeatureGate } from '@/lib/use-feature-gate';
1713

1814
import SubmissionsChart, { type ChartMode } from './SubmissionsChart';
1915
import SubmissionsTable from './SubmissionsTable';
@@ -27,7 +23,6 @@ const SUBMISSIONS_CHART_MODE_OPTIONS: SegmentedToggleOption<ChartMode>[] = [
2723
];
2824

2925
export default function SubmissionsDisplay() {
30-
const router = useRouter();
3126
const { data, isLoading, error } = useSubmissions();
3227
const [chartMode, setChartMode] = useState<ChartMode>('weekly');
3328

@@ -73,20 +68,6 @@ export default function SubmissionsDisplay() {
7368
</p>
7469
</div>
7570
<div className="flex items-center gap-1.5">
76-
<Button
77-
variant="ghost"
78-
size="sm"
79-
className="h-7 gap-1.5 text-xs text-muted-foreground"
80-
onClick={() => {
81-
relockFeatureGate();
82-
track('submissions_relocked');
83-
router.push('/inference');
84-
}}
85-
title="Re-lock feature gate"
86-
>
87-
<Lock className="size-3" />
88-
Re-lock feature gate
89-
</Button>
9071
<ChartShareActions />
9172
</div>
9273
</div>

packages/app/src/components/tab-nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ const VISIBLE_TABS = [
2929
{ href: '/historical', label: 'Historical Trends', testId: 'tab-trigger-historical' },
3030
{ href: '/calculator', label: 'TCO Calculator', testId: 'tab-trigger-calculator' },
3131
{ href: '/gpu-specs', label: 'GPU Specs', testId: 'tab-trigger-gpu-specs' },
32+
{ href: '/submissions', label: 'Submissions', testId: 'tab-trigger-submissions' },
3233
] as const;
3334

3435
const GATED_TABS = [
3536
{ href: '/ai-chart', label: 'AI Chart', testId: 'tab-trigger-ai-chart' },
3637
{ href: '/gpu-metrics', label: 'PowerX', testId: 'tab-trigger-gpu-metrics' },
37-
{ href: '/submissions', label: 'Submissions', testId: 'tab-trigger-submissions' },
3838
{
3939
href: '/current-inferencex-image',
4040
label: 'Images',

packages/app/src/lib/use-feature-gate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const UNLOCK_SEQUENCE = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown'];
1616
* (FEATURE_GATE_UNLOCKED_EVENT / FEATURE_GATE_LOCKED_EVENT) so all
1717
* consumers flip together without each owning a keyboard listener.
1818
*
19-
* Used by tab-nav (GATED_TABS), gpu-power, submissions, feedback,
20-
* and any chart surface that should be visible only to insiders
21-
* until the underlying data is stable.
19+
* Used by tab-nav (GATED_TABS), gpu-power, feedback, and any chart
20+
* surface that should be visible only to insiders until the underlying
21+
* data is stable.
2222
*/
2323
/**
2424
* Re-lock the feature gate from any client surface. Owns the localStorage write

0 commit comments

Comments
 (0)