added a state to hold the current text being typed#845
Merged
Conversation
…istry@3.1.2-2) (latest: rdflib@2.4.0)
Contributor
There was a problem hiding this comment.
⚠️ Not ready to approve
The new localInputValue lifecycle currently risks rendering the input blank/stale due to being cleared and then always preferred by the render selection logic.
Pull request overview
This PR addresses issue #843 (“input typing is faster than saving of value”) by introducing a local, reactive state to keep the RDF input responsive while asynchronous store updates are in flight.
Changes:
- Added a
@state()-backedlocalInputValueto decouple displayed input text from slower RDF store persistence. - Updated render logic to prefer the local value while updates are in flight (or pending).
- Minor dependency lockfile update (
electron-to-chromiumpatch bump).
File summaries
| File | Description |
|---|---|
| src/components/rdf-input/RDFInput.ts | Adds local input state and integrates it into the render/update pipeline to prevent UI lag during async saves. |
| package-lock.json | Updates a transitive dev dependency version/integrity entry. |
Review details
Comments suppressed due to low confidence (1)
src/components/rdf-input/RDFInput.ts:204
- Clearing
localInputValueto''immediately after a successful save can cause the input to briefly render empty while_updateInFlightis still true, and also interacts badly with theinputValueselection logic. It's safer to leavelocalInputValueas-is (it already holds what the user typed) and let the render logic decide when to fall back to the store value.
try {
await this.storeContext.store.updater.updateMany(toDeleteSt, toInsertSt as any)
this.storeVersion += 1
this.localInputValue = ''
} catch (err) {
- Files reviewed: 1/2 changed files
- Comments generated: 1
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Fixes the #843 bug