Skip to content

feat: add whitelist/unwhitelist functionality for selected users - #297

Merged
davidarroyo1234 merged 1 commit into
davidarroyo1234:masterfrom
vunsh:master
Jul 26, 2026
Merged

davidarroyo1234 merged 1 commit into
davidarroyo1234:masterfrom
vunsh:master

Conversation

@vunsh

@vunsh vunsh commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

PR for #296

  • 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.
image

Behavior:

  • When user(s) are selected, whitelist/unwhitelist button appears on sidebar. Clicking it whitelists/unwhitelists the users selected based on what tab is currently selected

- 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.
Copilot AI review requested due to automatic review settings June 3, 2026 00:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 localStorage and 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 thread src/styles/main.scss
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;
}
@davidarroyo1234

Copy link
Copy Markdown
Owner

I will take a look asap

@davidarroyo1234
davidarroyo1234 merged commit d66b746 into davidarroyo1234:master Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants