Repository navigation
feat: add whitelist/unwhitelist functionality for selected users - #297
Merged
Merged
Conversation
- Implemented handleSelectedWhitelistAction to manage adding/removing users from the whitelist based on the current tab. - Added a button to the sidebar for whitelisting/unwhitelisting selected users, displaying the count of selected users. - Updated local storage to persist the whitelisted results. - Styled the new button for better visibility and user experience.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a bulk whitelist/unwhitelist action for selected users in the sidebar and wires it into the scanning UI, with corresponding styling and an updated bookmarklet payload.
Changes:
- Add “Whitelist/Unwhitelist Selected” sidebar button that operates on the current tab’s selection.
- Persist updated whitelist to
localStorageand clear selection after the bulk action. - Add styling for the new sidebar action button and refresh the bookmarklet script in
public/index.html.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/styles/main.scss | Adds styles for the new bulk whitelist/unwhitelist sidebar action button. |
| src/components/Searching.tsx | Implements bulk whitelist/unwhitelist behavior and renders the new sidebar button. |
| public/index.html | Updates the embedded bookmarklet script string to include latest UI/logic changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+47
to
+81
| const handleSelectedWhitelistAction = () => { | ||
| if (state.selectedResults.length === 0) { | ||
| return; | ||
| } | ||
|
|
||
| let whitelistedResults: readonly UserNode[] = []; | ||
|
|
||
| switch (state.currentTab) { | ||
| case "non_whitelisted": { | ||
| const existingIds = new Set(state.whitelistedResults.map(user => user.id)); | ||
| const usersToAdd = state.selectedResults.filter(user => !existingIds.has(user.id)); | ||
| whitelistedResults = [...state.whitelistedResults, ...usersToAdd]; | ||
| break; | ||
| } | ||
|
|
||
| case "whitelisted": { | ||
| const selectedIds = new Set(state.selectedResults.map(user => user.id)); | ||
| whitelistedResults = state.whitelistedResults.filter(user => !selectedIds.has(user.id)); | ||
| break; | ||
| } | ||
|
|
||
| default: | ||
| assertUnreachable(state.currentTab); | ||
| } | ||
|
|
||
| localStorage.setItem( | ||
| WHITELISTED_RESULTS_STORAGE_KEY, | ||
| JSON.stringify(whitelistedResults), | ||
| ); | ||
| setState({ | ||
| ...state, | ||
| whitelistedResults, | ||
| selectedResults: [], | ||
| }); | ||
| }; |
Comment on lines
+72
to
+75
| localStorage.setItem( | ||
| WHITELISTED_RESULTS_STORAGE_KEY, | ||
| JSON.stringify(whitelistedResults), | ||
| ); |
| return <div className="alphabet-character">{currentLetter}</div>; | ||
| }; | ||
|
|
||
| const handleSelectedWhitelistAction = () => { |
Comment on lines
+165
to
+175
| .sidebar-whitelist-action { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| width: 100%; | ||
| margin: 0 0 0.8rem 0; | ||
| text-align: center; | ||
| background: rgba(224, 163, 58, 0.16); | ||
| border-color: rgba(224, 163, 58, 0.32); | ||
| color: #f5d38a; | ||
| } |
Owner
|
I will take a look asap |
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.
PR for #296
Behavior: