Draft
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes several TAP UI regressions introduced after enabling the React Compiler, focusing on stabilizing derived state, service option handling, and constraint aggregation across TAP search panels.
Changes:
- Normalize/dedupe TAP service URLs and make service option generation deterministic (
makeTapServiceOptions,normalizeTapUrl). - Refactor TAP search panel/service selection and Spatial constraints computation to be React-Compiler-friendly (avoid mutable/shared references and repeated side effects).
- Enable the React Compiler Babel plugin in the webpack build and improve
<Option>key stability in list rendering.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/firefly/js/ui/tap/TapUtil.js |
Adds URL normalization + deterministic TAP service option merging/deduping; avoids mutating preference arrays. |
src/firefly/js/ui/tap/TapSearchRootPanel.jsx |
Reworks service option derivation and delete handling; moves one-time init work into effects and memoizes options. |
src/firefly/js/ui/tap/SpatialSearch.jsx |
Replaces per-render effect-driven constraint state updates with a memoized constraint result. |
src/firefly/js/ui/tap/Constraints.js |
Expands upload/constraint detection to support adqlConstraintsAry in addition to adqlConstraint. |
src/firefly/js/ui/ListBoxInputField.jsx |
Uses a stable key derived from option content instead of array index. |
buildScript/webpack.config.js |
Turns on the React Compiler Babel plugin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+147
to
156
| const onDeleteServiceOption = (deletedValue) => { | ||
| deleteUserService(deletedValue); | ||
|
|
||
| if (serviceUrl === deletedValue) { | ||
| setServiceUrl(''); | ||
| setTapBrowserState({...getTapBrowserState(), serviceUrl: ''}); | ||
| setVal(ADQL_QUERY_KEY, ''); | ||
| setFld(ADQL_QUERY_KEY, {placeholder: '', value: ''}); | ||
| setObsCoreTableModel(undefined); | ||
| } |
Comment on lines
+241
to
+256
| const constraintResult = React.useMemo(() => { | ||
| const constraints = makeSpatialConstraints( | ||
| columnsModel, obsCoreEnabled, makeFldObj(fldListAry), | ||
| uploadInfo, tableName, canUpload, useSIAv2 | ||
| ); | ||
|
|
||
| return { | ||
| ...constraints, | ||
| constraintErrors: [...(constraints.errAry ?? [])], | ||
| simpleError: constraints.errAry?.[0] ?? '', | ||
| }; | ||
| }, [columnsModel, obsCoreEnabled, uploadInfo, tableName, canUpload, | ||
| useSIAv2, targetWp, spatialRegOp, spatialType, spatialMethodVal, | ||
| radiusVal, polygonCornersVal, centerLonVal, centerLatVal, | ||
| uploadCenterLonVal, uploadCenterLatVal, cornerCalcTypeVal, closestVal, | ||
| ]); |
Comment on lines
19
to
34
| @@ -16,7 +29,8 @@ export function isTapUpload(tapBrowserState) { | |||
| */ | |||
| export function getUploadConstraint(tapBrowserState) { | |||
| const {constraintFragments}= tapBrowserState; | |||
| return [...constraintFragments.values()].find( (c) => Boolean(c.uploadFile && c.TAP_UPLOAD && c.adqlConstraint)); | |||
| return [...constraintFragments.values()] | |||
| .find((c) => Boolean(c.uploadFile && c.TAP_UPLOAD && hasAdqlConstraint(c))); | |||
| } | |||
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.
Ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-1943
Testing:
Firefly, Euclid and Spherex