Repository navigation
Conversation
4 of 6 tasks
Align PluginStatus with backend and drop nonexistent DOWNLOADED state.
fetchDatasets was read without being defined; it now comes from the surrounding context.
A conditional hook call can crash the render when the condition flips.
…iles The previous config enabled no rule and could not read .ts files.
TypeScript 4.9 could not parse the type files of current libraries, so the check failed before reaching our code.
Both pass with zero errors.
…submit The submit handler was a leftover stub; running a prediction goes through onRun.
It was loaded once on mount, so switching sessions kept the previous session's history until the dialog was reopened.
Irozuku
force-pushed
the
refactor/frontend-audit
branch
from
November 27, 2026 16:48
7774624 to
0642e24
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An audit of the frontend. It fixes the bugs the audit found, removes unused code and dependencies, and makes
yarn lintandyarn typecheckwork, so the same problems are caught from now on.Before this branch the ESLint config enabled no rule and could not parse
.tsfiles, andyarn typecheckfailed inside library type files because TypeScript 4.9 was too old. With no frontend tests either, nothing checked the frontend except the build.Type of Change
Changes (by file)
Bugs fixed:
components/DatasetVisualization.jsx:fetchDatasetswas used without being defined. Opening a dataset that was still processing threw aReferenceError. It now comes from the surrounding context.components/notebooks/converter/ItemsToDeleteList.jsx,components/notebooks/explorer/plotLayout/PlotLayoutForm.jsx,components/shared/FormSchemaRenderFields.jsx: ten hooks were called after an earlyreturn. React requires the same hooks on every render, so these could crash when the condition changed. The early returns now come after the hooks.pages/plugins/components/PluginsTab.jsx,pages/plugins/hooks/usePluginsUpgrade.js,types/plugin.ts: undefinedenqueueSnackbarandt, and a plugin status enum that did not match the backend.components/generative/ParamsBar.jsx: the parameter history was loaded once on mount, so after switching sessions it still held the previous session's history.components/configurableObject/FormTooltip.jsx,components/updates/UpdatesDialog.jsx,components/notebooks/documentNotebook/DocumentItemsPanel.jsx,components/notebooks/explorer/visualizations/PlotlyJsonVisualizer.jsx: components that were defined inside another component's render, and so remounted on every render, are now defined once.components/predictions/ManualInput.jsx,ManualInputForm.jsx: a leftoveronSubmitstub logged the form rows to the console.utils/i18n/index.js: thehubtexts were never registered for German and Portuguese. Locale files are now loaded withimport.meta.glob, so a new file cannot be forgotten. The 110 hand written imports are gone.Unused code removed:
package.json:@mui/x-data-grid,@tanstack/react-table,react-uuid,react-virtualized-auto-sizer,react-window,reactflow,@mui/utilsandweb-vitals. Nothing imports them.src/reportWebVitals.js: Create React App leftover that was called without a callback, so it did nothing.no-unused-varsis now an error.console.logcalls and 2 commented out ones.Tooling:
eslint.config.js: correctness rules as errors (undefined variables, duplicate keys, unreachable code, missingkey, rules of hooks); noisier rules as warnings..tsfiles are parsed with@typescript-eslint/parser.eslint-plugin-react-hooksadded.tsconfig.json,package.json: TypeScript 5,@types/react18 to match React 18, module resolution for Vite. The template comments intsconfig.jsonare dropped..github/workflows/build-test.yaml: runsyarn lintandyarn typecheckbefore the build.Testing (optional)
Notes (optional)
Found and not changed here. Each is a warning in
yarn lintor a note for follow up:react-hooks/exhaustive-depswarnings. They were triaged, not bulk fixed. The 29useMemoanduseCallbackcases and the 14 effects most likely to be stale were read one by one: all but one use a deliberate stand-in dependency (an id instead of the object, a serialized key, a search string instead of the filter function) or run once on purpose, several with a comment saying so. Applying the suggested fixes blindly would be harmful; inhooks/generative/useSessions.jsit would recreate a refetch loop the code documents. The one real case, the parameter history inParamsBar.jsx, is fixed. The rule stays a warning.react/no-unstable-nested-componentswarnings remain. They are table column renderers created insideuseMemoand list render callbacks, which are stable. The 5 real cases are fixed.key.