Skip to content

Commit e3fcf8e

Browse files
gkorlandCopilot
andcommitted
refactor(code-graph): remove unused options/setOptions props
CodeGraph now manages options locally instead of receiving them from App. Remove the dead props from the interface and stop passing them from App.tsx. The Combobox inside CodeGraph fetches options on its own. Addresses typo-app review comment about local state shadowing props. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent dafc549 commit e3fcf8e

2 files changed

Lines changed: 0 additions & 8 deletions

File tree

app/src/App.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export default function App() {
7171
const [createURL, setCreateURL] = useState("")
7272
const [createOpen, setCreateOpen] = useState(false)
7373
const [tipOpen, setTipOpen] = useState(false)
74-
const [options, setOptions] = useState<string[]>([]);
7574
const [path, setPath] = useState<Path | undefined>();
7675
const [isSubmit, setIsSubmit] = useState<boolean>(false);
7776
const desktopChartRef = useRef<GraphRef["current"]>(null)
@@ -141,7 +140,6 @@ export default function App() {
141140

142141
const graphName = createURL.split('/').pop()!
143142

144-
setOptions(prev => [...prev, graphName])
145143
setSelectedValue(graphName)
146144
setCreateURL("")
147145
setCreateOpen(false)
@@ -528,8 +526,6 @@ export default function App() {
528526
data={data}
529527
setData={setData}
530528
canvasRef={desktopChartRef}
531-
options={options}
532-
setOptions={setOptions}
533529
onFetchGraph={onFetchGraph}
534530
isFetchingGraph={isFetchingGraph}
535531
onFetchNode={onFetchNode}
@@ -656,8 +652,6 @@ export default function App() {
656652
data={data}
657653
setData={setData}
658654
canvasRef={mobileChartRef}
659-
options={options}
660-
setOptions={setOptions}
661655
onFetchGraph={onFetchGraph}
662656
isFetchingGraph={isFetchingGraph}
663657
onFetchNode={onFetchNode}

app/src/components/code-graph.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ interface Props {
3030
onFetchGraph: (graphName: string) => Promise<void>,
3131
isFetchingGraph: boolean,
3232
onFetchNode: (nodeIds: number[]) => Promise<GraphData>,
33-
options: string[]
34-
setOptions: Dispatch<SetStateAction<string[]>>
3533
isShowPath: boolean
3634
setPath: Dispatch<SetStateAction<Path | undefined>>
3735
canvasRef: GraphRef

0 commit comments

Comments
 (0)