Integrating Tim's work on separating RDF forms#779
Open
timea-solid wants to merge 4 commits into
Open
Conversation
- autocompleteBar.ts now imports directly from ../../buttons and ../../dragAndDrop - autocompleteField.ts imports from ../../error and ../basic - autocompletePicker.ts imports from ../../error - forms.js no longer imports ../widgets at all
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the refactor to separate RDF form/widget functionality by replacing broad widgets imports with more focused module imports (buttons, error, drag-and-drop, basic field label), and adjusts button APIs to support call sites that don’t provide handlers.
Changes:
- Refactor autocomplete form components to import
errorMessageBlock,fieldLabel, button helpers, and drag-and-drop directly (instead of viawidgets). - Update
cancelButton/continueButtonsignatures to allow an omitted click handler. - Update Jest snapshots and refresh
package-lock.jsonfrom dependency resolution.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/widgets/forms/autocomplete/snapshots/autocomplete.test.ts.snap | Snapshot updates for autocomplete field rendering (currently reflecting a style="undefined" regression). |
| test/unit/widgets/forms/snapshots/basic.test.ts.snap | Snapshot updates for basic field error rendering (currently reflecting missing inline styles). |
| test/unit/widgets/snapshots/error.test.ts.snap | Snapshot updates for errorMessageBlock rendering (currently reflecting missing inline styles). |
| src/widgets/forms/autocomplete/autocompletePicker.ts | Switch from widgets.errorMessageBlock to direct errorMessageBlock import. |
| src/widgets/forms/autocomplete/autocompleteField.ts | Replace widgets.* usage with direct imports; adjust error rendering and label rendering. |
| src/widgets/forms/autocomplete/autocompleteBar.ts | Replace widgets.* usage with direct imports from buttons and dragAndDrop. |
| src/widgets/forms.js | Remove unused widgets import; use buttons.continueButton and direct errorMessageBlock. |
| src/widgets/error.ts | Switch cancelButton import to ./buttons and change style import style (currently incorrect). |
| src/widgets/buttons.ts | Make cancelButton/continueButton handler parameter optional. |
| package-lock.json | Lockfile changes from dependency updates/resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { style } from '../../../style' | ||
| import { errorMessageBlock } from '../../error' | ||
| import { fieldLabel } from '../basic' | ||
| import * as style from '../../../style' |
Comment on lines
69
to
72
| } catch (err) { | ||
| callbackFunction(false, err) | ||
| box.appendChild(widgets.errorMessageBlock(dom, 'Autocomplete form data update error:' + err, null, err)) | ||
| box.appendChild(errorMessageBlock(dom, 'Autocomplete form data update error:' + err, err)) | ||
| return |
Comment on lines
93
to
97
| } catch (err) { | ||
| const e2 = new Error('Autocomplete form data delete error:' + err) | ||
| callbackFunction(false, err) | ||
| box.appendChild(widgets.errorMessageBlock(dom, e2, null, err)) | ||
| box.appendChild(errorMessageBlock(dom, e2, err)) | ||
| return |
Comment on lines
+13
to
15
| import { cancelButton } from './buttons' | ||
| import * as style from '../style' | ||
| import styleConstants from '../styleConstants' |
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.
No description provided.