Reduce low-risk unused-symbol noise in core components (#316)
This first cleanup pass removes clearly unused imports and dead locals from a small set of components, and reconnects a few existing Props aliases to their component signatures so they stop surfacing as avoidable noise. The scope stays intentionally narrow to make the follow-up cleanup series easier to review and lower risk. Constraint: Follow issue #314 with a components-only, low-risk first pass Rejected: Broader sweep across commands/hooks/utils in the same PR | too much review surface for an initial cleanup pass Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep subsequent unused-code cleanups narrowly batched; treat signature/compatibility placeholders separately from straightforward import/alias cleanup Tested: bun run build; bun run smoke; targeted noUnused grep for touched files via bun x tsc --noEmit --noUnusedLocals --noUnusedParameters --pretty false Not-tested: full repo typecheck (baseline repo noise remains outside this narrow pass) Co-authored-by: anandh8x <test@example.com>
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import { c as _c } from "react-compiler-runtime";
|
import { c as _c } from "react-compiler-runtime";
|
||||||
import * as React from 'react';
|
|
||||||
import { Box, Text } from '../ink.js';
|
import { Box, Text } from '../ink.js';
|
||||||
import { formatNumber } from '../utils/format.js';
|
import { formatNumber } from '../utils/format.js';
|
||||||
import type { Theme } from '../utils/theme.js';
|
import type { Theme } from '../utils/theme.js';
|
||||||
@@ -20,7 +19,7 @@ type Props = {
|
|||||||
lastToolInfo?: string | null;
|
lastToolInfo?: string | null;
|
||||||
hideType?: boolean;
|
hideType?: boolean;
|
||||||
};
|
};
|
||||||
export function AgentProgressLine(t0) {
|
export function AgentProgressLine(t0: Props) {
|
||||||
const $ = _c(32);
|
const $ = _c(32);
|
||||||
const {
|
const {
|
||||||
agentType,
|
agentType,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { c as _c } from "react-compiler-runtime";
|
import { c as _c } from "react-compiler-runtime";
|
||||||
import React from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { FpsMetricsProvider } from '../context/fpsMetrics.js';
|
import { FpsMetricsProvider } from '../context/fpsMetrics.js';
|
||||||
import { StatsProvider, type StatsStore } from '../context/stats.js';
|
import { StatsProvider, type StatsStore } from '../context/stats.js';
|
||||||
import { type AppState, AppStateProvider } from '../state/AppState.js';
|
import { type AppState, AppStateProvider } from '../state/AppState.js';
|
||||||
@@ -9,14 +9,14 @@ type Props = {
|
|||||||
getFpsMetrics: () => FpsMetrics | undefined;
|
getFpsMetrics: () => FpsMetrics | undefined;
|
||||||
stats?: StatsStore;
|
stats?: StatsStore;
|
||||||
initialState: AppState;
|
initialState: AppState;
|
||||||
children: React.ReactNode;
|
children: ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Top-level wrapper for interactive sessions.
|
* Top-level wrapper for interactive sessions.
|
||||||
* Provides FPS metrics, stats context, and app state to the component tree.
|
* Provides FPS metrics, stats context, and app state to the component tree.
|
||||||
*/
|
*/
|
||||||
export function App(t0) {
|
export function App(t0: Props) {
|
||||||
const $ = _c(9);
|
const $ = _c(9);
|
||||||
const {
|
const {
|
||||||
getFpsMetrics,
|
getFpsMetrics,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { c as _c } from "react-compiler-runtime";
|
import { c as _c } from "react-compiler-runtime";
|
||||||
import React from 'react';
|
|
||||||
import { Text } from '../ink.js';
|
import { Text } from '../ink.js';
|
||||||
import { saveGlobalConfig } from '../utils/config.js';
|
import { saveGlobalConfig } from '../utils/config.js';
|
||||||
import { Select } from './CustomSelect/index.js';
|
import { Select } from './CustomSelect/index.js';
|
||||||
@@ -8,7 +7,7 @@ type Props = {
|
|||||||
customApiKeyTruncated: string;
|
customApiKeyTruncated: string;
|
||||||
onDone(approved: boolean): void;
|
onDone(approved: boolean): void;
|
||||||
};
|
};
|
||||||
export function ApproveApiKey(t0) {
|
export function ApproveApiKey(t0: Props) {
|
||||||
const $ = _c(17);
|
const $ = _c(17);
|
||||||
const {
|
const {
|
||||||
customApiKeyTruncated,
|
customApiKeyTruncated,
|
||||||
@@ -16,7 +15,7 @@ export function ApproveApiKey(t0) {
|
|||||||
} = t0;
|
} = t0;
|
||||||
let t1;
|
let t1;
|
||||||
if ($[0] !== customApiKeyTruncated || $[1] !== onDone) {
|
if ($[0] !== customApiKeyTruncated || $[1] !== onDone) {
|
||||||
t1 = function onChange(value) {
|
t1 = function onChange(value: 'yes' | 'no') {
|
||||||
bb2: switch (value) {
|
bb2: switch (value) {
|
||||||
case "yes":
|
case "yes":
|
||||||
{
|
{
|
||||||
@@ -102,7 +101,7 @@ export function ApproveApiKey(t0) {
|
|||||||
}
|
}
|
||||||
let t8;
|
let t8;
|
||||||
if ($[11] !== onChange) {
|
if ($[11] !== onChange) {
|
||||||
t8 = <Select defaultValue="no" defaultFocusValue="no" options={t7} onChange={value_0 => onChange(value_0 as 'yes' | 'no')} onCancel={() => onChange("no")} />;
|
t8 = <Select defaultValue="no" defaultFocusValue="no" options={t7} onChange={(value_0: string) => onChange(value_0 as 'yes' | 'no')} onCancel={() => onChange("no")} />;
|
||||||
$[11] = onChange;
|
$[11] = onChange;
|
||||||
$[12] = t8;
|
$[12] = t8;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
import React, { useState } from 'react'
|
import type { ReactNode } from 'react'
|
||||||
import { Box, Text } from '../ink.js'
|
import { Box, Text } from '../ink.js'
|
||||||
import { useMainLoopModel } from '../hooks/useMainLoopModel.js'
|
import { useMainLoopModel } from '../hooks/useMainLoopModel.js'
|
||||||
import { useAppState, useSetAppState } from '../state/AppState.js'
|
import { useAppState, useSetAppState } from '../state/AppState.js'
|
||||||
import type { EffortLevel, OpenAIEffortLevel } from '../utils/effort.js'
|
import type { EffortLevel } from '../utils/effort.js'
|
||||||
import {
|
import {
|
||||||
getAvailableEffortLevels,
|
getAvailableEffortLevels,
|
||||||
getDisplayedEffortLevel,
|
getDisplayedEffortLevel,
|
||||||
getEffortLevelDescription,
|
getEffortLevelDescription,
|
||||||
getEffortLevelLabel,
|
getEffortLevelLabel,
|
||||||
getEffortValueDescription,
|
|
||||||
modelSupportsEffort,
|
modelSupportsEffort,
|
||||||
modelUsesOpenAIEffort,
|
modelUsesOpenAIEffort,
|
||||||
standardEffortToOpenAI,
|
|
||||||
isOpenAIEffortLevel,
|
|
||||||
} from '../utils/effort.js'
|
} from '../utils/effort.js'
|
||||||
import { getAPIProvider } from '../utils/model/providers.js'
|
import { getAPIProvider } from '../utils/model/providers.js'
|
||||||
import { getReasoningEffortForModel } from '../services/api/providerConfig.js'
|
import { getReasoningEffortForModel } from '../services/api/providerConfig.js'
|
||||||
@@ -22,7 +19,7 @@ import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js'
|
|||||||
import { Byline } from './design-system/Byline.js'
|
import { Byline } from './design-system/Byline.js'
|
||||||
|
|
||||||
type EffortOption = {
|
type EffortOption = {
|
||||||
label: React.ReactNode
|
label: ReactNode
|
||||||
value: string
|
value: string
|
||||||
description: string
|
description: string
|
||||||
isAvailable: boolean
|
isAvailable: boolean
|
||||||
@@ -44,8 +41,6 @@ export function EffortPicker({ onSelect, onCancel }: Props) {
|
|||||||
|
|
||||||
// For OpenAI/Codex, get the model's default reasoning effort
|
// For OpenAI/Codex, get the model's default reasoning effort
|
||||||
const modelReasoningEffort = usesOpenAIEffort ? getReasoningEffortForModel(model) : undefined
|
const modelReasoningEffort = usesOpenAIEffort ? getReasoningEffortForModel(model) : undefined
|
||||||
const defaultEffortForModel = modelReasoningEffort || currentDisplayedLevel
|
|
||||||
|
|
||||||
const options: EffortOption[] = [
|
const options: EffortOption[] = [
|
||||||
{
|
{
|
||||||
label: <EffortOptionLabel level="auto" text="Auto" isCurrent={false} />,
|
label: <EffortOptionLabel level="auto" text="Auto" isCurrent={false} />,
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
import * as React from 'react';
|
|
||||||
import { FLAG_ICON } from '../../constants/figures.js';
|
|
||||||
import { Box, Text } from '../../ink.js';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ANT-ONLY: Banner shown in the transcript that prompts users to report
|
* ANT-ONLY: Banner shown in the transcript that prompts users to report
|
||||||
* issues via /issue. Appears when friction is detected in the conversation.
|
* issues via /issue. Appears when friction is detected in the conversation.
|
||||||
|
|||||||
Reference in New Issue
Block a user