-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Persist runner request order #7984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I propose to take care of at least following 2 problems before moving forward:
And the approach of persisting selection looks good. |
75bbd79 to
80f318e
Compare
| }); | ||
| const [allKeys, setAllKeys] = useLocalStorage<string[]>(localStorageKey + 'allKeys', { defaultValue: requestRows.map(item => item.id) }); | ||
| // request was added or removed | ||
| if (allKeys.length !== requestRows.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the condition is more complicated, e.g. this check might not work in this case: user adds one new request and deletes one while actually one request has changed.
| if (newRequest) { | ||
| setAllKeys([...allKeys, newRequest.id]); | ||
| } else { | ||
| setAllKeys(allKeys.filter(key => requestRows.map(r => r.id).includes(key))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user could move one request to another place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats true, feel free to create a new PR to address this.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
future work
Ref: INS-4452
Ref #7980